Font size
WorksheetsLinux-1 Week 4
Total questions: 15
Worksheet time: 8mins
What can be done with the 'Shebang'
It's a command for on the prompt
Shutdown your Linux System
Controles the command interpreter in a script
End a bash script
What is the difference between Archiving and Compression
There is no difference
Archiving: Combines multiple files into one
Compression: Compression: Makes the files smaller
Archiving: Makes the files smaller
Compression: Combines multiple files into one
What is the most used compression-command in Linux
7zip
tar
gzip
zip
How to unzip (decompress) a file in Linux
decomp <filename>
gzip -d <filename>
gunzip <filename>
uncomp <filename>
What command to use to create an archive
arch
zip
pack
tar
How to create a tar-ball name 'archive.tar' will all files with extention '.txt' (assuming that they exist)
tar -xvf *.txt archive.tar
tar -cvf archive.tar *.txt
tar *.txt archive.tar
tar -f archive.tar *.txt
Which of the following commands are pager-commands?
head
less
more
cat
How to search for a text string using the 'more-pager command'
That is not possible, use less
use '/'
use 'f'
use '!'
Correct command to display the last 25 lines of a file called 'textfile.txt'
last -25 textfile.txt
end -25 textfile.txt
tail -25 textfile.txt
cat -25 textfile.txt
What can be done with the pipe (|) command?
run a second command only if the first one failed
run a second command only if the first command was succesfull
set an exit-code
send the output of one command to another
How to redirect the output from a cat-command to a file 'testfile.txt'
cat 'filename' > testfile.txt
cat 'filename' | testfile.txt
cat 'filename' < testfile.txt
cat 'filename' || testfile.txt
How to append STDERR to a file
using 2>>
using >>
using 2>
using >
How to display the first, fifth, sixth and seventh fields from mypasswd database file?
cut : [f1,5-7] mypasswd
cut : [1,5-7] mypasswd
cut -d: -f1,5-7 mypasswd
cut -f mypasswd : f1,5-7
What must be done before a script can be executed?
Make the file executable using chmod u+x
Add the shebang in the first line of the script
Place the script in an executable-scripts directory like /bin
Compile the script
How to execute a command inside a script
use normal single quotes (') around the command
use double quotes (') around the command
use brackets ([ ]) around the command
use backtick quotes(`) around the command
