Devesh's Blog

Devesh's Blog

15 Linux Basic Terminal Commands Everyone Must Know!

15 Linux Basic Terminal Commands Everyone Must Know!

Want to get started with Linux, but it seems intimidating? Here are 15 Basic Linux Commands to get you started!

Before diving into terminal commands we must know what Linux actually is, there is a lot of misconception among people that Linux is an operating system, but no it is actually a kernel based on UNIX operating system. So the next time if someone mentions Linux as an operating system make sure you correct them :-)

Linux is an entire family of open-source Unix operating systems, that are based on the Linux Kernel. This includes all of the most popular Linux-based systems like Ubuntu, Fedora, Debian, and others. More accurately, they’re called distributions or distros.

If you're considering using Linux, learning basic terminal commands will go a long way. In this blog, you’ll learn 15 basic Linux commands that will help you navigate through Linux.

Here is a list of basic Linux commands:

1) pwd

• Use the pwd command to find out the path of the current working directory or folder you’re in.

2) cd

• cd command is used to navigate through the Linux files and directories.

• For instance:

cd /Desktop/React/Portfolio

3) ls

• The ls command is used to view the contents of a directory.

4) cat

• cat is short for concatenate, It is used to list the contents of a file on the standard output.

• To run this command, type cat followed by the file’s name and its extension.

• For instance:

cat index.html

5) mv

• The mv command is to move files, although it can also be used to rename files.

• For instance:

mv hello.txt /Desktop/Documents.

To rename files, the Linux command is

mv oldname.ext newname.ext

6) cp

• Use the cp command to copy files from the current directory to a different directory.

• For instance, the command

cp wallpaper.png /Desktop/Pictures

would create a copy of wallpaper.png from your current directory into the Pictures directory.

7) mkdir

• Use mkdir command to make a new directory.

• For instance:

mkdir Project1

8) rm

• The rm command is used to delete files or directories and the contents within them.

Note: Be very careful with this command this will delete everything and there is no undo

9) touch

• The touch command allows you to create a blank new file through the Linux command line.

• For instance:

touch index.html

10) grep

• This command lets you search through all the text in a given file.

• For example:

grep love poem.txt

11) sudo

• It is short for “SuperUser Do”, this command enables you to perform tasks that require administrative or root permissions.

12) wget

• It is used to download files from the internet. To do so, simply type wget followed by the download link. • For instance:

wget {image_url} -o {image_name}.jpg

13) echo

• This command is used to add data to a file.

• For instance:

echo Hello, world >> file.txt

14) zip

• Use the zip command to compress your files into a zip archive.

15) unzip

• Use the unzip command to extract the zipped files from a zip archive.

Some useful Tips when using Terminal👇

• Use the TAB button to autofill what you are typing.

• Use the clear command to clean up the terminal

• Use Ctrl+C to stop an execution

• If you accidentally freeze your terminal by using Ctrl+S, simply undo this with the unfreeze Ctrl+Q.

In the end, Basic Linux commands will help you execute tasks easily and effectively. It might take a while to remember some of the basic commands, but nothing is impossible with lots of practice.

Also if you liked the blog, give it a like and follow me on Twitter where I post daily content related to programming!

Interested in reading more such articles from Devesh B?

Support the author by donating an amount of your choice.

Recent sponsors
 
Share this