Font size
WorksheetsBasic Linux Practice
Total questions: 23
Worksheet time: 5mins
Change to your home directory
(a)
Which always changes to your last working directory?
cd ~
cd /last
cd ..
cd -
What does cd .. do?
Error
Change to the home directory
Change to the parent directory
Change to the last working directory
List contents of your current directory
(a)
Display contents of a file hello.txt
(a)
Create empty directory myStuff
(a)
Which of these lists the contents of a directory and all subdirectories?
ls -l
ls
ls -R
ls -a
List contents of all directories and subdirectories, and show hidden files
(a)
What command is used to display the current working directory?
pwd
cd
ls
dir
Which are uses of the command touch? (select all that apply)
Create an empty file
Create an empty directory
Update the timestamp of a file
View the contents of a file
Which are uses of the command mv? (select all that apply)
Rename a file
Move a file into a directory
Copy a file
Rename directory
cp fileA fileB: If fileB already exists, what happens?
Error message
Two files named fileB
The copy gets named fileB(1)
fileB gets overwritten with the copy
Which of these commands can delete a non-empty directory
rm
rmdir
mkdir
None of these
Which command produced this output: essay.txt: ASCII text
touch essay.txt
file essay.txt
ls -l essay.txt
cat essay.txt
What is gpg used for?
Encryption
Viewing files
Managing directory structure
Networking
Which command is used to find files by name?
grep
find
locate
search
What does the 'grep' command do?
Encrypts / decrypts files
Searches text using patterns
Changes file permissions
Displays the current working directory
Which of the following is not a Linux file permission?
Read
Create
Execute
Write
Which of the following commands allows for moving one level up in Linux directory tree?
cd -
cd ..
cd /
cd ~
Which of the following key combinations allows to terminate the current process in Linux shell?
Ctrl + C
Ctrl + A
Ctrl + E
Ctrl + L
The output of whoami is a:
string
file
directory
username
Which operator makes a command run in the background?
&
>
&&
>>
Which command is used to display the manual of other commands?
man
help
info
doc
