NEW
Font size
S
M
L
XL
WorksheetsLinux commands 2
Total questions: 24
Worksheet time: 44mins
Name
Class
Date
1.
Which command is used to copy files or directories?
a)
copy
b)
move
c)
rm
d)
cp
2.
What is the purpose of the command 'rm'?
a)
Rename files
b)
Remove files or directories
c)
Make directories
d)
Display file content
3.
Which command is used to remove an empty directory?
a)
rm
b)
copy
c)
rmdir
d)
ls
4.
What does the 'mv' command do?
a)
Move files or directories
b)
Rename files or directories
c)
Make directories
d)
Display file content
5.
Which command is used to create a new file?
a)
make
b)
new
c)
create
d)
touch
6.
How do you copy a file named 'file1.txt' to a directory named 'backup'?
a)
cp file1.txt backup
b)
cp file1.txt cp backup
c)
cp backup file1.txt
d)
backup cp file1.txt
7.
What is the command to remove a file named 'file.txt'?
a)
remove file.txt
b)
delete file.txt
c)
rm file.txt
d)
erase file.txt
8.
How can you remove a directory named 'folder' and its contents?
a)
rm folder -r
b)
rm -r folder
c)
rm -rf folder
d)
remove -r folder
9.
Which command is used to rename a file 'old.txt' to 'new.txt'?
a)
move old.txt new.txt
b)
ren old.txt new.txt
c)
mv old.txt new.txt
d)
rename old.txt new.txt
10.
What does the command 'touch file.txt' do?
a)
Creates a new file
b)
Deletes a file
c)
Displays file content
d)
Changes file permissions
11.
Which command is used to create multiple empty files at once?
a)
create
b)
mv
c)
cp
d)
touch
12.
How can you move a file 'file.txt' to a directory named 'docs'?
a)
mv file.txt docs
b)
mv docs file.txt
c)
move file.txt docs
d)
mv docs/file.txt
13.
What does the 'rm -rf' command do?
a)
Remove a file forcibly
b)
Remove a directory and its contents forcibly
c)
Remove a directory safely
d)
Remove a file safely
14.
How can you remove a file named 'important.txt' safely?
a)
rm important.txt
b)
rm -r important.txt
c)
rm -f important.txt
d)
rm -rf important.txt
15.
What happens if you use 'rmdir' on a non-empty directory?
a)
Directory gets removed with its contents
b)
Error: Directory not empty
c)
Directory remains unchanged
d)
Directory is renamed
16.
What does the command 'cp -r' do?
a)
Copy files recursively
b)
Remove files recursively
c)
Move files recursively
d)
Rename files recursively
17.
How can you remove a directory named 'folder' without being prompted for confirmation?
a)
rm -f folder
b)
rm -r folder
c)
rm -rf folder
d)
rm -q folder
18.
Which command is used to move a directory 'dir1' inside another directory 'dir2'?
a)
mv dir1 dir2
b)
mv dir2 dir1
c)
mv dir1 /dir2
d)
mv /dir1 dir2
19.
What does the 'touch' command do if the file already exists?
a)
Updates the modification time
b)
Deletes the file
c)
Creates a backup of the file
d)
Displays the file content
20.
How can you remove a file named 'data.txt' and confirm the action without being prompted?
a)
rm -f data.txt
b)
rm -i data.txt
c)
rm -r data.txt
d)
rm -rf data.txt
21.
Which command is used to show in the default output device those lines from the /etc/passwd file which matches with the root user?
a)
grep root /etc/passwd
b)
show root /etc/passwd
c)
grep /etc/passwd root
d)
show rootuser passwd
22.
Which is default output device for the majority linux commands?
a)
The screen or display.
b)
The keyboard.
c)
The CPU.
d)
The kernel.
23.
Which is default input device for the entire linux commands set?
a)
The screen or display.
b)
The keyboard.
c)
The CPU.
d)
The kernel.
24.
How can I go to my personal directory if I logged into the system as user?
a)
Typing the CD command and pressing the enter key.
b)
Typing on the keyboard cd ~ and pressing enter
c)
Typing on the keyboard chdir user and pressing enter
d)
Typing on the keyboard cd /home/alumno and pressing enter
Reset
