Linux Commands and Shell Scripting
Quiz covering Linux/Unix command-line operations, shell scripting syntax, file systems, process management, and system administration fundamentals
Questions
I know linux can multitask -- how do I switch between programs?
- fg,bg, &
- switch
- fg,bg
- None
It is possible to redirect the output of a process to more than one source
- True
- False
- True but needs root permission
- None
Commands tar & dd
- dd allows block sizes to be defined, tar does not allow
- tar allow block sizes to be defined while dd does not allow
- both tar & dd allow block sizes to be modified
- both tar & dd do not allow block sizes to be modified
fdisk command is
- Used to create file systems
- Used to create harddisk partitions
- Used to create root file system alone
- None
The option not allowed in test command
- -d
- -l
- -u
- -a
The command is used within a function to exit the function with a given status.
- local
- function
- return
- parameter
Which of the following describes correctly the function of GhostScript?
- A free implementation of PostScript
- A printing management tool
- A program for converting files to PostScript
- A free interpreter of PostScript
Which one of the following lines is correctly formatted as the last line of a /etc/printcap file?
- :mx#2:
- :mx#2
- :mx#2\
- None
vi is the only text editor available in linux
- True
- False
To search a string at the end of the line use
- / <str>*
- /<str>$
- /<str>&
- None
The right sequence shell command substitution & expansion
- {}, ~, $,($)
- {}, $, ~,($)
- {}, ~,$,($)
- None
The valid conditional operator
- -NE
- -GT
- -LT
- -eq
How to mount a file system?
- fsck
- fsmount
- mount
- mountfs
User's passwords are generally stored in
- /etc/passwd
- /var/passwd
- /etc/password
- /var/password
Linux uses four basic file types
- executable, text, documents, directories
- directories, scripts, executables, normal files
- Normal files, special files, hidden files, device files
- ordinary files, directories, symbolic links, block and character device files
The ______ loop executes as long as the condition returns an exit status of zero, whereas the _______ loop executes unless the condition returns a zero exit status.
- while until
- until, while
- repeat, while
- None
Which of these commands redirects the output of cat testfile to redirfile without overwriting the contents of redirfile?
- cat testfile >redirfile
- cat testfile >>redirfile
- cat testfile 1> redirfile
- cat testfile 2> redirfile
Which of the following are syntax that can be used to declare a function?
- function_name() {command-list }
- function_name ( ) { }
- function name (command list ) {
- None
Who can manipulate the order of print jobs in a print queue?
- The owner of the job
- The root user
- Anyone
- Anyone who can submit jobs to the print queue
tar can be used to write on to floppy disks
- True
- False