Basic Linux Commands & Codes for Beginners[Ubuntu & Mint & More]

Basic Linux Commands

Basic Linux Commands: Though Linux is not a famous and most used operating system by conventional users, Linux offers a lot of interesting things compared to other operating systems like Windows, Mac OS and more. Firstly, Linux is an Open source Operating system and hence one can able to use it for free. Linux Operating systems more designed for Server Side initially but currently, Linux is available as a Full featured Operating system. The most famous Linux Distributions as Redhat, Ubuntu, KDE, SUSE, Mint and more. Though Command Prompt is available in Windows OS, people generally don’t use it much as they mostly rely on the Full Fledged GUI offered by Windows. In contrast, Linux was initially based on Terminal and hence Linux Codes are much familiar than Windows Codes among the users. Later on, Linux also started providing a better and easily usable Graphical User Interface(GUI). In this article, we will cover all the Basic Linux Commands that you will be looking for as a beginner of Linux OS.

Jump to:

Getting Started with Linux Terminal:

Firstly, Let’s start with opening the Linux Terminal. You can use CTRL+ALT+T to open Linux Terminal. You can also open the Linux Terminal in GUI mode. It will be available under All Applications.

Once the Terminal is opened, it will be ready for use. By default, the terminal will specify the Computer name as well as the Username. Refer the following image for better understanding. The format is [email protected]:~$

Linux Commands
Linux Terminal
  • Username: The username of the Current user.
  • Hostname: Hostname of the Server.
  • ~ Bash[Default Shell]. Represents the Current Directory.
  • $ End of the Command Prompt after which user can enter their input.
  • The above are the Terminologies of Linux Shell Codes that appear the moment the Terminal is opened.

Basic Linux Commands and Working with Linux Terminal:

In this section, we will list out all the basic Linux Commands and codes that you can use on your Linux Terminal to perform various operations. Kindly Ignore the $ sign while copying command from here.

Check this too  Bash For Loop Command & Examples Ubuntu 18.04, 19.04 & Debian Distros


Clear command is used to clear the Linux Terminal. It will create all the existing entries that appear the Linux terminal and provides a Fresh interface. Kindly note that using “Clear” Command will not kill or terminate the process that is currently going on in Linux Terminal. Kindly Ignore the $ sign while copying command from here.

$   clear

How to Use? Type clear and press Enter key.


Exit Command is used to close the Linux Terminal. If you are done with your work on Terminal and if you wish to close the Terminal then you use the Exit Command. In case your terminal is running a process and if you try to close the Terminal, then a Warning popup will appear stating that “Closing the Terminal will kill the process.”

$   exit

How to Use? Type exit and press Enter key.


The bg Command is used to send a process that is going on to the background and hence you can start a new process while the older process will be running in the background.

$   bg

How to Use? Type bg and press Enter key.


cal command is used to display the Calender on the Terminal.

Basic Linux Commands
$   cal

How to Use? Type cal and press Enter key.


date command is used to display the system Date and time on the terminal. You can also set the date using this command.

Basic Linux Commands
$   date

How to Use? Type date and press Enter key.


dir command will display all the folders of the current user who is logged in.

Basic Linux Commands
$   dir

How to Use? Type dir and press Enter key.


du command will show the Disk space usage of the directory as well as the subdirectories.

Basic Linux Commands
$   du

How to Use? Type du and Enter key.

Check this too  Basic Linux Commands- Ever Green Commands For Quick Actions


The echo command is used to print text in the terminal. If you want to print information or reference or any kind of texts then you can use the echo command.

Basic Linux Commands
$   echo ” “

How to Use? Type echo “Your Text” and press Enter key.


free command is used to display the free disk space. It shows all the information on the disk such as Free Space, Used Space, Swap memory, Cache memory and more in a clear format.

Basic Linux Commands
$   free

How to Use? Type echo and press Enter key.


history command will display the previous commands used on the Terminal.

Basic Linux Commands
$   history

How to Use? Type history and press Enter key


hostname command will display the Hostname of the server.

Basic Linux Commands
$   hostname

How to Use? Type hostname and press Enter Key.


last command is used to display the information about the last user who logged in.

Basic Linux Commands
$   last

How to Use? Type last and press Enter key.

ls (LS):

ls command will list the contents in the directory and it is similar dir command.

Basic Linux Commands
$   ls

How to Use? Type ls and press Enter key.


lscpu command will provide complete information about CPU such as Processor name, processor working frequency, Cache information and more.

Basic Linux Commands
$   lscpu

How to Use? Type lscpu and press Enter key.


nano Command will open a small and simple Text editor inside the Linux Terminal itself where you can perform a number of operations such as write, read, edit, search and finally save the file.

Basic Linux Commands
$   nano

How to Use? Type nano and press Enter key.


passwd command is used to manage your password in your Linux system. If you wish to change the current password of your system on terminal then use can use passwd command.

Basic Linux Commands
$   passwd

How to Use? Type passwd and press Enter key.


pwd will display the current working directory.

Check this too  How To Create A File In Linux {Ubuntu 18.04 & 19.04}
Basic Linux Commands
$   pwd

How to Use? Type pwd and press Enter key.


rm command is used to remove a file from the directory.

$   rm

How to Use? Type rm and press Enter key.


rmdir command is used to remove a folder in a directory.

$   rmdir

How to Use? Type rmdir and press Enter key.


shutdown command is used to Shutdown the PC. Pc will be set to Automatic shutdown for the Next minute from the time the command executed. If you wish to cancel the shutdown, kindly use shutdown -c

Basic Linux Commands
$   shutdown

How to Use? Type shutdown and press Enter key.


top command displays information about the processes(CPU usage, total tasks, Memory, Swap, Cache and information on individual tasks that are running currently and more) that are currently running on the Linux OS. To make it more clear, this command provides information just like the Task Manager of Windows provides.

Basic Linux Commands
$   top

How to Use? Type top and press Enter key.


uptime command shows information about the Operating system.

Basic Linux Commands
$   uptime

How to Use? Type uptime and press Enter key.


users command display the information about the user who is logged in currently.

Basic Linux Commands
$   users

How to Use? Type users and press Enter key.


wget command is used to download files from the internet by specifying the exact path.

Basic Linux Commands
$   wget -c website link

How to Use? Type wget -c and press Enter key.


w command will show the information about the current user, load averages and time active and more.

Basic Linux Commands
$   w

How to use? Type w and press Enter key.

Get in touch with Us:

The above are the basic and frequently used Linux commands that we have to know as a beginner. This article described most of the Basic Linux Commands with clear image representation and if you have any query then kindly Comment us and we will get back to you with a solution ASAP.

Leave a Reply

Your email address will not be published. Required fields are marked *

Written by Ranger

Hey Guys, How you doing? I am Ranger and I am from Philadelphia. Actually, I am a very Lazy person with an active mind and a lazy body and mostly sleeping because of that. Foods and Places are my favorite and I would love to explore places. Contact me through the Contact Us page adding "@Ranger" on the Subject.

Linux Tips & Tricks

Commands To Remove Unused Packages & Get Linux Server IP Address