Linux uses a command-line interface (CLI) for system management, file operations, and network administration. Below are essential Linux commands for beginners.
File & Directory Commands
Command
Description
Example
ls
Lists files in a directory
ls /home
ls -l
Lists files in detail
ls -l
cd
Changes directory
cd Documents
cd ..
Moves up one level
cd ..
pwd
Displays current directory
pwd
mkdir
Creates a new directory
mkdir NewFolder
rmdir
Deletes an empty directory
rmdir OldFolder
rm -r
Deletes a directory & files
rm -r FolderName
File Management Commands
Command
Description
Example
touch
Creates an empty file
touch file.txt
cp
Copies a file
cp file1.txt /backup/
mv
Moves or renames a file
mv file1.txt Documents/
rm
Deletes a file
rm file.txt
cat
Displays file content
cat file.txt
nano
Opens file in Nano editor
nano file.txt
head
Displays first 10 lines of a file
head file.txt
tail
Shows last 10 lines of a file
tail file.txt
User & Permission Commands
Command
Description
Example
who
Lists logged-in users
who
id
Displays user ID (UID, GID)
id
chmod
Changes file permissions
chmod 755 file.sh
chown
Changes file ownership
chown user:group file.txt
passwd
Changes user password
passwd
Process Management Commands
Command
Description
Example
ps
Shows running processes
ps aux
top
Displays system resource usage
top
kill
Kills a process
kill PID
pkill
Kills a process by name
pkill firefox
htop
Interactive process manager
htop(install required)
Qus. 1 : Which of the following is a Linux command?
Chmod
curl
df
all
Qus. 2 : Command to create file in Linux is...........?
copycon
cat
dir
All of the above
Qus. 3 : Which command is used to check Linux version?
uname -a
uname-n
uname-s
kernel
Qus. 4 : True statement about 'chown' command in Linux is
Creates a thread
Creates a child process
Changes the mode of operation to kernel mode
Changes the users and/or group ownership of each given file
Qus. 5 : Which commands will give you information about how much disk space each file in the current directory uses?
Is-1
ls -la
du
ls -a
Qus. 6 : Which command is used for removing files in the Linux operating system ?
delete
rm
dm
erase
Qus. 7 : <p>Match the following Linux commands with their correct functions.</p><p><br></p><table class="table table-bordered"><tbody><tr><td><b>Commands</b></td><td><b>Functions</b></td></tr><tr><td>1. ls</td><td>A. Deletes a file</td></tr><tr><td>2. rm</td><td>B. Copies files from one location to another</td></tr><tr><td>3. mkdir</td><td>C. Displays a list of files and directories</td></tr><tr><td>4. cp</td><td>D. Creates a new directory</td></tr><tr><td><br></td><td>E. Removes a directory</td></tr><tr><td><br></td><td>F. Moves a file</td></tr></tbody></table><p><br></p>