Font size
WorksheetsLinux Quiz
Total questions: 60
Worksheet time: 45mins
Linux is a:
Programming language
Operating System
Web Browser
Database
Which of the following are Linux distributions?
Ubuntu
Windows 10
macOS
Debian
Solaris
Which command lists files in Linux?
list
show
display
ls
cd ..
Which command is used to change file permissions?
perm
chmod
chperm
changeperms
Which command shows the current directory?
whereami
currdir
pwd
cd
dir
The superuser in Linux is called:
admin
user
master
root
Which command is used to copy files?
copy
mv
cp
cpfile
cpy
To remove a file, we use:
delete
rm
erase
rm -r
removefile
Which command is used to move or rename a file?
mvfile
movefile
rename
cp
mv
Which command is used to search for text in files?
search
findtext
grep
textfind
Which command is used to view running processes?
ps
procview
showproc
procs
To terminate a process, which command is used?
stop
terminate
end
exit
kill
Which directory contains user home directories?
/sys
/boot
/home
/bin
/root
The command to change directory is:
chdir
changedir
cd
go
cd ..
The command df is used to:
Show files
Download files
Check disk space
Format disks
Which of the following is a package manager in Ubuntu?
yum
rpm
npm
brew
apt
What is the full form of GUI?
Graph Use Instruction
Graphical User Interface
Global User Identity
Graphical Unix Interface
Which command is used to create a directory?
makedir
createdir
newdir
mkdir
Linux file system starts from:
Root /
/home
/root
/sys
To display full content of a file, use:
head
tail
cat
fileopen
readfile
Which one is not a Linux distribution?
Fedora
CentOS
Windows
Kali
To display real-time system resource usage:
stat
top
showproc
sysview
To get help about a command:
helpme
assist
guide
man
Linux is mostly written in:
Java
Python
C
C++
Which command shows logged in users?
usershow
loginlist
who
userstatus
Default editor in most Linux distros:
vi
nano
code
gedit
Which command is used to update installed packages in Ubuntu?
apt-check
sudo apt-get
sudo apt update
pkgupdate
refresh
Which command allows switching to the root user?
rootlogin
sudo
sudo su
sudo u
sudo -admin
Which command displays the first 10 lines of a file by default?
tail
nl
less
seq
head
Which command shows the last 10 lines of a file by default?
head
tail
bottom
less
sq
Which command is used to print numbers in sequence (e.g., 1 2 3 4 5)?
nl
seq
sequence
cut
Which command adds line numbers to the lines of a file?
tail
head
echo
seq
nl
Which of the following displays lines 5 to 15 of a file?
head -n 15 file | tail -n 11
tail -n 15 file | head -n 11
nl file | head -n 15
head -n 10 file | tail -n 5
Which command will print numbers from 10 to 50, with a step of 10?
sudo seq 10 50
seq -s 10 50
nl 10 10 50
seq 10 50
seq 10 10 50
head -n -5 file.txt
Skips last 5 lines and shows rest
Displays first 5 lines
Displays only last 5 lines
Gives an error
Which command is used to copy files from one location to another?
mv
cp
cut
copy
Which option with cp copies directories recursively?
-d
-r
-p
-l
Which command will rename a file called old.txt to new.txt?
cp old.txt new.txt
rename old.txt new.txt
mv old.txt new.txt
head old.txt > new.txt
Which command creates an empty file or updates the timestamp of a file?
echo file
touch file
cat > file
echo hello world > index.txt
What does cp file1.txt file2.txt do?
Deletes file1.txt and creates file2.txt
Moves file1.txt to file2.txt
Merges two files into one
Copies the contents of file1.txt to file2.txt
Which two commands will show hidden files in a directory?
ls -l
ls -a
ls
ls -la
Which two options can you use with ls to show files with more details and including hidden files?
ls -l
ls -al
ls -a
ls -la
What is the purpose of the sudo command in Linux?
Switch to another user
Run commands with superuser (root) privileges
Create new users
Change file ownership
Which command allows you to edit files like /etc/hosts with proper permissions?
sudo vi /etc/hosts
nano /etc/hosts
sudo nano /etc/hosts
echo hello world > /etc/hosts
touch /etc/hosts
Which two commands will update system packages (Debian/Ubuntu)?
sudo yum update
sudo apt update
sudo pacman -Syu
sudo apt upgrade
How do you reboot a Linux system using sudo?
sudo shutdown -r now
sudo restart
sudo reboot
sudo halt
Rename image.png to logo.png
(a)
Create an empty file called notes.txt
(a)
Delete a file called oldfile.txt
(a)
Show last 20 lines of a file called data.txt
(a)
Copy file1.txt to backup/ directory
(a)
Move report.txt to the documents/ directory
(a)
Generate a sequence from 1 to 10
(a)
Run apt update with root privileges
(a)
Delete a directory called testdir
(a)
Change directory to Documents folder:
(a)
Go back to the previous (parent) directory:
(a)
Go to the home directory from anywhere:
(a)
List files with details and hidden files:
(a)
List files in the current directory:
(a)
