Please Include chapter numbersand page numbers references with each answer. 1. W
ID: 3531867 • Letter: P
Question
Please Include chapter numbersand page numbers references with each answer.
1. Which commands can you use to determine who is logged in on a specific terminal?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
3. What happens when you give the following commands if the file named done already exists?
$ cp to_do done
$ mv to_do done
5. How can you find the phone number for Ace Electronics in a file named phone that contains a list of names and phone numbers? Which command can you to display the entire file in alphabetical order? How can you display the file without any adjacent duplicate lines? How can you display the file without any duplicate lines?
7. Create a.plan file in your home directory. Does finger display the contents of your. Plan file?
9. Are any of the utilities discussed in this chapter located in more than one directory on the local system? If so, which ones?
11. Which command can you use to look at the first few lines of a file named status.report? Which command can you use to look at the end of the file?
13. Try giving these two commands:
$ echo cat
$ cat echo
Explain the differences between the output of each command.
Please Include chapter numbers and page numbers references with each answer.
Explanation / Answer
1)
There are several commands depending on how much detail you want, and whether or not a certain package is installed on the system.
The command 'who', 'w', 'users' will give varying degrees of information on who is logged in.
The 'finger' command will also give some information but only if the finger software is installed.
3)
cp -copy filesand directories
mv - move (rename) files
you would just basically overwrite the file
5)
$ grep "Ace Electronics" phone
$ sort phone
$ uniq phone
7)
The answer is system dependent.
9)
. Older email programs were not able to handle binary files. Suppose that
you are emailing a file that has been compressed with gzip, which produces
a binary file, and the recipient is using an old email program. Refer to the
man page on uuencode, which converts a binary file to ASCII. Learn about
the utility and how to use it.
a. Convert a compressed file to ASCII using uuencode. Is the encoded file
larger or smaller than the compressed file? Explain. (If uuencode is not
on the local system, you can install it using aptitude [page 501]; it is part
of the sharutils package.)
The following command converts the file memo.gz to ASCII using
uuencode. The .uuencode filename extension is not required.
$ uuencode memo.gz > memo.gz.uuencode
The resulting ASCII file is larger than the original binary file because
uuencode includes control information.
11)
Use the command 'head statusreport' (without the quotes)
13)
echo cat: outputs cat on the screen
cat echo: attempts to output the contents of "echo" file to the screen