Question

I am in need of some help with UNIX/Linux, particularly sed and awk: Please help me...

I am in need of some help with UNIX/Linux, particularly sed and awk:

Please help me Display from /etc/passwd a list of users and their shells for those using the
Korn shell or Bash shell. Order the output by the absolute pathname of the shell used.

Thank you.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

from /etc/passwd

first we need to cut itaccording to required specifications

1)cut -d: -f1/etc/passwd

then now use sed command:

2)sed 's/:.*//' /etc/passwd

this is to make sure that it seperates the required format

then the last command which is to be used is:

awk -F: '{print $1}' /etc/passwd

this is used to print the requiired format

Add a comment
Know the answer?
Add Answer to:
I am in need of some help with UNIX/Linux, particularly sed and awk: Please help me...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Can you help me? I am taking an INTRODUCTORY unix/linux shell programming course and need to...

    Can you help me? I am taking an INTRODUCTORY unix/linux shell programming course and need to know what the following command will do. Need a SIMPLE answer please. onsystem john1 &

  • I need some help with the cp command in Unix/Linux. I need to copy all the...

    I need some help with the cp command in Unix/Linux. I need to copy all the files in my current directory A03 into the backup directory. How do I do this? I am taking an introductory unix/linux course so I need a basic answer. Thanks.

  • I need some help with Linux I want to delete the line by using sed: echo...

    I need some help with Linux I want to delete the line by using sed: echo '[email protected]' | sed '/\S\@\S\.\S/d' this command does not work. What is the problem?

  • I need help with my homework assignment Linux systems keep user account information in the passwd...

    I need help with my homework assignment Linux systems keep user account information in the passwd file and the encrypted password in the shadow file. The passwd file containing account information might look like this: smithj:x:1001:1001:John Smith:/home/smithj:/bin/bash The shadow file containing password and account expiration information for users might look like this: smithj:KJDKKkkLLjjwlnttqoiybnm.:10063:0:99999:7::: The fields in the shadow file are separated by a colon, with the first field being the username and the second being the password. Under normal circumstances,...

  • Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell...

    Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell variables, and .profile script file, echo SHELL, HOME, PATH, MAIL and TERM are predefined shell variables. You can use the value of a shell variable in a shell command putting $ in front of it. For example, to display the value of the HOME directory of the user, specify $HOME in the echo command like echo $HOME. Do not give just the value of...

  • I am a college student taking an intro to linux shell programming course and need some...

    I am a college student taking an intro to linux shell programming course and need some help with this question. I need to write an until statement as indicated: Check to see if the file cis132 exists in the current directory. If it does not a message will be printed every 10 seconds indicating that file does not exist. Once the file is created the message will stop. Thanks for your help.

  • Hello, I am attempting to write a basic shell script using bash. It will need to...

    Hello, I am attempting to write a basic shell script using bash. It will need to print the user, host, time, and date. It will need to take user input for a txt file to be searched and create a new file to save the results. It must print the number of lines and characters in the text. The user will need to enter three words to be searched, and the number of occurrences of those words in the text...

  • UNIX File Permission help, please answer the questions in the green boxes. Thank you Lab 03...

    UNIX File Permission help, please answer the questions in the green boxes. Thank you Lab 03 File Permissions In this lab we will: learn about file permissions learn to create symbolic links and hard links Utilities that will be utilized in this Lab: us, cd, less, cat touch, chmod id umask, mkdir, In, echo and redirection Users and Groups Linux supports several methods of controlling access to files an directories. In this lab we are going to learn the traditional...

  • I am a beginner in shell. Please help me with this question. question: In this assignment,...

    I am a beginner in shell. Please help me with this question. question: In this assignment, you will research into a few standard Unix utilities and leverage them in a shell script to perform a simple but useful task that's right up the alley of Unix shell scripting. As usual, you should aim for reasonably efficient algorithms and reasonably organized, comprehensible code. Consolidating log files My Internet chat software recording my conversations into daily log files, each named by date,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT