Execute the command whoami in both windows who are you -


Part -1:

1. Boot your Ubuntu system and open two command shells. In one of the two use the su command to change to the root identity: su - root

Read the man page on the su command. What is the meaning of the - option?

____________________________________________________________

____________________________________________________________

2. Execute the command whoami in both windows: who are you?

____________ ____________

3. Read the man page on the adduser command and the one on the useradd command. Which command should you use, and why?

____________________________________________________________

____________________________________________________________

How many arguments should you give when you use the adduser command? Create three new user identities: flashgordon, dalearden, and mingthemerciless. Does the adduser command work in both windows? Who is allowed to run the adduser command?

____________ ____________ ____________

4. Read the man page for the passwd command. If you do not provide any arguments to that command, whose password will be changed?

____________________________________________________________

5. Use the less command to read the file containing user information: less /etc/passwd
Look for your new identities at the end of that file. (Type 'q' to end the command when you are done.)

6. Use the tail command to read the last five lines of the /etc/passwd file.

7. Now run the command echo $PATH in both windows. What you see there is a list of directories which will be searched for the executable code associated with any commands you issue. The entries in the list are separated with the colon character (:). What is the last entry on the list?

____________ ____________

8. Compare the command prompt you see in the two windows. What information can you glean from the prompt?

___________________________________________________________

9. Use the exit command in the window that recognizes you as root. Use the exit command again. Now use the exit command in your other window. What happened? Open a new terminal window and run the command man exit. Why was the effect of the command different in the different windows? That is, why did one exit get you out of one of the windows, while closing the other required two?

____________________________________________________________

____________________________________________________________

10. Open a new terminal window and read the man page on the shutdown command. What command would you type to halt the system in 30 minutes?

____________________________________________________________

11. SHUT DOWN YOUR SYSTEM BEFORE YOU LEAVE!

Part -2:

1. Boot your system and open a terminal Window.

2. Using vi/vim, create a file named sample1.txt. (NOTE: Explore these two commands using man pages and the which command. Do you invoke the editor using the vi command or the vim command or both? Behind the scenes, is it vi or vim which is being executed?)

3. Change from command mode to insert mode by typing the 'i' character. Type the following text: "Creating a file is easy."

4. Save your file and exit the editor.

5. Using the pwd command, record your working directory path below:

______________________________________________________

6. Using the ls command with the -l option, record the owner and group owner for your file.

______________________________________________________

7. Using vi/vim, open sample1.txt.

8. Navigate to the word "Creating" and replace it with "Editing".

NOTE: While in insert mode, the delete key works normally, but the arrow keys will produce strange results (they are actually control sequences). Navigate while in command mode, using the arrow keys, and switch to insert mode when you want to delete a character. ALSO note that you can delete an entire line while in command mode, by typing a double-d.

9. Navigate to the word "a" and delete it.

10. Navigate to the end of the word "file" and add an s to it.

11. Save your file using the new name sample2.txt and exit the editor.

12. Open the Text Editor - the basic one, not OpenOffice/LibreOffice Writer. You may find the text editor by opening Dash Home. There likely will be an icon on the first screen labeled "Text Editor". If there is not, us the search box to find it - type "text" in the box, and the application named "Text Editor" should appear. Note that the application invoked is something called "gedit". Use your terminal window to look up the man page on gedit. Repeat these exercises (skipping number 5), but this time save the files using the word etest as the base name rather than sample.

Solution Preview :

Prepared by a verified Expert
Operating System: Execute the command whoami in both windows who are you -
Reference No:- TGS01353889

Now Priced at $95 (50% Discount)

Recommended (97%)

Rated (4.9/5)