Linux Assignment from the Book: a Practical Guide to Linux Commands: Editors and Shell Programming

501 Words3 Pages
1. Which commands can you use to determine who is logged in on a specific terminal? $ who 2. How can you keep other users from using write to communicate with you? Why would you want to? Give the command mesg n to keep other ordinary users from writing to your terminal. You can take this action when you do not want to be disturbed or are viewing something on your screen that you do not want overwritten. 3. What happens when you give the following commands if the file named done already exists? $ cp to_do done $ mv to_do done Either command overwrites done with the contents of to_do 4. How can you display the following line on the screen you are working on? Hi $2, I’m number * (guess)! $ "Hi #2, I'm number * (guess)!" Or $ echo Hi \#2, I\'m number \* \(guess\)\! 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 use 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? $ grep "Ace Electronics" phone $ sort phone $ 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.) 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 the files differ 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? yes it

More about Linux Assignment from the Book: a Practical Guide to Linux Commands: Editors and Shell Programming

Open Document