#####################################################
# I. Single Choice Questions (2 * 20 = 40 points) #
#####################################################
1. Command "ls -l" list the detail infomation of files. Which one is a soft link file according to the first ten characters?
A. -rw-rw-rw-
B. -rwxrwxrwx
C. drwxr--r--
D. lrwxr--r--
2. Which file contains the user contains the absolute pathname for the user’s login shell?
A. /etc/profile
B. ~/.bash_profile
C. /etc/passwd
D. /etc/shadow
3. Which option to umask would set my default file permissions such that files are created with these permissions: user has read/write, group has read/write, and everyone else has read only?
a. umask 002
b. umask 022
c. umask 220
d. umask 775
4. What does the & character do when placed at the end of a command?
A. It causes the process to be stopped.
B. It restarts a stopped process.
C. It causes the process to be placed into the foreground.
D. It causes the process to be placed into the background.
5. What is the shell metacharacter that matches zero or more characters?
A. Square brackets [ ]
B. Pound sign
C. Dollar sign
D. Asterisk (*)
6. UNIX supports the following file types:
A. Ordinary file, directory, link file, block special file, character special file, named pipe (FIFO), and socket
B. Text files, C/C++/Java source files, graphics files, multimedia files, html files, and directories
C. Text files, C/C++/Java source files, and directories
D. All of the above
7. You can copy directory ~/courses into directory ~/backups by using the following command:
A. cpdir ~/courses ~/backups
B. cp -r ~/courses ~/backups
C. cp -d ~/courses ~/backups
D. All of the above
8. Which command will show you the usage of the file system?
A. ps
B. du
C. df
D. free
9. Which one of the following is an accurate statement regarding this regular expression? [^1-8A-Za-z]
A. It matches all letters and numbers except 9.
B. It matches all letters and numbers except 9 and 0, but only at the beginning of a line.
C. It matches 9, 0, and other nonletter and nonnumber characters.
D. It matches characters other than letters or numbers.
10. Which operation system doesn't use a Linux kernel?
A. Ubuntu
B. Redhat
C. AIX
D. Centos
11. The directory names stored in the PATH variable is used to
A. Set your home directory.
B. Search the executable file.
C. Set the kernel directory.
D. None of above.
12. The UNIX command that renames file's name is
A. cp
B. mv
C. ls
D. rm
13. The command 'ls -l /tmp/a.txt' is executed and the information is displayed as follow.
-rwxr-xr-x 1 someone somegroup 49 2017-10-29 11:06 /tmp/a.txt
Which is true about the permission of the file a.txt
A. Everyone can modify the file.
B. Only file ower can modify the file
C. The user in the same group can modify the file
D. Others can modify the file
14. If you cann't terminate a process(process id is 1024) using command "kill 1024". What can you do to terminate the process? Select one.
A. kill -9 1024
B. kill -1 2014
C. kill +9 4077
D. killall 1024
15. which command won't delete file "a1.txt"?
A. rm *a*.txt
B. rm a*.txt
C. rm a?.txt
D. rm ?a?.txt
16. If you want a partition mounted at boot time, which file do you need to modify?
a. /etc/partitions
b. /etc/mount
c. /etc/mtab
d. /etc/fstab
17. Which one of the following statements correctly describes the > and >> symbols in the context of the bash shell?
A. > appends standard output to an existing file, and >> writes standard output to a new file.
B. > writes standard output to a new file, and >> appends standard output to an existing file.
C. > writes standard error to a new file, and >> appends standard error to an existing file.
D. > pipes standard output to a new file, and >> pipes standard output to an existing file.
18. Under the Bash, the command "find / -name 'stdio.h' >a.txt 2>/dev/null"
A. Is illegal
B. Saves the result into a.txt, display error message on the screen
C. Display the result on the screen, ignor the error message
D. Saves the result into a.txt, ignor the error message
19. Your usb disk's file system is fat32, which is the right command to mount the usb device to your linux system
A. mount -t ext3 /dev/sdb /mnt
B. mount -t vfat /mnt /dev/sdb
C. mount -t vfat /dev/sdb1 /mnt
D. mount -t vfat /dev/sdb /mnt
20. Which one of the following files will execute once when you log on
A. /etc/passwd
B. /boot/vmlinuz-2.6.9-5.ELsmp
C. ~/.bash_profile
D. /etc/shadow