WorksheetsLinux Commands Quiz - Basic 01 to Basic 02
Total questions: 40
Worksheet time: 20mins
What does the command `ls` do in Linux?
Starts a service
Lists directory contents
Logs out the user
Shuts down the system
Which symbol is used to refer to the home directory in Linux?
~
/
.
$
Which Linux command is used to change file permissions?
chmod
chdir
mv
touch
What does `pwd` display?
Present working directory
Password file
Protected write directory
Pipe write data
Which user has unrestricted access to all files and commands in Linux?
Admin
Owner
Sudo
Root
What does `cd ..` do in Linux?
Moves into home directory
Goes to previous command
Navigates to the parent directory
Deletes current directory
Which of the following is a Linux text editor?
Notepad
vi
paint
calc
How do you display the contents of a text file in Linux?
show
open
cat
ls
Which command is used to copy files in Linux?
mv
cp
copy
push
Which directory typically contains user home directories?
/etc
/usr
/home
/bin
What is the result of the `mkdir test` command?
Deletes the directory named `test`
Moves into `test` directory
Creates a directory named `test`
Compiles the directory
Which command will show all currently running processes?
kill
ps
echo
ping
Which file stores user account information in Linux?
/etc/accounts
/etc/shadow
/etc/passwd
/etc/group
What does the command `whoami` do?
Changes the user
Displays the username of the current user
Lists all users
Shows the hostname
Which Linux command is used to shut down the system?
shutdown
kill
exit
reboot
Which symbol is used to run a process in the background?
#
&
$
*
Which of the following is a package manager for Debian-based systems?
yum
rpm
apt
zypper
Which file lists the mounted filesystems?
/etc/mount
/etc/fstab
/etc/sudoers
/etc/bashrc
What does the `df` command show?
DNS info
Disk space usage
Directory format
File types
What does `touch` do in Linux?
Opens file editor
Creates an empty file or updates its timestamp
Deletes file
Moves file
Which command is used to find the location of an executable in Linux?
find
where
which
locate
What does the `grep` command do?
Groups files
Searches for text in a file
Edits files
Changes ownership
Which command allows you to monitor real-time system processes?
ps
df
top
uname
How do you extract files from a `.tar.gz` archive?
unzip file.tar.gz
tar -xzf file.tar.gz
gunzip file.tar.gz
extract file.tar.gz
What does the `chmod 755 file` command do?
Gives full access to everyone
Gives read/write/execute to user, and read/execute to group/others
Deletes the file
Removes execute permission
What is the function of the `crontab` command?
Manages timezones
Manages scheduled tasks
Tracks disk usage
Sets password policies
Which command is used to switch users in Linux?
login
sudo
su
who
How can you see hidden files in a directory?
ls -x
ls -a
ls -h
ls -z
What does the `man` command do?
Lists mounted drives
Starts background services
Displays manual pages for commands
Modifies users
Which command in Linux is used to count words, lines, and characters?
count
wc
grep
awk
What does `sudo` stand for?
Superuser domain
Substitute user data override
Superuser do
System under domain operator
What does `&&` do in a command line?
Combines output
Runs commands in parallel
Runs second command only if the first succeeds
Runs command in background
How do you list open network ports in Linux?
ps -e
ip show
netstat -tuln
kill -l
What is the default shell in most modern Linux distributions?
csh
tcsh
bash
ksh
Which command is used to recursively copy directories?
cp -r
mv -f
copy /R
mkdir -p
What does the `/etc/passwd` file contain?
System configurations
Encrypted passwords
User account information
Network info
Which command shows the system’s kernel version?
uname -r
cat /proc/kernel
version -k
top -k
How do you redirect the output of a command to a file (overwrite)?
>>
Which command is used to change file ownership?
chmod
chown
mv
usermod
Which Linux directory contains system logs?
/logs
/sys
/var/log
/usr/logs
