You can use on-line sources, but you can't communicate with any one else.
Start by executing the following three commands. From now on we will refer to sysadminexam2 as the “quiz directory”.
mkdir sysadminexam2 chmod 700 sysadminexam2 cd sysadminexam2
Tasks and Questions
Use the setfacl command to set the permission of your sysadminexam2 directory so that the user
brock has read and execute permission to the directory.
Open the editor of your choice in another window. Create a file called answers.txt (or answers.odt if you are using something like LibreOffice) in the quiz directory to store, when appropriate, answers to the exam questions.
What does it mean to have “execute” permission on a directory?
Write regular expressions using the grep syntax, that match lines containing the following:
- Lines with at least one instance of the character ‘b’.
- Lines with exactly one instance of the character ‘b’. (Be careful.)
- Lines containing the two-word phrase “computer science” where the two words can be separated by one of more characters of whitespace and either words can be capitalized.
Use the find, perhaps with grep, command to list all the files or directories within the directory /home/brock/csci372 meeting the following criteria.
- List all directories.
- List all files whose names end with “.html”.
- List all files whose names end with “.html” that also contain the string “guru”.
What is the purpose of the following three files within the .ssh directory.
Yeah. You probably can get the answer off the web.
Create a subdirectory STUFF in your quiz directory and create an empty (0 character) file inside it.
Use the dd command to copy the first 100000 bytes of both /dev/zero and /dev/urandom to your STUFF directory. Call these two files zero.bytes and urandom.bytes. Be sure to verify that both of these files are exactly 100000 bytes long.
Using either zip or gzip, compress your zero.bytes and urandom.bytes files.
What is the size of your two compressed files? Why do you think there such a large difference? You may want to read the first paragraph of the descriptions obtained by executing the following two commands before giving your answer.
- man 4 zero
- man 4 urandom
Store a listing of the /etc directory in your STUFF directory.
Connect back to your quiz directory and use tar to create an archive of your STUFF directory.
Use od to display, in ASCII, the eight characters that start at byte 265 of your STUFF.tar archive file.
What were those eight characters? (This is mostly for those who had trouble with Task 12, but can use other means to get this information.)
The C++ compiler is started with the command g++. What is the name of the file in which the C++ compiler is really stored? I’m looking for the name of the real file, not the name of the symbolic link. (Be glad I didn’t ask where the Java compiler is stored.)
Why does the directory /etc/rc5.d have all those symbolic links?
When creating and mounting a logical volume, you may need to type the following six commands:
List these six commands in the order you would most likely invoke them. Give examples of the arguments you might would use with these commands.
Trivial task 18
ZIP (or tar) a copy of your sysadminexam2 directory and upload it to moodle.
Trivial task 19
Change the protection of the file you created in task 18 so that only you can read it.