The majority of the web servers run on Linux. If you are a backend developer or dealing with web development or web hosting Linux skills are essential. Linux is ideal for backend development. It is quick, trustworthy, and secure. As a backend developer, there are many reasons to have Linux skills. Linux is a very stable OS and you do not have to worry about random crashes or data loss and your development experience and process will be much smoother.
Linux is incredibly safe as well, this is crucial since your backend servers deal with sensitive data. Linux is quite adaptable you can configure it according to your development needs which makes it an ideal candidate OS for backend development. I am sharing some of the common Linux commands that are used most frequently on a day-to-day job and if you are new to backed development and Linux environment you can use this as a starting point of your Linux journey.
File System Commands
Command
Description
ls
This command gives information about files
ls -l or ll
This command privies the file information in a long listing format.
ls -la or la
This command lists file information in a long listing format including system files as well as hidden files (files starting with .)
cd or cd ~
This command changes the directory to the user’s home directory.
pwd
This command displays the present working directory.
cd <directory name>
This command helps you to navigate from one directory to another directory.
cd ..
This command moves the user to the parent directory.
mkdir project
This command will create a new directory called project on the current location.
rmdir project
Deletes empty directory project.
touch hello.txt
This will create a new empty file hello.txt at the current location.
cat hello.txt
This command will echo the contents of the hello.txt file on the screen.
cat > hello.txt
This command will open the hello.txt file in input mode. you can start typing the contents you want to save into the file. Once you are done typing press control or command + z to save the file and return to the prompt
cat >> hello.txt
Opens hello.txt file in append mode.
tail hello.txt
This command will print the last 10 lines of the file hello.txt
less hello.txt
This command print contact of hello.txt files in backward movement.
cp hello.txt hi.txt
This command creates a copy of the hello.txt file with the name hi.txt
mv hi.txt hey.txt
This command renames the hi.txt file to the hey.txt file. the mv command is also used to move files from one place to another place all you have to do is add the full path of the destination for example mv hi.txt /home/jhon/hey.txt
rm hi.txt
Deletes the file hi.txt
rm -f project
Removed project directory
rm -r project
Remove the project and its contents recursively
Network Related Commands
Command
Description
ping 127.0.0.1
Pings IP 127.0.0.1. Ping is used to troubleshoot/check the status of connectivity.
whois google.com
Displays information about google.com
dig google.com
Displays DNS information about google.com
dig -x google.com
Checking reverse DNS lookup on google.com
wget ULR_OF_FILE
Download the file from the web
wget -c ULR_OF_FILE
Continue partially downloaded files. It is useful when you have an unfinished download of a file.
wget -r ULR
Download files recursively from the given URL. It is useful when you have multiple files to download. The default maximum recursion depth is 5.
curl URL
Transfers/Outputs data from the given URL
curl -o hi.txt URL
Write data to hi.txt from data received from ULR instead of displaying it on stdout.
ssh jhon@127.0.0.1
Connects remote machine 127.0.0.1 as user jhon.
ssh -p 22 jhon@127.0.0.1
Connects to 127.0.0.1 as Jhon on port 22.
ssh -i <path-to-key> jhon@127.0.0.1
Connects to 127.0.0.1 as user Jhon using the given private key
Process Related Command
Command
Description
ps
Displays information about active processes.
ps -p 2094
Displays information about the process which has pid 2094
ps -e or ps aux
Display every process on the system
kill 2094
Kill process which has pid 2094
top
Provides dynamic run time view of running system
htop
It’s an interactive process viewer. It is more details and interactive tool compared to top
System Information Commands
Command
Description
date
Print system date and time.
uptime
Shows how long the system has been running.
whoami
Prints effective/current user name.
who
Gives a list of all logged-in users.
free
Display the amount of free and used memory in the system.
du
Displays space usage from directories and files.
df
Gives report of the file system/disk usage.
cat /proc/cpuinfo
Display information related to CPU
cat /proc/meminfo
Display information related to memory
which
Gives full path of executable. For example which PHP will give you the full path for installed php executable
The above-given commands are some of the commands that you will use on daily bases if you are using a Linux system. This list of commands will get you started with your Linux journey. Linux OS is well documented, if you need any help with any command just type –help at the end of the command or prefix command with man and it will give you a complete documentation for the given command. For example if you need help with ls command just type ls –help or man ls and you will get detailed documentation for the ls command. Linux is very essential skill for a developer and with constant practice you can master it.