Topic 3, GNU and Unix Commands
From a Bash shell, which of the following commands directly executes the instruction from the file /usr/local/bin/runme.sh without starting a subshell? (Please select TWO answers.)
A.
source /usr/local/bin/runme.sh
B.
/usr/local/bin/runme.sh
C.
/bin/bash /usr/local/bin/runme.sh
D.
/usr/local/bin/runme.sh
E.
run /usr/local/bin/runme.sh
source /usr/local/bin/runme.sh
/usr/local/bin/runme.sh
Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?
A.
fmt -f 1,4 /etc/passwd
B.
split -c 1,4 /etc/passwd
C.
cut -d : -f 1,4 /etc/passwd
D.
paste -f 1,4 /etc/passwd
cut -d : -f 1,4 /etc/passwd
When running the command
sed -e "s/a/b/" /tmp/file >/tmp/file
While /tmp/file contains data, why is /tmp/file empty afterwards?
A.
The file order is incorrect. The destination file must be mentioned before the command to ensure redirection.
B.
The command sed did not match anything in that file therefore the output is empty.
C.
When the shell establishes the redirection it overwrites the target file before the
redirected command starts and opens itfor reading.
D.
Redirection for shell commands do not work using the > character. It only works using
the | character instead.
When the shell establishes the redirection it overwrites the target file before the
redirected command starts and opens itfor reading.
Which of the following explanations are valid reasons to run a command in the background of your shell?
A.
The command does not need to execute immediately.
B.
The command has to run immediately but the user needs to log out.
C.
The system is being shut down and the command needs to restart execution
immediately after the reboot.
D.
The command can run at a lower priority than normal commands run on the command
The command has to run immediately but the user needs to log out.
Which grep command will print only the lines that do not end with a / in the file foo?
A.
grep'/$' foo
B.
grep '/#' foo
C.
grep -v '/$' foo
D.
grep -v '/#' foo
grep -v '/$' foo
Page 18 out of 49 Pages |
Previous |