WorksheetsCoding (Linux) (2 part)
Total questions: 9
Worksheet time: 5mins
Which command will ensure the httpd service (Apache) starts at system boot?
sudo systemctl status httpd.service
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
sudo systemctl init httpd.service
Where would the user named student usually find their personal files?
/student
/var/student
/home/student
/usr/local/student
The logrotate program:
Provides a game where lumberjacks have to roll logs into the river
Erases all logging files on the system
Cyclically rotates and optionally compresses log files to save space
Rotates the text in logfiles so they are hard to read
Which command will list all files under the current directory with a .cfg extension, and then delete them?
find -name "*.cfg" . -exec rm {} ';'
find -exec rm {} ';' -name "*.cfg" .
find . -exec rm {} ';' -name "*.cfg"
find . -name "*.cfg" -exec rm {} ';'
Which command will list all files and directories on the system with cfg in their name?
ls -l $(locate cfg)
locate
locate cfg -exec ls -l {} ';'
find cfg
Which command will find all files and directories in the system whose name ends with cfg?
locate cfg
locate -r "cfg$"
locate -r "^cfg"
locate cfg$
Which command will print out all lines beginning with "X" in all files in the current directory?
grep "^X" *
grep "X$" *
grep $X *
Which command is used to combine three files into a fourth file?
cat file1 > file2 > file3 > file4
cat file1 file2 file3 > file4
cp file1 file2 file3 > file4
cat file1 > file2 > file3 | file4
Which command is used to extract columns from a file to work on them later?
wc
tee
cut
tr
