A Beginner’s Guide to Surviving in the Linux Shell

Kill the fear of Linux shell by learning the ten most useful Linux commands.

Puranjay Mohan
Mar 15, 2019 · 9 min read

All the best people in life seem to like LINUX - Steve Wozniak

Image for post
Image for post
htop running in a Linux shell

The Linux Shell/Command-Line

Image for post
Image for post

Why should one learn the Linux command line?

Perks of being good at using the command line.

The Linux Command Prompt

Image for post
Image for post
[username@hostname current-directory]$

The 10 basic commands

1. pwd

Image for post
Image for post
pwd command in the home folder

2. cd

Image for post
Image for post
cd to myfolder and then running pwd
Image for post
Image for post
running ‘cd ..’ to change to the previous directory and then running pwd.

3. ls

Image for post
Image for post
ls command running in the myfolder directory
Image for post
Image for post
ls /boot shows contents of boot directory in root, but ls boot shows an error

4. man

Image for post
Image for post
The manual page for ls command

5. mkdir

Image for post
Image for post
creating a directory named ‘hello’ and then changing into it.

6. rmdir

Image for post
Image for post
moving out of ‘hello’ directory and then deleting it.
Image for post
Image for post
‘hello’ contains a file named ‘file1’, therefore rmdir fails with an error.
Image for post
Image for post
deleting hello folder which is not empty

7. clear

8. nano

Image for post
Image for post
Nano running in the Linux Terminal
Image for post
Image for post
Pressing ‘Y’ will save the file.
Image for post
Image for post
saving the file as testfile.txt

9. cat

Image for post
Image for post
running cat command on the previously created text file.

10. rm

Image for post
Image for post
deleting the previously created text file.

11. mv (Bonus Command)

Image for post
Image for post

Side notes and points to be remembered:

Conclusion:

freeCodeCamp.org

This is no longer updated.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store