In: Computer Science
--> Take a copy of the / etc / passwd file to the root user's
home directory.
--> Transfer the username-userID information in this file to the
file named user_idler.txt.
--> Export the file named user_idler.txt in alphabetical order
to user_list.txt file
--> Show how many lines the file user_idler.txt consists
of.
--> Find the number of lines for the letter in the file named
user_idler.txt
Take a copy of the / etc / passwd file to the root user's home directory
Command:
cp /etc/passwd
The cp command is a command-line utility for copying files and directories.
Transfer the username-userID information in this file to the file named user_idler.txt
awk -F: '{print $1,$3}' /etc/passwd > user_idler.txt
awk command searches files for text containing a pattern. When a line or text matches, awk performs a specific action on that line/text
Export the file named user_idler.txt in alphabetical order to user_list.txt file
sort user_idler.txt > user_list.txt
SORT command sorts the contents of a text file, line by line.
Find the number of lines for the letter in the file named user_idler.txt
wc -l user_idler.txt
The wc (word count) command in Unix/Linux operating systems is used to find out number of newline count, word count, byte and characters count in a files specified by the file arguments. The
Find the number of lines for the letter in the file named user_idler.txt
I could not understand the question, for what letter I should count the number of lines?? please specify this in comment and I'll try to answer that. Thanks for understanding
If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.
Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me.