Topic 3, GNU and Unix Commands
Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?
A.
cat < myapp | cat > file1.log
B.
myapp 0>&1 | cat > file1.log
C.
myapp | cat > file1.log
D.
myapp | tee file1.log
E.
tee myapp file1.log
myapp | tee file1.log
Which of the following shell redirections will write standard output and standard error output to a file named filename?
A.
2>&1 >filename
B.
>filename 2>&1
C.
1>&2>filename
D.
>>filename
E.
1&2>filename
>filename 2>&1
Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose TWO correct answers.)
A.
esc ZZ
B.
ctrl :w!
C.
esc zz
D.
esc :wq!
E.
ctrl XX
esc ZZ
esc :wq!
Which of the following commands can be used to determine how long the system has been running? (Choose TWO correct answers.)
A.
uptime
B.
up
C.
top
D.
uname -u
E.
time –up
uptime
top
Which of the following commands will reduce all consecutive spaces down to a single space?
A.
tr '\s' ' ' < a.txt > b.txt
B.
tr -c ' ' < a.txt > b.txt
C.
tr -d ' ' < a.txt > b.txt
D.
tr -r ' ' '\n' < a.txt > b.txt
E.
tr -s ' ' < a.txt > b.txt
tr -s ' ' < a.txt > b.txt
Page 17 out of 49 Pages |
Previous |