DEV Community

Pratik Mule
Pratik Mule

Posted on Edited on

10 Basic Linux Commands Every Beginner Should Know published: false

Linux looks scary at first, but a few commands cover most daily work.

1. Where am I?

pwd
Enter fullscreen mode Exit fullscreen mode

2. List files

ls -la
Enter fullscreen mode Exit fullscreen mode

3. Change directory

cd /var/log
cd ..    # go one level up
cd ~     # go home
Enter fullscreen mode Exit fullscreen mode

4. Create folders and files

mkdir projects
touch notes.txt
Enter fullscreen mode Exit fullscreen mode

5. Copy, move, rename

cp notes.txt backup.txt
mv backup.txt old.txt
Enter fullscreen mode Exit fullscreen mode

6. Delete (be careful)

rm old.txt
rm -r foldername
Enter fullscreen mode Exit fullscreen mode

There is no recycle bin here, so check twice.

7. Read files

cat notes.txt
less notes.txt
tail -n 20 notes.txt
Enter fullscreen mode Exit fullscreen mode

8. Search text

grep -i "error" notes.txt
Enter fullscreen mode Exit fullscreen mode

9. Check disk and memory

df -h
free -h
Enter fullscreen mode Exit fullscreen mode

10. Get help

man ls
ls --help
Enter fullscreen mode Exit fullscreen mode

Final tip

Don't memorize everything. Practice these daily in a test machine or VM.

Practice in our Linux Lab

No setup needed to start practicing. Try these commands in our browser-based Linux lab:
๐Ÿ‘‰ Nexvelor LinuxLab

If you find it useful, share it with a friend who is learning Linux.

Written by Pratik Mule | Linux Administrator
๐Ÿ”— More about me: pratikmule127.github.io

๐Ÿ’ผ LinkedIn: linkedin.com/in/pratik-mule
๐ŸŒ Portfolio: pratikmule127.github.io
๐Ÿ™ GitHub: github.com/pratikmule127
๐Ÿงช DB PracticeLab repo: github.com/nexvelorcloud/db-practice-lab
๐Ÿ”— Live Lab: dblab.nexvelor.qzz.io

Top comments (0)