Today let’s focus on a Linux command list that will be useful to a newbie who is just starting off with Linux. It doesn’t matter whether you are a web developer or software engineer if you are going to use Linux you have to learn these. These commands are used day to day to get done work.

I don’t want to talk about the typical command list that is on the internet rather I would like to go beyond that and introduce couple of useful Linux commands. For the below commands you can find tons of tutorials.

  • cd
  • mv
  • cp
  • ls
  • pwd
  • ifconfig,
  • mkdir

So let’s move on.

Linux Command List

1. Remote Login

  • ssh – OpenSSH SSH client

ssh also known as Secure Shell is a Linux command that can used to access a remote instance securly. It uses an encripted channel to provide a text-based shell session on the remote instance. So you will be able to run commands without being physically present near the remote machine.

If you add -v you can enable verbose or debugging mode that let you get more information for debugging purpose. You can read more on SSH here and here.

2. Remote Copy

  • rsync – remote (and local) file-copying tool
  • scp – secure copy files

Both rsync Linux command and scp Linux command can be used as file transfer programs. They allow you to copy files to a remote instance. If we compare rsync and scp, scp provides a secure way to copy files over a given network by encrypting traffic. In other way rsync is much faster due to it’s algorithm and mechanism that is used to copy data. If your data are not sensitive use rsync since it’s faster as well as it can be used for file synchronisation.

  • a – archive mode
  • z – compress file data during the transfer
  • h – output numbers in a human-readable format
  • P – show progress

Now let’s focus on the scp Linux command.

  • r – recursively copy entire directories.

If you are interested in getting more information on rsync you can refer this article.

3. Network Tools

  • netstat
  • ping
  • dig

Let’s focus on a Linux command list that are used to debug and monitor network activity. So netstat is a Linux command that print network connections on particular instance.

  • n – show numerical addresses instead of trying to determine symbolic host, port or user names.
  • p – show the PID and name of the program to which each socket belongs.
  • l – show only listening sockets
  • t/u – tcp/udp

Moving on ping is a Linux command that is used to test connectivity between two nodes.

Last but not least dig is a Linux command that is used as a DNS lookup utility.

4. service – Run a System V init script

In simple terms service is a Linux command that is used to start or stop a particular service in Linux. So you might be wondering why use the service command in linux? Answer is here.

5. tail – Output The Last Part of Files

  • tailf
  • tail -f

If you want to moniter what’s happening with a log file there is a Linux command for that. Usually we use tail command to monitor a output from a log file that is continuously growing. You can get a realtime update about the file as the file grows. Here tail -f and the tailf offer the same functionality.

  • f – output appended data as the file grows

6. Text Editor/Reader

  • vi
  • vim
  • less

vi is a text editor and vim is an improved text editor based on vi with loads of features. You can read this article as an introduction to vim.

less is a file reader and the speciality of less is it does not have to read the entire input file before starting. If you are opening a large file it’s better to use less rather than using vi or vim.

7. Search Files & Folders

  • locate
  • find

In Linux there are couple of ways to search for what you want. Let’s focus on couple of Linux commands to get the searching done. One of the most common and easiest way to search for a file is locate Linux command. It allows to find the file by name.

The Linux command locate does not search for recently created file. If that case you have to use updatedb Linux command. updatedb creates or updates a database used by locate. Once you run the updatedb command database will be updated. Moving on to find which will search for files in a directories.

Future more you can specify whether you want to search for a file or directory by using -type.

8. screen – Multiplexes a Physical Console

One of the most useful but lesser known Linux command would be screen. In simple terms the screen program allows you to use multiple windows in Unix. In other words the screen command lets you detach from a terminal session and then attach it back at a later time.

I have a seperate article written on this topic starting from what’s screen to usage to real world examples. Please refer this link for more information.

9. grep – Pattern Search

grep Linux command allows you to print lines matching a pattern. In other words grep allows you to search for a pattern in your output. You can use the grep command inconjuction with other commands as below.

  • n – output the line numbers with the output

Even more grep can be also used as a search tool.

  • n -output the line numbers with the output
  • i – ignore case
  • r – read all files under each directory, recursively

Above command will search for apache2 search term inside the etc directory recursively including all files and directories..

10. Process viewer

One last Linux command before we wind up the article that is used to monitor your processes. It’s important have an idea about the processes that are currently being executed in your instance. For that you can use the top Linux command. I know the output of the top command is confusing but this tutorial will help you to understand top command very easily.

Moving on htop is a similar command as top but more informative and easy to understand. It’s an interactive process viewer. You will have to install the htop to start using it.

Install

Then just type

Tips & Tricks

Let me give you a way to get more information about any given Linux command that you prefer without going through a much of a hassle. For that you can use the man or info Linux commands. man and info are reference manuals that are integrated to Linux.

So that’s it about Linux commands. If you have any questions let me know in the comments below. Your feedback is highly appreciated(happy-face).

Be Sociable, Share!