Reference no: EM131896000
Assignment
1. What key sequence under nano quits without saving the file? What key sequence saves a file and quits even if the file has R/O permissions?
2. File PHONEBOOK.LST has the following format: Lastname Firstname StreetAddress City State Phone#. Assuming one space between the fields, write the command sequence on one line that will:
a) select all persons not in New York state (State=NY)
b) sort in alphabetical by last name, then by city.
Put results into file PHONEBOOK.NOTNY
c) and display the output on the screen a page at a time (man tee)
3. Show the command(s) to take the above command line, echo it into NOTNY.SH and make it executable by everyone; writeable by the owner.
4. Give the command string to:
a. Change to your home directory.
b. create a directory named after your LOGIN name (using the env variable)
c. change the active directory:
to the parent directory
to the root directory
d. remove the directory named after you from your current directory position.
5. Write the command to display the current logged in terminal type. Write the command to display the current loged in terminal.
6. Write the command to display the PATH. What command do you use to find where the command "ls" is?
7. What is a HERE document? Show an example of using a HERE document to copt the LINES HELLO <LF>, THERE <LF> to STDOUT.
8. Explain the nine file permission states.
9. Use the numeric method of the appropriate command(s) to change permissions on file OCC.DATA to allow:
a. the user BRUCE to own the file and read, write, and execute the file:
b. allow the group USERS to read and execute the file and:
c. allow the world to only read the file:
10. Show the command you can you use cat to create a file from your keyboard typing until you are done and how you would end it.
11. Mark those commands available on the UNIX system with a YES and if not available with a NO.
a. who
b. ytalk
c. w
d. alias
e. finger
f. more
g. users
h. talk
i. mesg
j. write
12. Write two different command lines that will copy file TIME.DATA to WEEKS.PAY.
13. Explain the difference in the operation of a pipe character and the operation of the redirection character. Give an example of each that will "cat" file TIME.DATA to STDOUT a screen at a time, another file..
14. From question 2) Write the command line that will find the line containing the phone number of Alice Johnson in file PHONEBOOK.LST.
Show the command(s) to take the above command line, echo it into FINDALICE.SH and make it executable by everyone; writeable by the owner.
15. Write the command to link /home/jenny/draft to /home/alex/letter:
Assume both Jenny and Alex have rw permissions to this file and the following sequence occurs:
a. Alex gives the command: vi letter
b. Jenny gives the command: vi draft
c. Jenny changes the date in the opening of the letter to 12/31/94
d. Alex changes the date in the opening of the letter to 1/31/95 and uses the wq command to exit.
e. Jenny changes some more text and uses the wq command to exit.
What will the date in the opening of the letter be? Why?
16. Describe what is happening in the following command line: grep "^J" class20??.list > J.students
17. Write the command sequence in one line to list all processes in the system owned by your id in reverse numerical order by PID.
18. What keyboard letters allow you to navigate a file under vi if the arrow keys don?t work?
19. Show the command string used to compress the file MYDATA.XLS. What is the resulting output filename? What happens to the original file?
20. Explain the difference between a hard link and a soft link. What's the difference between the two when you delete the original file?
What limitation does a hard link have the soft link doesn't.
Specify the results of the following commands:
21) echo *
a) all the files in the system
b) all the files in the filesystem
c) all the files in the current directory
d) the character *
22) who | wc -l
a) who is logged onto the system
b) who is defined to the system
c) how many people are logged onto the system
d) how many people can be logged onto the system
23) echo [^0-9]*
a) the numbers 0 thru 9
b) all files starting with 0 thru 9
c) all files starting with a thru z and A thru Z
d) all files starting with a non-numeric character
24) ls -al | wc
a) the number of files in the system
b) the number of files in the filesystem
c) the number of files in the directory
d) none of the above
25) rm ???
a) erase all files
b) erase any files beginning with ?
c) erase any beginning with ???
d) erase any files three characters long
26) cat /etc/passwd | grep bash
a) all users named bashir defined to the system
b) all users defined to the system
c) all users you want to bash
d) all user of the bash shell 27) cp ../* .
a) copy all files to the parent directory
b) copy all files from the parent directory
c) copy all files to STDOUT
d) none of the above 28) ls [a-zA-Z]*[^0-9]
a) list all files that begin with an alphabatic character and doesn't end with a number
b) list all files that begin with an alphabetic character
c) list all files that begin with an alphabetic character and end with a numeric character
d) list all files that begin with a numeric character and end with a non-numeric character
29) Write the command on one line that select all students out of /etc/passwd with a home directory in the /home/csc/stud/spring directory
in order by name one screen at a time.
30. The user interface to the UNIX operating system is called the: _____.
Attachment:- Attachments.rar