Prentice Hall a Practical Guide to Linux Commands Exercise 3

523 Words3 Pages
1. Which commands can you use to determine who is logged in on a specific terminal? Who, w 2. How can you keep other users from using write to communicate with you? Why would you want to? mesg -n 3. What happens when you give the following commands if the file named done already exists? $ cp to_do done overrides done $ mv to_do done overrides done 4. How can you display the following line on the screen you are working on? Hi $2, I’m number * (guess)! echo ctrl+v $2 ctrl+v, I ctrl+v’m number ctrl+v* ctrl+v(guess ctrl+v) ctrl+v ! 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? grep “Ace Electronics” phone Which command can you use to display the entire file in alphabetical order? sort phone How can you display the file without any duplicate lines? uniq phone 6. What happens when you use diff to compare two binary files that are not identical? (You can use gzip to create the binary files.) it will display the differences on the screen. Explain why the diff output for binary files is different from the diff output for ASCII files. When you compare binary files with diff, the utility displays a message saying the files differ when that is the case or no message when the files are the same. The diff utility compares ASCII files on a line-by-line basis; it is not designed to compare binary files on a byte-by-byte basis. Use cmp to compare binary files in that manner. 7. Create a .plan file in your home directory. Does finger display the contents of your .plan file? The answer is system dependent. 8. What is the result of giving the which utility the name of a command that resides in a directory that is not in your search path? No help in (/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin) 9. Are any of the utilities discussed in

More about Prentice Hall a Practical Guide to Linux Commands Exercise 3

Open Document