Enter the following command: grep home /etc/passwd. Now re-run an equivalent command using a Pipe (1) operator, and veri

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Enter the following command: grep home /etc/passwd. Now re-run an equivalent command using a Pipe (1) operator, and veri

Post by answerhappygod »

Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 1
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 1 (39.97 KiB) Viewed 56 times
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 2
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 2 (32.64 KiB) Viewed 56 times
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 3
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 3 (27.35 KiB) Viewed 56 times
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 4
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 4 (38.83 KiB) Viewed 56 times
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 5
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 5 (31.44 KiB) Viewed 56 times
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 6
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 6 (34.05 KiB) Viewed 56 times
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 7
Enter The Following Command Grep Home Etc Passwd Now Re Run An Equivalent Command Using A Pipe 1 Operator And Veri 7 (20.73 KiB) Viewed 56 times
Enter the following command: grep home /etc/passwd. Now re-run an equivalent command using a Pipe (1) operator, and verify it yields the same results. (Do not simply use more at the end for your pipe operator) What command did you enter? The Pipe operator directs standard from the first command, into standard into the second command Enter a command using grep with no pipe operator, to search for all lines in the /etc/passwd file WHICH START with the letters "root". (Use google if you need to, to find what special character for grep is used to find matches that start with the text you specify). What command did you enter? You should get at least one entry for the "root" account, since the lete/passwd file is where Linux accounts are stored and the root account exists on every Linux system. Re-run the previous command, this time specifying "ROOT", in capitals, but use the "ignore case" option on your grep command. You should get the same output. What command did you enter? Use the we command without a pipe operator to find out how many lines the /etc/passwd file contains. What command did you enter? Use the we command with a pipe operator to find out how many processes are running on the system. What command did you enter?

Enter a command with we and grep to find out the number of non-root processes running on the system. Remember to use the for the grep command: Explain how this command could helpful in the real world to the system administrator, Include the concept of "applications in your answer Enter a command to find out how many characters (not lines), are in your /etc/passwd file? Enter a command (with 2 pipe operators) to display all processes on the system (ps-er command), search (grep) this output for root, and pipe this output to get page by page (more) output. What command did you enter? Enter a command, with a pipe operator which will list out only the account names (first field) in the /etc/passwd file and them have them in sorted output. Do not use multiple commands with semicolons, but rather use pipe(s): Run and investigate the following command and explain what it does: Isode (If you get too many files, it is probably better to create an empty directory and create 1 or 2 files in there, so your output is simpler)

Enter a command, using a pipe operator which finds the number of processes running as root on the system: Enter a command, using a pipe operator which displays brief output of all software packages in sorted order: Explain what this command does: rpm -qal more SECTION 2 - Using the vi editor The vi editor has 3 modes of operation. They are: and What is the default mode of operation upon first entering vi? What characters are entered at the "prompt in vi to save a file and quit vi? What characters are entered at the "." prompt in vi which do NOT save a file and quit vi? Enter/create a new file using the vi editor and call it vitest. What command did you use:

Go into insert mode in this vi session. What key did you use: Add the following text information in this file: This is a test file using the vi editor. Opinions vary a great deal regarding the vi editor in LINUX. It seems very cumbersome at first, but when one gets familiar with it, its power is revealed, as it has many capabilities. Pipes are a very important concept to learn in working with LINUX. Pipes, along with redirection, are two of the more important introductory concepts for working in LINUX. 2 Now go out of insert mode and into command mode in this vi session. What key did you use: Delete the entire first line in this file. What command mode key sequence did you enter? Undo this last delete line operation. What command mode key sequence did you enter? Delete the first 2 lines in this file using one dd commnd. What command mode key sequence did you enter? Again, Undo this last delete line operation. What command mode key sequence did you enter"

Go to the top of the document using the arrow keys, and while still in command mode, search for the existence of the word "LINUX". What command mode key sequence did you enter? After finding the first occurrence of "LINUX", find the next occurrence. What command mode key sequence did you enter to find subsequent occurrences of "LINUX"? Exit this file and save it. What key sequence did you enter: Re-enter this file using the vi editor. Copy and paste the "This is a test file using the vi editor." line by pasting a duplicate line below the original line. What key sequence did you enter: Go into extended ) mode and turn on line numbering. What extended (6) mode key sequence did you enter? Now turn line numbering off. What extended () mode key sequence did you enter now? Go to the top of the page, and Replace all occurrences of "LINUX" with "linux" in the file using a command in extended (s) mode. What key sequence and command did you enter

SECTION 3 - Using sed, awk and command aliases Create 2 files with the vi editor, one called sports (for team sports) and on called isports (for individual sports) If you have these files from (previous) Lab 3, they can be used for this lab, but make sure they have the following contents sports isports Hockey Pool Baseball Tennis Basketball Golf Football Bowling Soccer Skating Using the sed command and no pipe operator, replace any occurrences of "Basketball" in the sports file, with BASKETBALL and send the output to the screen. Verify the command worked What command did you enter? Now cat the tsports file. Is it changed from the sed command? Now enter the same sed command and send the output to a file in /tmp called sed.out, using an absolute path. What command did you enter? Display the contents of this output file in /tmp using an absolute path. What command did you enter? Now we will use the sed command with a pipe operator and output redirection. Cat the isports file and pipe it into a sed command, which will replace all occurrences of "Golf" in the file, with "GOLF" and send the output to a file called sed.out. Verify the command worked. What command did you enter? nain A

Using the paste command, paste the output of the sports and tsports files and pipe this into the awk command, and have the awk command extract the 1" field of this output. Enter the command you used below: Create a command alias for the Is -al command called dls. What command did you use? Now type in dls. Did you get the results you expected, an is -al listing? View your aliases and notice the new alias you created. What command do you type to view your command aliases? Now remove the dls command alias. What command did you use? Now type dls and you should get an error. Explain the error.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply