Assignment title: Information
1. Boot your Ubuntu system and open two command shells. In one of the two use the sucommand to
change to the root identity: su root
Read the manpage on the sucommand. What is the meaning of the option?
____________________________________________________________
____________________________________________________________
2. Execute the command whoamiin both windows: who are you?
____________ ____________
3. Read the manpage on the addusercommand and the one on the useraddcommand. Which command
should you use, and why?
____________________________________________________________
____________________________________________________________
How many arguments should you give when you use the addusercommand? Create three new user
identities: flashgordon, dalearden, and mingthemerciless. Does the addusercommand work in both
windows? Who is allowed to run the addusercommand?
____________ ____________ ____________
4. Read the manpage for the passwdcommand. If you do not provide any arguments to that command,
whose password will be changed?
____________________________________________________________
5. Use the lesscommand 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 tailcommand to read the last five lines of the /etc/passwdfile.
7. Now run the command echo $PATHin 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 exitcommand in the window that recognizes you as root. Use the exitcommand again. Now
use the exitcommand 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 exitget you out of one of the windows, while closing the other required two?
____________________________________________________________
____________________________________________________________
10. Open a new terminal window and read the manpage on the shutdowncommand. What command
would you type to halt the system in 30 minutes?
____________________________________________________________
11. SHUT DOWN YOUR SYSTEM BEFORE YOU LEAVE!
2. Using vi/vim, create a file named sample1.txt. (NOTE: Explore these two commands using manpages
and the whichcommand. Do you invoke the editor using the vicommand or the vimcommand or both?
Behind the scenes, is it vior vimwhich 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 pwdcommand, record your working directory path below:
______________________________________________________
6. Using the lscommand with the loption, 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 doubled.
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
manpage 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.