10 Linux commands: Beginners must know

Linux is a powerful and flexible operating system, but for beginners, the command line can seem intimidating. Understanding basic Linux commands can help you navigate, manage files, and control your system efficiently. Here are 10 Linux commands that every beginner should know.
These are the basic commands that you need to know when learning Linux Operatins System. For the initiated, and long-time Windows users, it might seem cumbersome to learn so many commands when you could do all of these using the file explorer. But believe me, as you progress to more advanced commands and get to know Linux as an Operating System better, you will start appreciating the simplicity of navigation in Linux.
10 Linux Commands: Here are a list of 10 linux commands for beginners.
1. ls – List Directory Contents
📌 Used to display the contents of a directory.
ls
👉 Shows files and folders in the current directory.
ls -l
👉 Displays detailed information like permissions, ownership, and size.
ls -a
👉 Shows hidden files (files that start with .
).
2. cd – Change Directory
📌 Moves between directories.
cd /home/user/Documents
👉 Moves to the Documents folder inside /home/user
.
cd ..
👉 Moves one level up (to the parent directory).
cd ~
👉 Moves to the home directory of the current user.
3. pwd – Print Working Directory
📌 Shows the current directory location.
pwd
👉 Displays the full path of the directory you’re currently in.
📌 Example Output:
/home/user/Documents
4. mkdir – Create a New Directory
📌 Creates a new folder (directory).
mkdir new_folder
👉 Creates a directory named new_folder.
mkdir -p parent/child
👉 Creates a directory structure, ensuring that the parent directory exists before creating child.
5. rm – Remove Files or Directories
📌 Deletes files or directories permanently.
rm file.txt
👉 Deletes file.txt.
rm -r folder
👉 Deletes folder and all its contents.
⚠️ Be careful with rm -rf
, as it deletes everything without confirmation!
6. cp – Copy Files and Directories
📌 Copies files from one location to another.
cp file1.txt file2.txt
👉 Copies file1.txt to file2.txt.
cp -r folder1 folder2
👉 Copies folder1 and its contents to folder2.
7. mv – Move or Rename Files
📌 Moves or renames files and directories.
mv oldname.txt newname.txt
👉 Renames oldname.txt to newname.txt.
mv file.txt /home/user/Documents/
👉 Moves file.txt to the Documents folder.
8. cat – View File Contents
📌 Displays the contents of a file.
cat file.txt
👉 Prints the content of file.txt on the terminal.
cat file1.txt file2.txt > combined.txt
👉 Merges file1.txt and file2.txt into combined.txt.
9. grep – Search for Text in a File
📌 Finds specific words or patterns inside files.
grep "error" log.txt
👉 Searches for the word “error” in log.txt and highlights matching lines.
grep -i "hello" file.txt
👉 Searches for “hello” in file.txt (case-insensitive).
grep -r "keyword" /home/user
👉 Searches for “keyword” inside all files in /home/user.
10. chmod – Change File Permissions
📌 Modifies read, write, and execute permissions for a file.
chmod 755 script.sh
👉 Grants read & execute access to everyone but write access only to the owner.
chmod +x script.sh
👉 Makes script.sh an executable file.
Bonus: Table Summary of Commands
Command | Description | Example Usage |
---|---|---|
ls | List files & directories | ls -l |
cd | Change directory | cd /home/user |
pwd | Show current location | pwd |
mkdir | Create a directory | mkdir new_folder |
rm | Delete files or directories | rm -r folder |
cp | Copy files or folders | cp file1.txt file2.txt |
mv | Move or rename files | mv old.txt new.txt |
cat | View file contents | cat file.txt |
grep | Search within files | grep "word" file.txt |
chmod | Change file permissions | chmod +x script.sh |
Conclusion
These 10 Linux commands are essential for navigating, managing files, and controlling system permissions. Once you get comfortable with these, you’ll be able to use the Linux command line efficiently.
If you enjoyed learning about the 10 Linux commands, please consider reading our article on 5 hidden android features.
🚀 What’s your favorite Linux command? Let us know in the comments!