Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exploring Linux File systems Part a (Fedora) Tab Completion In this hands-on project, you navigate the Linux filesystem using the Tabcompletion feature of the BASH

Exploring Linux File systems Part a (Fedora) Tab Completion In this hands-on project, you navigate the Linux filesystem using the Tabcompletion feature of the BASH shell. 1. Switch to a command-line terminal (tty3) by pressing Ctrl+Alt+F3 and log in to the terminal using the user name of the root. 2. At the command prompt, type cd / and press Enter. 3. Next, type cd ro at the command prompt and press Tab. That find the name of the directory which start with ro (root ) and complete cd ro to cd root/ ( completes the name of the directory) 4. Press the Ctrl and c keys simultaneously to cancel the command and return to an empty command prompt. 5. At the command prompt, type cd b and press Tab one time. Since under the current working directory, we have more than one directory which its name starts with b (boot and bin) pressing tab for the first time is not going to complete the name of the directory. Press Tab for the second time, you will see the list of directories that their name starts with b ( boot and bin). 6. Type the letter i. Notice that the command now reads cd bi. Press the Tab key again. Since we have only one directory which its name starts with bi, that will complete the name of the directory to cd bin/. 7. On your terminal type ls /etc/sam then use the tab completion to complete the name. Image6: take a screenshot of this step and attach it in your answer sheet 8. Press the Ctrl and c keys simultaneously to cancel the command and return to an empty command prompt. Using ls Command In this hands-on project, you examine files and file types using the ls and file commands. 1. Switch to a command-line terminal (tty3) by pressing Ctrl+Alt+F3 and log in to the terminal using the user name of the root. 2. At the command prompt, type cd /etc and press Enter. Verify that you are in the /etc directory by typing pwd at the command prompt and press Enter. 3. At the command prompt, type ls and press Enter. What do you see listed in the four columns? Do any of the files have extensions? What is the most common extension you see, and what does it indicate? Is the list you are viewing on the screen the entire contents of /etc? 4. At the command prompt, type ls | more and then press Enter (the | symbol is usually near the Enter key on the keyboard and is obtained by pressing the Shift and \ keys in combination). What does the display show? Notice the highlighted --More-- prompt at the bottom of the screen. Press Enter. Press Enter again. Press Enter once more. Notice that each time you press Enter, you advance one line further into the file. Now, press the spacebar. Press the spacebar again. Notice that with each press of the spacebar, you advance one full page into the displayed directory contents. Press the h key to get a help screen. Examine the command options. 5. Press the q key to quit the more command and return to an empty command prompt. 6. At the command prompt, type ls | less and then press Enter. What does the display show? Notice the : at the bottom of the screen. Press Enter. Press Enter again. Press Enter once more. Notice that each time you press Enter, you advance one line further into the file. Now press the spacebar. Press the spacebar again. Notice that with each press of the spacebar, you advance one full page into the displayed directory contents. Press the h key to get a help screen. Examine the command options, and then press q to return to the command output. 7. Press the " (up arrow) key. Press " again. Press " once more. Notice that each time you press the " key, you go up one line in the file display toward the beginning of the file.Now, press the (down arrow) key. Press the key again and again. Press the down arrow once more. Notice that each time you press the down arrow key, you move forward into the file display. 8. Press the q key to quit the less command and return to a shell command prompt. Question8: When do you use less or more command? What is the difference between less and more? Which one is better? 9. At the command prompt, type cd and press Enter. At the command prompt, type pwd and press Enter. What is your current working directory? At the command prompt, type ls and press Enter. 10. At the command prompt, type ls /etc and press Enter. How does this output compare with what you saw in Step 9? Has your current directory changed? Verify your answer by typing pwd at the command prompt and press Enter. Notice that you were able to list the contents of another directory by giving the absolute name of it as an argument to the ls command without leaving the directory in which you are currently located. 11. At the command prompt, type ls /etc/skel and press Enter.Did you see a listing of any files? At the command prompt, type ls -a /etc/skel and press Enter. Image 7: take a screenshot of this step. And attach it to your answer sheet. Question9: What is the difference between the output of ls /etc/skel and ls a /etc/skel? What is special about the files inside /etc/skel directory? What do the first two entries in the list ( . and .. ) represent? 12. At the command prompt, type ls -aF /etc/skel and press Enter. Hint: for ls -F see page 90 of your book Question10: Which file types are available in the /etc/skel directory? 13. At the command prompt, type ls -F /bin and press Enter. Did you see a listing of any files? At the command prompt, type ls -l /bin and press Enter. Image 8: take a screenshot of this step. And attach it to your answer sheet. Question11: What file type is the /bin directory? Which character after the name of the file or at the beginning of the line on output s of each command represents the type of file? 14.At the command prompt, type ls F /bin/* | more and press Enter. Next, type ls l /bin/* | more and press Enter. Question12: What file type do you see on the output, you dont need to list the file name, just explain if the files are a symbolic link, a directory or standard file. Also, how do you determine the permission for a file, or if a file is executable? 15. At the command prompt, type ls /boot and press Enter. Next, type ls l /boot and press Enter. What additional information is available on the screen? Question13: What types of files are available in the /boot directory? At the command prompt, type ll /boot and press Enter. Is the output any different from that of the ls l /boot command you just entered? Why or why not? 16.At the command prompt, type file /etc and press Enter. At the command prompt, type file /etc/inittab and press Enter. What type of file is /etc/inittab? Question14: What kind of file is /etc/inittab? 17.At the command prompt, type file /boot/* to see the types of files in the /boot directory. Is this information more specific than the information you gathered in Step 15? 18. Type exit and press Enter to log out of your shell. Displaying the content of a File In this hands-on project, you display file contents using the cat, tac, head, tail, strings and od commands. 1. Switch to a command-line terminal (tty3) by pressing Ctrl+Alt+F3, and then log in to the terminal using the user name of the root. 2. At the command prompt, type cat /etc/hosts and press Enter to view the contents of the file hosts, which reside in the directory /etc. Next, type cat n /etc/hosts and press Enter. How many lines does the file have? At the command prompt, type tac /etc/hosts and press Enter to view the same file in reverse order. The output of both commands should be visible on the same screen. Compare them. 3. To see the contents of the same file in octal format instead of ASCII text, type od /etc/hosts at the command prompt, and press Enter. 4. At the command prompt, type cat /etc/inittab and press Enter. 5. At the command prompt, type head /etc/inittab and press Enter. 6. At the command prompt, type head -12 /etc/inittab and press Enter. How many lines are displayed and why? Next, type head -3 /etc/inittab and press Enter. How many lines are displayed, and why? . Question15: what is the difference between head -12 /etc/inittab and head -3 /etc/inittab ? explain your answer 7. At the command prompt, type tail /etc/inittab and press Enter. What is displayed on the screen? How many lines are displayed; which ones are they and why? Question16: What is displayed on the screen? How many lines are displayed, which ones are they, and why? 8. At the command prompt, type tail -5 /etc/inittab and press Enter. How many lines are displayed, and why? Type the cat n /etc/inittab command at a command prompt and press Enter to justify your answer. 9. At the command prompt, type file /bin/nice and press Enter. What type of file is it? On your terminal type, type cat /bin/nice. Should you use the cat command on this file? 10.At the command prompt, type strings /bin/nice and press Enter. Notice that you are able to see some text within this binary file. Next, type strings /bin/nice | more to view the same content page-by-page. When finished, press q to quit the more command. Question17: What is the difference between cat and strings command ? 11. Type exit and press Enter to log out of your shell.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago

Question

Address an envelope properly.

Answered: 1 week ago

Question

Discuss guidelines for ethical business communication.

Answered: 1 week ago