Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CS4315 Operating Systems Lab assignment 1: Linux Tutorial Try the following comm

ID: 3881892 • Letter: C

Question

CS4315 Operating Systems Lab assignment 1:

Linux Tutorial Try the following commands on Gator Linux system and record the response you get for each command.

Question 1-16 are for your own exercise (you don’t need to submit your solution), and Question 17 is for submission (you submit a screenshot as described in the question).

1. find out the usage of “ls” using man (record only the first two lines)

2. find out the usage of C function “finger” (record only the first two lines)

3. use “alias” to make “dir” equivalent to “ls –lF” and then run “dir”

4. use “ls –a” to list all hidden files

5. use “cat” to list the content of file “.bash_profile”

6. use tilde to list the content of your home directory

7. create a subdirectory “Projects” in your home directory

8. move a file from your home directory to subdirectory “Projects”

9. copy the file you moved back to your home directory

10. erase the files in your “Projects” subdirectory

11. erase subdirectory “Projects”

12. use “cat” to copy two files into one file

13. use “grep” to search for your user name in your “.bash_profile” file

14. count the number of words in your “.bash_profile” file

15. find out all the users that are in the system

16. Use pipe to find the listing of users that are currently in the system and write the result to a file userlist.txt. Then display the content of userlist.txt on your screen.

17. Use vi to create a file and type some text (any text is ok). Then save the file and quit vi. In the prompt line, use command cat to display the file content. Make a screenshot (that shows the putty interface including your command lines and the file content) for submission (i.e. you submit an image file screen.jpg)

Explanation / Answer

1)

               Man command is used to list the functioning, possible argument list of any command.

               $ man (ls)

               2) Finger command is used to find information about computer users.

               $ man (finger)

               3) alias is used to make alias of a command. Alias of command “ls –lF” is created as dir. Running the dir command will give the same result as “ls –lF”.

               $ alias dir = “ls –lF”

               $ dir

               4) ls- a command is used to show all the hidden files.

               $ ls –a

               5) Listing the content of .bash_profile file.

               $ cat /home/user/.bash_profile

               7)

               Creating directory Projects in home directory using dir command

               $ dir /home/Prohects

               8)

               Copying file chegg.txt from home directory to the created directory Projects

$ mv /home/chegg.txt /home/Projects

               9)

               Copying the file chegg.txt from Projects directory back to home directory using cp command

$ cp /home/Projects/chegg.txt /home

               10)

               Removing all the files from the Projects subdirectoy using rm command.

$ rm /home/Projects

               11)

               Using the subdirectoy Projects using rmdir command.

$ rmdir /home/Projects

               12)

               Merging the content of file1.txt and file2.txt into file3.txt

               $ cat file1.txt file2.txt > file3.txt

               13) This command will search "username" in .bash_profile

$ grep “username” /home/user/.bash_profile

               14) This command will count the number of words in .bash_profile file.

$ wc –w /home/user/.bash_profile

               15)

               Who command will list all the logged in user of the system

$ who

               16)

               Wrting the output of who command to a text file userlist.txt and then displaying the content of userlist.txt file using cat command

               $ who > userlist.txt

               $ cat userlist.txt

               17)

               Vi command will open vi editor with a blank file named myfile.txt. After entering the content in myfile.txt, will save the file using :wq

               $ vi myfile.txt

               $ cat myfile.txt