Linux is a popular operating system for servers, supercomputers, and personal computers. It is totally open-source and free. I am using a Linux machine in my organization for creating applications, deploying my applications on-premises servers as well as on Cloud machines.
I use some Linux commands on a daily basis for listing the file, creating files/folders, giving permission to the file and folder, Loggin to the server by command, etc.
Here is the list of Basic Linux commands for developers:
ls – List:
The most frequently used command in Linux for listing directories.
1 | ls |
ls -a: It is used to list the hidden file as well.
1 | ls -a |
pwd – Print Working Directory
It prints the working directory in Linux.
1 | pwd |
mkdir – Make Directory
mkdir
uses to make the new directory/folder in Linux
1 | mkdir new-folder |
cd – Change Directory
It is used to navigate through directories.
1 | cd directory-name |
cp – Copy
cp
command uses to copy files or folders from one location to another.
1 | cp source-file destination-file |
You can use the below command for a recursive copy.
1 | cp -r source-file destination-file |
mv – Move
The command moves a file or folder from one location to another. Also, It is used for renaming the file and folder.
rm – Remove
rm
command deletes the files or folder.
1 | rm folder/file name |
If you want to delete the folder and its file recursively then you can use the below command.
1 | rm -r folderName |
touch
touch command creates blank/empty files.
1 | touch fileName |
sudo – Superuser DO
Some of the commands require administration or root permission to perform the tasks so we use
sudo
before that command.
chmod – Change Mode
chmod command uses to change permissions of files and directories.
chown – Change Owner
chown command uses to change ownership of files and directories.
ping – Packet Internet Groper
Ping command allows checking the connectivity status of a server.
1 | ping google.com |
Also, you can check connectivity using an IP address.
1 | ping ipAddress |
SSH – Secure Shell
SSH
command uses to log in to the server. We use a userName and IP address of the machine to login into the server. Below is the ssh command format.
1 | ssh userName@ipAddress |
cat – Concatenate
cat(Concatenate) command displays file contents on the terminal.
1 | cat fileName |
clear
It clears the terminal display.
top – Table of Processes
Simply type top on the command line to get a list of all active Linux processes, including information on running tasks, memory, CPU, and swap.
ifconfig – Interface Config
It displays network interfaces and IP addresses.
ps – Precess Status
It displays active processes.
kill
It kills active processes by process ID or name.
zip – Zip files in Linux
unzip – Unzip files in Linux
These are the Basic Linux Commands for Developers. You can read the Linux command from the Ubuntu site.
Here is some online course for Linux commands: