Linux Networking Homework
1. Which commands can you use to determine who is logged in on a specific Terminal?
Who, w, hostname, finger
3. What happens when you give the following commands if the file name done already exists?
$ cp to_do done
$ mv to_do done
Answer: Either command overwrites Done with contents of To_do.
$ cp - copy files and directories,$ mv - move (rename) files
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?
Give the command apropos editor. Typical editors are vim, ex, ed, and gedit.
8. What is the result of giving the utility the name of a command that resides in a directory that is not in your search ...view middle of the document...
List the commands you can use to perform these operations:
a. Make your home directory the working directory
b. Identify the working directory
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.
1. mkdir /home/max/literature/classics
2. mkdir ~max/literature/classics
3. mkdir ~/literature/classics
4. The df utility displays all mounted filesystems along with information about each. Use the df utility with the –h (human-readable) option to answer the following questions.
Answer 1: $ df –h
a. How many file systems are mounted on your Linux system?
b. Which file system stores your home directory?
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?
The following are sample answers to these questions. Your answers will be different because your file systems are different.
c. ln: creating hard link '/tmp/xxx' to 'xxx': Invalid cross-device link. No problem creating a cross-device symbolic link.
6. You should have read permission for the /etc/passwd file. To answer the following questions, use cat 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?
b. How many fields are used to describe each user?
c. How many users are on the local system?
d. How many different login shells are in use on your system? (Hint: Look at the last field.)
Answer: a. colon (:), b. seven, c. d. and e., system dependent