in

LinuxLinux

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

Basic Linux Commands
Reading Time: 8 minutes

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  How to Install PIP for Python 2, Python 3 on Debian 10?

Clear:

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:

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.

bg:

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:

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

Basic Linux Commands
Calendar
$   cal

How to Use? Type cal and press Enter key.

date:

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
$   date

How to Use? Type date and press Enter key.

dir:

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

Basic Linux Commands
dir
$   dir

How to Use? Type dir and press Enter key.

du:

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

Basic Linux Commands
du
$   du

How to Use? Type du and Enter key.

echo:

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.

Check this too  Change & Reset User Password In Linux!
Basic Linux Commands
echo
$   echo ” “

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

free:

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
$   free

How to Use? Type echo and press Enter key.

history:

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

Basic Linux Commands
history
$   history

How to Use? Type history and press Enter key

hostname:

hostname command will display the Hostname of the server.

Basic Linux Commands
hostname
$   hostname

How to Use? Type hostname and press Enter Key.

last:

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

Basic Linux Commands
last
$   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
$   ls

How to Use? Type ls and press Enter key.

lscpu(Lscpu):

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

Basic Linux Commands
lscpu
$   lscpu

How to Use? Type lscpu and press Enter key.

nano:

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
$   nano

How to Use? Type nano and press Enter key.

passwd:

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
$   passwd

How to Use? Type passwd and press Enter key.

pwd:

pwd will display the current working directory.

Basic Linux Commands
pwd
$   pwd

How to Use? Type pwd and press Enter key.

rm:

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

$   rm

How to Use? Type rm and press Enter key.

Check this too  How to Change User Password in Ubuntu 18.04 LTS & 19.04 Disco Dingo

rmdir:

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

$   rmdir

How to Use? Type rmdir and press Enter key.

shutdown:

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
$   shutdown

How to Use? Type shutdown and press Enter key.

top:

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
$   top

How to Use? Type top and press Enter key.

uptime:

uptime command shows information about the Operating system.

Basic Linux Commands
uptime
$   uptime

How to Use? Type uptime and press Enter key.

users:

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

Basic Linux Commands
users
$   users

How to Use? Type users and press Enter key.

wget:

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

Basic Linux Commands
wget
$   wget -c website link

How to Use? Type wget -c https://www.tecrobust.com/pic1.png and press Enter key.

w:

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

Basic Linux Commands
w
$   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.

Article Review
  • Article Quality
  • Content Depth
  • Explanation
  • Working Efficiency
4.8

Summary

Visit TECROBUST for more interesting articles on Linux.

Sending
User Rating ( votes)

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