Sei sulla pagina 1di 7

1) If the file newdir/file2 does not exist but the directory newdir does exist, what is the effect

of the following command? mv file1 newdir/file2 file1 will be moved to newdir and renamed file2. file1 will be copied to newdir and named file2. An error will be reported, as this is an invalid command. Do not know. 2) What will this command return? ls -F A listing of items in the current directory unsorted. A listing of items in the current directory with file type indicators after some files. A listing of items in the current directory separated by commas on a single line instead of presented in columns. Do not know. 3) Considering the command below, which of the following statements is true? ln file1 file2 file2 will be symbolically linked to file1. Regardless of the size of file1, file2 will have a size of 5 bytes. file1 and file2 have the same inode number. Do not know.

Topic #2: The Linux Filesystem Layout


1) What type of files are typically in the /etc directory? Configuration files. Miscellaneous files. Standard Linux commands. Do not know. 2) In what directory are email inboxes stored by default? /var/spool/mail The mail directory in the user's home directory. /usr/mail Do not know. 3) The /lib directory contains: Libraries of documentation. Configuration files. Shared objects. Do not know.

Topic #3: Permissions and Attributes


1) What command lists file permissions? chmod ls -l perms Do not know. 2) What are the numeric permissions on a file with permissions of -rwxr-x--- after you run the command: chmod g+s file 2750 750 751 Do not know. 3) What is the effect of the following command? chattr +i file Changes of any kind are forbidden; in effect, the file is immutable. The file will be compressed when saved to the disk, but be uncompressed when read. The file can only be opened in insert mode only: data can be added, but data in the file cannot be changed or removed. Do not know.

Topic #4: Text Processing Tools


1) Which of the following is best suited for viewing text one page at a time? cut less grep Do not know. 2) Which of the following is best suited for extracting columns of text? cut less grep Do not know. 3) For the file reports.txt, which of the following commands would, ignoring case, extract every line containing the word "expense", the lines before and after each match, and print the relevant line numbers? grep -i expense reports.txt

grep -A1 -B1 -n -i expense report.txt grep --context=1 -N -i expense report.txt Do not know.

Topic #5: The vi and vim Editors


1) When using the vi editor, which of the following is true? In command mode, the capital letter "O" opens a line below the current line, placing you in insert mode. In command mode, the lower case letter "a" places you in insert mode, appending after the cursor. In command mode, "dd4" deletes four lines. Do not know. 2) When using the vi editor, in command mode, which of the following sequences will delete four words? 4xw wwww 4dw Do not know. 3) In vim, you search for a string of characters and the characters are highlighted. How do you turn off the highlighting? :set nohighlight :set nohl :nohl Do not know.

Topic #6: System Configuration Tools


1) Which of the following might you use to configure the network? redhat-config-network system-config-network ipconfig Do not know. 2) Where is the configuration information for network interface eth0 stored? /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/eth0.conf /etc/network/eth0.cfg Do not know.

3) Which of the following commands could be used to configure a system's date and time? datetime date timeconf Do not know.

Topic #7: Standard Input and Output System


1) What will the following command do? ls -l /etc > /tmp/etc.ls Display a long listing of the /etc directory and the /tmp/etc.ls file. Display a long listing of the /etc directory, redirecting the output into the /tmp/etc.ls file. Report an error message, as this is a poorly constructed command. Do not know. 2) Which command below will merge the standard output and standard error of the ls command and then place the merged data into two separate files? ls -lR /data > mylist1 > mylist2 2>&1 ls -lR /data 2>&1 | tee mylist1 > mylist2 ls -lR /data | tee mylist 1 > mylist2 2>&1 Do not know. 3) What happens to standard output and standard error when running the following command? ls -lR /data 2>&1 > /tmp/output stdout and stderr go to the /tmp/output file. stdout goes to the /tmp/output file and stderr is displayed on the screen as standard output. stderr goes to the /tmp/output file and stdout is displayed on the screen. Do not know.

Topic #8: Process Control


1) What command diplays a list of processes currently running on your system? ps ax proc -a stat Do not know. 2) For a job running in the foreground, how can you run it in the background? This is not possible.

Suspend the job by typing Control-c and then place it in the background by sending kill -TSTP PID, where PID is the process ID number. Suspend the job by typing Control-z and then place it in the background by executing the bg command. Do not know. 3) In a process listing, what does a T indicate in the STAT column? The process execution has been suspended. The process is defunct. The process has no resident pages. Do not know.

Topic #9: Client-side Encrypted Communications


1) Which of the following will allow you to log into another computer using an encrypted tunnel? telnet ssh rlogin Do not know. 2) In order to allow an encrypted ftp connection to your box, which service or services must you provide? sshd vsftpd both vsftpd (or some other FTP daemon) and sshd Do not know. 3) You wish to automatically log into computer1 from computer2. To accomplish this, you place a key from computer2 in a file in the proper hidden directory of computer1. In which file do you place this key? authorized_keys known_hosts id_dsa.pub Do not know.

Topic #10: bash Command Line Shortcuts


1) Your present working directory contains the following files: parrot pelican penguin You type:

ls -l pa and then hit the tab key. You are using the bash shell as your interactive shell. What happens? "pa" will be expanded to "parrot". Nothing. "pa" will be expanded to "parrot" and then the ls command will be executed. Do not know. 2) The following command returns a list of files. What best describes the files listed? ls *.* A list of all files in the present working directory. A list of all non-hidden files in the present working directory. A list of all files in the present working directory that have a dot in the name, but not as a first character. Do not know. 3) What command will be run by this sequence? !?cat The most recent cat command. The most recent command that has cat in the command name. The most recent command that has cat somewhere on the command line. Do not know.

Topic #11: Shell Scripting


1) In the following shell script, how many times will the date command run? for i in a b; do date; done 0 1 2 Do not know. 2) Under what condition is hello echo'ed in the following shell script? if [ -d newitem ]; then echo hello; fi If newitem is a directory. Always. Never, as newitem is a non-zero length string. Do not know. 3) In a shell script in a while/do loop, what does the continue statement do? Pause for one second and then continue to execute.

Interrupt that particular time through the do loop and jump to the while statement to reevaluate the conditional statement. Jump past the done statement and continue executing. Do not know. 1) What is the proper way to call the at command to submit a job to run sometime in the future? at This will prompt you for the command you wish to run and the time you wish to run it.

at timespec timespec is the time that you want the command to run. You will be prompted for the command that you wish to run.

at timespec command This will run the command at the time timespec.

Do not know. 2) Considering this entry in a user's crontab file, how often will the command in this line run? 30 4 * * 3 mycmd Hourly. Weekly. Hourly in the month of March. Do not know. 3) Considering this entry in a user's crontab file, how often will the command in this line run? */5 * * * * mycmd Every five minutes. Five minutes past the hour every hour. This will not run, as the format is invalid. Do not know.

Potrebbero piacerti anche