linux commands

20+ Most useful Linux terminal commands | CodeHacks

Linux is an operating system kernel which is based on UNIX. Linux was developed by Linus Torvalds in 1991. This operating system is completely open source, free to redistribute and you can even contribute to Linux kernel to improve the OS to make it more better.

As an operating system, Linux is mainly used as a server. Because of the security and freedom to interact with the kernel most of the firms chose the OS to power their services.

Major features:

1.Highly secure: For those who values their data to be kept private, installing and using Linux on their system is a great deal. Linux was developed by keeping the security more advanced. Linux is less vulnerable to virus and other malware attacks until you explicitly give access to a program to manipulate your program files(root user).

2.Open source: Released under General Public Licence, Linux is a complete open source project and you can make any changes to the source code and you are allowed to distribute your own Linux distribution. eg: Ubuntu,Parrot OS, Kali Linux, Red Hat.

3.Availability of large number of distros to satisfy your needs: There are thousands of Linux distributions are available to use for any of your purposes. You must have heard of Ubuntu which is a free distribution of Linux OS and used by millions to power their businesses. And Kali Linux, Parrot OS developed for security enthusiasts.

Having said all that let’s come to the article, to make use of this OS you should be able to manage the system using it’s pre-installed Linux dash or what’s called terminal in many distributions. Linux terminal can take commands in the language shell script and able to run processes using CPU. Here in this guide we’ll be discussing about the most useful terminal commands to power up your Linux career.

1.cd - change directory 
#usage: cd /home/user/Desktop

2.ls - list items in a directory
#usage: directory:$ ls this can be used with many flags to list items are hidden
eg: ls -a

3.pwd - Get the path of current directory

4.mv - move a folder or to rename a file
#usage: mv /source/folder /destination/folder
#mv filename_old filename_new

5.mkdir - Create a new directory & rmdir 
#Delete an empty directory. Use rm to delete a directory is not empty.

6.zip && unzip - Create archive and extract archive respectively
#sudo - Access the system as a root user (similar to administrator user in windows)

7.cat - View a text file
#usage: cat hello.txt

8.cp - Copy a directory or copy a file
#usage: cp /sourcedir /destinationdir
#cp /source/file /destination/file

9.man && help - Get manual or help of a specific command.
#usage: man mv or help ls

10.apt-get - Install a package
#usage: apt-get install packagename This command may have a change in syntaxt depends upon linux flavour.

11.df - List all partitions and removable media and display their storage space.
#usage: df -h to get all the disks and medias and their storage details.[-h flag used to get the output in human readable format].

12.du - Get file size of a directory
#usage: du -h

13.ssh - To connect with remote systems
#usage:ssh user@ipaddress - can take flasgs like -X to access display.
#use sshfs for mounting a directory in to a system.

14.chmod && chown 
#chmod is used to change read,write permission of a file or folder. chown used to change the user and group permission to access a folder or file.

15.locate - Used to locate a specific search term in entire system.
#usage: locate filename

16.wget - Used to download something a web address.
#usage:wget https://domain.com/file.pdf

17.ifconfig - Display the IP address and MAC address.

18.nano || vim - Open a text editor in terminal
#usage: nano filename.txt

19.find - Search for a specific file in a directory
#usage:find /home/user/ -name "*.html"

20.grep - Grep command is more useful when we need to search for a specific pattern inside a file.
#usage:grep -i "linux" linux.txt

21.history - Displays all user entered commands.

These are the basic and most used commands to interact with a terminal console. Still there are many commands are available to interact with a Linux terminal. Please feel free to mention your ad-dons on the comments. I’ll add those in the list.

1 thought on “20+ Most useful Linux terminal commands | CodeHacks”

  1. Pingback: Explained Linux file system and Directory structure - CodeHacks

Leave a Comment

Your email address will not be published.