Introduction to Linux Command Line: 20 Commands Every Beginner Should Know

Here is a beginner-friendly blog on essential Linux commands for beginners to start with Linux command line.
Introduction
The Linux command line might seem a little odd at first, but it’s a powerful tool that gives you full control over your system. Knowing these commands can help you to navigate and manage tasks quickly and efficiently. In this guide, we will walk you through 20 of the most important Linux commands that every beginner should know.
Whether you are Linux OS or using Windows Subsystem for Linux (WSL), these commands will be your foundation.
1. ls - List Files and Directories
Usage:
lsDescription: It lists all files, folders and directories in the current directory.
Example:
lsTip: Use
ls -lfor detailed information (file permissions, size, date) andls -ato include hidden files.
2. cd - Change Directory
Usage:
cd <directory_name>Description: It navigates between directories.
Example:
cd DocumentsTip: Use
cd ..to go up one level in the directory tree.
3. pwd - Print Working Directory
Usage:
pwdDescription: Displays the full path of the current directory.
Example:
pwd
4. mkdir - Make Directory
Usage:
mkdir <directory_name>Description: Creates a new directory.
Example:
mkdir NewFolder
5. rmdir - Remove Directory
Usage:
rmdir <directory_name>Description: Deletes the directory.
Example:
rmdir OldFolder
6. touch - Create a New File
Usage:
touch <file_name>Description: Creates an empty file.
Example:
touch file.txt
7. cp - Copy Files and Directories
Usage:
cp <name of file> <destination>Description: Copies files or directories from one location to another.
Example:
cp file.txt /home/user/Documents/
8. mv - Move or Rename Files and Directories
Usage:
mv <source> <destination>Description: Moves files or renames them.
Example:
mv file.txt /home/user/Downloads/
9. rm - Remove Files and Directories
Usage:
rm <file_name>Description: Deletes files or directories (use with caution!).
Example:
rm file.txtTip: Use
rm -rto delete directories and their contents recursively.
10. cat - View File Contents
Usage:
cat <file_name>Description: Displays the contents of a file.
Example:
cat file.txt
11. nano - Edit Files
Usage:
nano <file_name>Description: Opens the file in the Nano editor.
Example:
nano file.txtPress Ctrl + O (not zero) to save the file and Ctrl + X to exit.
12. head - View First Few Lines of a File
Usage:
head <file_name>Description: Displays the first 10 lines of a file.
Example:
head file.txtTip: Use
head -n <number>to display a specific number of lines.
13. tail - View Last Few Lines of a File
Usage:
tail <file_name>Description: Shows the last 10 lines of a file.
Example:
tail file.txt
14. grep - Search Text in Files
Usage:
grep <pattern> <file_name>Description: Searches for specific text patterns in files.
Example:
grep "Linux" file.txt
15. find - Search for Files and Directories
Usage:
find <directory> -name <file_name>Description: Locates files and directories.
Example:
find /home/user -name file.txt
16. chmod - Change File Permissions
Usage:
chmod <permissions> <file_name>Description: Modifies file permissions.
Example:
chmod 755 script.sh
17. chown - Change File Ownership
Usage:
chown <owner>:<group> <file_name>Description: Changes file ownership.
Example:
chown user:group file.txt
18. ps - View Running Processes
Usage:
psDescription: Shows currently running processes.
Example:
ps aux
19. kill - Terminate Processes
Usage:
kill <process_id>Description: Terminates processes by their ID.
Example:
kill 1234
20. man - Manual Pages for Commands
Usage:
man <command>Description: Provides a detailed manual for a command.
Example:
man ls
Conclusion
Learning these 20 commands will give you confidence to work on the Linux command line. As you practice, you’ll find that the command line is not only useful but also efficient. If you want to know how to use Linux commands on your Windows System, refer to my Blog on Installing Ubuntu (https://sanjoysblog.hashnode.dev/using-linux-on-windows-a-beginners-guide-to-installing-ubuntu-via-wsl)
With these commands, beginners will be ready to navigate and learn Linux environment with ease. Let me know if you'd like any further additions. Happy exploring!



