Chapter 5 The Linux Utilities
1. Which command can you use to determine who is logged in on a specific terminal?
* The command you can use is the $ w as well as who, and finger command.
3. What Happens when you give the following commands if the file named done already exists?
$ cp to_do done
* Done is overwritten with contents of ‘to_do’
$ mv to_do done
* to_do no longer exists after the command
4. How can you find out which utilities are available on your system for editing files? Which utilities are available for editing on your system?
* You can use which and whereis to locate the utility and locate to search for files. You can use VIM to create and edit a file.
8. What is the result of giving which utility the name if a command that resides in a directory that is not in your search path?
...view middle of the document...
* Absolute Pathname
* Relative Pathname
* Simple Filename
3. If the working directory is /home/max with a subdirectory named literature, give three sets of commands you can use to create a subdirectory named classics under literature. Also give several sets of commands you can use to remove the classics directory and its contents.
* rmdir /home/max/literature/classics
rmdir ~ max/literature/classics
* rm –r /home/max/literature
4. The df utility displays all mounted file systems along with information about each. Use the df utility with the –h (human-readable) option to answer the following.
a. How many file systems are mounted on your Linux systems?
* There are 6 file systems that are mounted on the linux systems.
b. Which file system stores your home directory?
* In: creating hard link ‘/tmp/xxx’ to ‘xxx’
c. Assuming your answer to exercise 4a is two or more, attempt to create a hard link to a file on another file system. What error message do you get? What happens when you attempt to create a symbolic link to the file instead?
6. You should have read permissions for the /etc/passwd file. To answer the following questions, use car or less to display /etc/passwd. Look at the fields of information in /etc/passwd for the users on the local system.
a. Which character is used to separate fields in /etc/passwd?
* You can use the colon :
b. How many fields are used to describe each user?
* There are 7 fields that are used to describe each other.
c. How many users are on the local system?
* There are 4 to 5.
d. How many different login shells are in use on your system? (Hint: look at the last field.)
* There are 2 login shells that are in use in my system.