1. Which of the following command sets the Bash variable named TEST with the content FOO?
A) A. set TEST='FOO' B) B. TEST = 'FOO' C) C. var TEST='FOO' D) D. TEST='FOO'
2. Which variable defines the directories in which a Bash shell searches for executable commands?
A) A. BASHEXEC B) B. BASHRC C) C. PATH D) D. EXECPATH E) E. PATHRC
3. Which of the following commands determines the type of a file by using a definition database file which contains information about all common file types?
A) A. magic B) B. type C) C. file D) D. pmagic E) E. hash
4. Which of the following commands prints all files and directories within the /tmp directory or its subdirectories which are also owned by the user root? (ChooseTWO correct answers.)(Select 2answers)
A) A. find /tmp -uid root -print B) B. find -path /tmp -uid root C) C. find /tmp -user root -print D) D. find /tmp -user root E) E. find -path /tmp -user root 'print
5. When running the command -sed -e 's/a/b/' /tmp/file >/tmp/filewhile /tmp/file contains data, why is /tmp/file empty afterwards?
A) A. The file order is incorrect. The destination file must be mentioned before the command to ensure redirection. B) B. The command sed did not match anything in that file therefore the output is empty. C) C. When the shell establishes the redirection it overwrites the target file before the redirected command starts and opens it for reading. D) D. Redirection for shell commands do not work using the > character. It only works using the | character instead.
Leave a comment