5 Most Useful Linux Commands For Beginners
I know, Linux can be intimidating for beginners. With thousands of distro flavors to choose from and all the commands you need to know, it can even be daunting to even get started with the Linux box. But worry no more because the best way to go forth is by learning stuff in chunks at a time.
So today we’ll look at the 5 most common and useful commands that you can use out of the box.
1. ls
ls
also known as the list command is used to print all the files and folders present inside any folder.
Note : while using
ls -l
,.
means current directory and..
mean parent directory
Usage
ls
will print all the visible ( not including hidden files ) files.
ls -l
will print all the visible files with long listing format
ls -al
will print all the files ( including hidden files too )
2. pwd
pwd
stands for present working directory. pwd
will present the current working directory path in your terminal. It is a powerful command as often times we get lost during navigation.
Usage
pwd
will print the current working directory
3. cd
cd
stands for change directory. As the name suggests, we use cd
to hop into different folders ( aka directories )
Usage
cd ~
will change your present working directory tohome
.
cd ..
will take you one level up to parent directory in the directory chain.
cd [PATH]
will change your present working directory to whatever path you’ll provide. Path can be both relative to your current working directory or it can be absolute.
4. cat
cat
stands for concatenation. This program was developed to concatenate files and print but mostly you’ll see it is used to quickly print the content of file onto the terminal screen.
A better way to view the contents of the file would be to use commands like more
or less
( but that will come in Part 2 of this blog post series, till then stay tuned. )
Usage
cat [FILE_NAME]
will print contents of the particular file if that file is present in your current working directorycat [PATH_OF_FILE_NAME]
will print contents of the file if present in the given path. Path can be both relative to the current working directory or absolute.
5. man
man
stands for manual and I’d say it is one of the most powerful command out there. man
lets you see a detailed manual of any command with all the options and how you should use them.
Note : Press
q
to exit out ofman
Usage
man [COMMAND]
will open a detailed manual of a given command.
That’s all folks. I hope you enjoyed and learned something new today. Will meet you in my next blog. Till then, bye.