Font size
WorksheetsQuiz 1 | Information Security | Kali Linux Commands
Total questions: 20
Worksheet time: 7mins
You need to list all the files and directories in your current directory, including hidden ones. Which command would you use?
ls -a
ls -l
ls -R
ls -1
You’re working on a project, and you need to create a new folder named "Project". Which command will you use to create it?
mkdir -p Project
mkdir Project
touch Project
mkdir -v Project
You want to move to your home directory using the terminal. Which command would you use?
cd ~
cd /home/user
cd -
cd ..
After creating a new file using touch, you want to add some content into it while preserving content. Which command do you use?
echo "Some text" > filename.txt
cat filename.txt
nano filename.txt
All of these
Which command will you use to display the current working directory in the terminal?
sudo
pwd
ls
ls ./
You are in the /home/user/Documents directory and want to go up one level above. In which directory you will be?
/home/user
/home/
~
~/home
You’ve just created a .txt file named notes.txt and now want to rename it to tasks.txt. What command do you use?
mv notes.txt /tasks.txt
rename notes.txt tasks.txt
mv notes.txt tasks.txt
cp notes.txt tasks.txt
You need to delete a folder called "OldFiles" and all of its contents, including subdirectories. Which command would you use?
rm OldFiles
rm -r OldFiles
rm -f OldFiles
rmdir -r OldFiles
You want to find a file named report.txt somewhere in the /Documents directory. Which command helps you locate it?
locate report.txt
search -name report.txt /Document
find /Documents -name report.txt
ls report.txt
You need to check the disk usage of a folder called "Project". Which command would you use?
df -h Project
du -sh Project
du -ah Project
df Project
After downloading a file from the internet using wget, you notice that the download was interrupted. You need to continue downloading the file from where it left off. What command would you use?
wget -r [URL]
wget --resume [URL]
wget -c [URL]
wget -O [filename]
You’re editing a Python file and want to create a directory to store it under /home/user/projects. What would be the appropriate command?
mkdir projects
mkdir -p /home/user/projects
mkdir /home/user/projects
mkdir -v /home/user/projects
You’ve created a new file test.py and want to write a code inside it using nano. Which key combination will save the file after editing?
Ctrl+S then Enter
Ctrl+C then S
Ctrl+X then Y
Ctrl+Z then Y
After moving greeting.txt to a directory named "backup", you now want to copy it back to the original directory. Which command will you use?
cp backup/greeting.txt .
mv backup/greeting.txt .
cp greeting.txt backup/
cp greeting.txt backup/
You need to change the permissions of a file named hello.txt to allow the owner to read, write, and execute, while others can only read, write, execute. Which command should you use?
chmod 755 hello.txt
chmod 777 hello.txt
chmod 644 hello.txt
chmod 7777 hello.txt
You need to install a package named gcc on a system that uses the apt package manager. What command should you run?
sudo apt install gcc
apt install gcc
sudo apt-get gcc
sudo install gcc
You created a file message.txt and want to append the text "Welcome" to it without overwriting the current content. Which command do you use?
echo "Welcome" >> message.txt
echo "Welcome" > message.txt
cat "Welcome" message.txt
nano welcome.txt
You want to quickly delete a file named old_report.txt with confirmation. Which command do you use?
rm -f old_report.txt
rm -I old_report.txt
rm old_report.txt
None of these
You need to check the kernel version of your Kali Linux system. Which command will show it?
uname -a
uname -r
uname -v
uname
You’re using echo to write some text into a file. What is the correct command? Select all that apply.
