25 Essential Commands for Linux Newbies

The terminal in Linux, and the need to use it, is a widely known fact, and one of the big reasons why Linux has earned the reputation of being harder to used compared to other commercial alternatives out there.

However, in my experience, Linux isn’t any more difficult to use than any other system. It’s just different. Yes, you will need to use the terminal. But, with a little practice, you can become an expert in the Linux terminal. Once you do, I believe you will find that in many ways using Linux is actually easier and faster compared to the other options out there.

What Is Linux?
At its most basic, Linux is an operating system, much like Microsoft Windows and Apple macOS. It was originally created in 1991 by Linus Torvalds when he became interested in UNIX based operating systems but became frustrated with licensing issues surrounding many operating systems of the time. Linux isn’t a port of UNIX per say, as it’s built from the ground up. But it does share many similarities to UNIX, thus coining the term UNIX-like operating system.

Today, Linux can be found in the form of distributions, created by different groups of people and companies. Some of the most popular distributions today are:

Because of its free and open source licensing policies, today tt powers a majority of the world’s servers, especially for the Internet. But it can also be found powering routers, switches, and even our televisions and many more devices.

The Linux Terminal
The Linux Shell, more often referred to as the Linux Terminal, is a text-based application designed to receive commands from the user and show the output of these commands. From here, you can completely control every aspect of your Linux operating system. While you still may have a graphical user interface for day-to-day tasks, chances are you will have to use the Terminal to properly administer your Linux operating system.

Essential Linux Commands
Now that you understand exactly what the Linux Shell or the Linux Terminal actually is, let’s take a look at 25 essential commands that you will need to know when you start using Linux.

1. clear

When you are working in your terminal, the output can fill up your terminal window. By executing the clear command, you can clear your terminal window of all that added output that you don’t need and start with a fresh, empty terminal window.

2. ls

One of the commands you will use the most, ls allows you to see a list of files and directories of the directory you are currently inside. Adding the -l command will also show you the read/write permissions and group settings while also adding the -a will show hidden files. The most common way i use this is ls -la to show everything with all the details I need.

3. cd

The cd command is used to go to a directory. Simply type cd “directory name”. You can switch to any directory in your Linux file system if you execute the command with the “/” command. For example, typing cd /var while in your home directory will switch you over to the var directory with one command. You can also go up one level in directory structure by typing cd.. followed by enter.

4. pwd

A fairly simple command, the pwd command will tell you exactly where you are in your Linux file system. When you first open the terminal, you will be in your Home folder. But as you work in the terminal, chances are you will end up somewhere completely different. If you forget where you are, this command will be a lifesaver.

5. mkdir

When you want to create a new directory in Linux, execute mkdir “directory name”. This will create a directory in the current directory you are in. By adding a full path to the name, you can create a new directory anywhere.

6. rmdir

When you want to delete a directory, enter rmdir “directory name”. This will remove an empty directory in Linux. However, this command will not delete a directory that contains files. For that, you must use the rm command.

7. rm

The rm command is used to delete files on your system. To delete files, simply type rm “filename”. It will also delete directories with files inside them. To remove a directory, enter rm -r “directory name”.

8. mv

This command is used to move files from one directory to another. You can also use it to rename a file. To use it, type mv “name of file” “path/name of file”.

9. cp

If you need to copy a file from one place to another, or make a copy of the file under a new name, use the cp command. You will need two sets of parameters for this command. First, you will need to enter the name of the original file and then you will enter the location and name of the new file. Executing cp test test2 will create a duplicate of the file with a new name.

10. man

Linux is documented very well. Almost every single command in the terminal contains a manual page to learn more about it and how to use it. To access these manuals, simply type man “command” to display the manual page about that particular command.

11. date

This command will display the date that is set on the system. If the date is wrong, you can execute this command as root using sudo or su to change the date.

12. sudo

Many commands, such as package installation, for example, require root access in order to execute. By default, your user account doesn’t have root access. When you want to execute a command as root, all you have to do is type sudo before the command. For example, sudo apt-get install test would attempt to install a package called test.

13. su

Unlike sudo, the su command will log you in as root. In some systems, this is disabled by default, but can be activated on any Linux system if necessary. This allows you to login as root and make changes to your system without having to type sudo.

14. locate

The locate command is used to find a file in the Linux file system, much like search on Windows and Mac. Simple enter locate “filename” to find the file. If you aren’t sure if the name is in upper or lower case, add the -i switch to the command to ignore case, i.e. locate -i “filename”.

15. chown

Linux uses users and groups to denote ownership and permissions to files. If you want to change the ownership of a file from one user to another, enter chown “username” “filename”.

16. chgrp

You can also change the group ownership of a file so users that belong to a specific group can access a file. To change the group, type chgrp “group” “filename”.

17. chmod

To change the permissions of files or directories, use the chmod command. It makes use of parameters such as number codes like “755” to alter the read, write and execute permissions on files and directories. Such as chmod 755 “directory/filename”

18. tar

The tar format is a type of compressed file format used on UNIX and UNIX-like operating systems. It uses arguments to manage tarballs, often found on Linux. Depending on which argument you use, you can compress files into a tar or extract them.

19. zip/unzip

The zip command is used to create a zip file of whatever files and folders you choose. For example, executing zip “name of files/folders” will create the zip archive. Unzip, on the other hand, will extract the contents of any zip file you create or download.

20. apt-get

Apt is the name of a package management system found in Debian-based Linux distributions. Using the apt-get command, you can install software, update your package management sources, remove software and more. It often needs to be executing as root or using the sudo command. For example, sudo apt-get install test would try to install a package named test.

21. df

The df command is used to check how much space you have on your hard drives. It will list all of the partitions on your hard disk and how much free space is available on each of them.

22. free

If you want to check how much RAM you are using and how much swap disk space is being used and how much you have, simply type free into the terminal to see how many resources your system is currently using.

23. mount/unmounts

The mount and unmount commands are used to mount any type of media to a specific directory. Using this command you can open DVD’s, external hard drives, USB flash drives, and more. To mount, simply execute the mount command. When you are finished, you execute unmount to remove it from the system.

24. ping

The ping command will check your connection to a particular server. It’s a very handy tool for troubleshooting internal network problems and even Internet connectivity issues.

25. kill

Sometimes a process or application will begin to misbehave, even in Linux. By executing the kill command followed by the process ID, you can terminate the command. Think of it as a task manager for your Linux terminal. When you have an app that is acting up, kill it with this command.

Parting Thoughts
As you can see, there are tons of commands you can learn in the Linux Terminal. These 25 really only scratch the service of the possibilities. But, they will give you a great start on your journey into the world of Linux if you decide to run it on your laptop or desktop. Navigating the terminal and executing commands in Linux is essential to any newbie wanting to take the Linux plunge. Try these commands on your copy of Linux and learn them by heart. Once you do, your Linux experience will get even better.

This post was a guest article from Laptop Ninja. We hope you guys enjoyed it and will learn a lot from this. All the commands in this post are explained properly and it will surely help newbies to learn and enjoy Linux more. This is it for today, stay tuned and don't forget to have fun with Linux.

Hot Widget

#htmlcaption1 Switch To Linux Linux Brings Power #htmlcaption2 Thank You for being here! Stay Connected!