1.2
what does a program do when it needs to read a file?
1.9
run the following commands, and then invoke ls. What do you conclude?
echo > README [Enter]
echo > readme [Enter]
1.11
when you log in, a program starts executing at your terminal. What is this programs known as? Name four types of this program that are available on a system
1.12
what is the significance of your user-id? Where in the system is the name used?
1.15
why is the shell called a command interpreter?
1.16
what is the one thing that is common to directories, devices, terminals, and printers?
2.1
Enter a # before a command and press [Enter]. What do you see, and how do you think you can take advantage of the behavior?
2.5
where are the commands used by the system administrator located?
2.6
you won’t find the cd command either in /bin or / usr/bin. How is it executed then?
2.7
if you find the echo command in /bin, would you still all it an external command?
2.10
reduce the number of keystrokes to execute this command:
tar –t –v –f /dev/fd0.
2.15
what do the | and the three dots in the SYNOPSIS section of these man pages indicate as shown below?
/usr/xpg4/bin/tail [ -f | -r ]
/usr/bin/ls [ -aAbcCdfFgiILmnopqrRstux1 ] [ file … ]
2.17
your system doesn’t have the apropos command. What will you do?
2.22
in what way is the mailx command superior to a GUI program like Netscape or Mozilla?
2.23
can you have the same user-id more than once in the who output?
2.25
which command does the nonprivileged user use the change the system date and time?
Part I: Reading the Manual
Sometimes it can be hard to remember all the commands of UNIX/Linux, and even harder to remember what each one does. Luckily, there are built-in resources that provide the details for how to use each command. These resources are the man command, the info command, and the –help option.
This part of the lab is intended to give you practice using these commands. Answer the below questions using either the man command, info command, or –help option.
For each question give an answer and where you found it.
If you are having trouble accessing a UNIX/Linux shell ask the professor for help.
1. How would you use the man command to view the manual page for the man command?
2. Use the manual pages to explain the use of the following man options:
man -k:
man -f:
man -?:
3. The command passwd is referenced in more than one manual page or section. How would you search the short manual page descriptions for keywords and display any matches?
4. The default output from the man command is the first manual page found. How would you force man to display all manual pages for a matching term?
5. How would you ask man to display the manual entry from section 3p of the mkdir command?
6. Without running it, what should the command cat lab1.1 – lab1.2 do, assuming lab1.1 and lab1.2 are existing files?
7. What three options to the date command can be used to display the current date and time in Coordinated Universal Time?
8. Where can you find a quick guide to printing the current month name using the date command?
9. Which manual page section provides information for obtaining the name and information about the current kernel using the uname command?
Part II: Putting it Together
Now that you know how to get help, put it to use in the following section. List the command that you would use to accomplish each step below using only those commands covered so far.
1. Write today’s date in the format “January 20 2015”:
2. print your current working directory:
3. Create a directory named IFT383:
4. List the contents of the directory including the size of the files
5. Create a file named lab1.2:
6. Display the contents of the life lab1.2:
7. Rename the file lab1.2 to lab1.2.r:
8. Create a directory lab1:
9. Move lab1.2.r into the lab1 directory:
10. Make a copy of lab1.2.r named lab1.2.bak:
11. Rename lab1.2.r to lab1.2.final:
12. You remove the file lab1.2.bak:
13. Finally, you count the words in lab1.2.final:
Part III: Urgent Maintenance
System administrators will sometimes need to perform urgent maintenance tasks, some of which require shutting down the system which could cause those still logged in to lose some of their work. Below is a series of tasks that must be completed in the event of urgent maintenance.
Give the command that you would use to accomplish each task below using only those commands covered so far.
Note: mail does not work on the general server. This should not affect your ability to complete it.
1. Record all your actions under the file lab1.3.script:
2. Find out who is still using the system:
3. Assume there is one user logged in under the is logged in with the email address “rmstallm@asu.edu”. Send him an email with the subject “Urgent Maintenance” and the message “Please save your work and logout now”
4. Check your mailbox for a response to your email:
5. Not getting any response to the email, get more information about that user
6. List all the active processes running on the user’s machine:
7. Determine the ID of the processes associated with his terminal:
8. Kill the processes associated with his terminal:
9. Stop capturing your session: