Question

In: Computer Science

--> Take a copy of the / etc / passwd file to the root user's home...

--> 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

Solutions

Expert Solution

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.


Related Solutions

This lab will explore the password files. a) Open a terminal window and type less /etc/passwd....
This lab will explore the password files. a) Open a terminal window and type less /etc/passwd. Which line describes the root account? b) Type ls –l /etc/passwd. Who is the owner of the passwd file? What are the permissions? c) Type less /etc/shadow. What is in the password filed for most of these accounts? d) Type ls –l /etc/shadow. Who owns this file and how do the permissions differ from the /etc/passwd file? e) Type cat /etc/default/useradd. What is the...
$ grep/ sbin/nologin$/etc/passwd| cut -d “:”-f1| short| less explan the output
$ grep/ sbin/nologin$/etc/passwd| cut -d “:”-f1| short| less explan the output
can you please do the following? (8) Step 8: type the following command: sort /etc/passwd |...
can you please do the following? (8) Step 8: type the following command: sort /etc/passwd | head -5 What is the output? Notice that this pipe can be simplified cat /etc/passwd | head -5 What is the output for this? You could accomplish the same thing more efficiently with either of the two commands: head -5 /etc/passwd head -5 < /etc/passwd (9) Step 9: The command displays all the files in the current directory sorted by file size ls -al...
Ubuntu Linux HW5: text processing; scripting 1. Write a Linux command to rewrite the /var/passwd file...
Ubuntu Linux HW5: text processing; scripting 1. Write a Linux command to rewrite the /var/passwd file to have a tab for each delimiter ':'. Hint: use tr 2. Write a Linux command to extract the user names and sort them. Hint: use cut 3. Write a for loop to to display a time table, e.g., 17 x 1 = 17; 17 x 2 = 34; etc., as follows: 17 x 1 = 17 17 x 2 = 34 17 x...
2) Write a program(C#) that prompts the user for her home planet. Based on the user's...
2) Write a program(C#) that prompts the user for her home planet. Based on the user's input the program will display the following: Input: earth Message: earth. You are an Earthling and you have 10 fingers Input: VENUS Message: VENUS. You are a Venusian and you have 12 fingers Input: Mars Message: Mars. You are a Martian and you have 8 fingers any other input Message: I am sorry I don't know of that planet You may use either the...
Write a program(C#) that prompts the user for her home planet. Based on the user's input...
Write a program(C#) that prompts the user for her home planet. Based on the user's input the program will display the following: Input: earth Message: earth. You are an Earthling and you have 10 fingers Input: VENUS Message: VENUS. You are a Venusian and you have 12 fingers Input: Mars Message: Mars. You are a Martian and you have 8 fingers any other input Message: I am sorry I don't know of that planet You may use either the ToUpper()...
What is the function of the Document Root statement in theApache configuration file? By default,...
What is the function of the Document Root statement in the Apache configuration file? By default, where is the document root located? If you needed to change the document root, what would you do? What statement in the Apache configuration file tells the server what port to listen for HTTP traffic on? 
What is the function of the Document Root statement in theApache configuration file? By default,...
What is the function of the Document Root statement in the Apache configuration file? By default, where is the document root located? If you needed to change the document root, what would you do? What statement in the Apache configuration file tells the server what port to listen for HTTP traffic on? 
USE BASIC PYTHON Focus on Basic file operations, exception handling. Save a copy of the file...
USE BASIC PYTHON Focus on Basic file operations, exception handling. Save a copy of the file module6data.txt (Below) Write a program that will a. Open the file module6data.txt b. Create a second file named processed. txt c. Read the numbers from the first file one at a time. For each number write into second file, if possible, its I. Square ii. Square root iii. Reciprocal (1/number)use a math module function for the square root. use exception handling to trap possible...
Permissions– commands and options Provide commands with screenshots. (a) Create a new file in the root...
Permissions– commands and options Provide commands with screenshots. (a) Create a new file in the root directory. What is the default permission for this file? (b) Set the directory permission to 400. What does it mean? (c) Set the directory permission to 100. What does it mean? (d) Set the directory permission to 200. What does it mean?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT