Reading Time: 4 minutes

Basic Linux Commands Every Developers Must Know

Most Useful Linux Commands For Developer Cheat Sheet Included

Basic Linux Commands: In 2019, it doesn’t matter which language you choose for development, every developer must know how to use Linux servers for build and deployment purposes. We have compiled a list of 20 most basic and useful Linux commands which every developer must know.

21 Basic Linux Commands every developer must know:

ls

ls is the command used for listing all the files and folders in the directory.

ls -a displays all files including hidden files

ls -l display long detailed information of files which includes permission, date created, etc.

ls -lt displays detailed files sorted by last modified time at the top.

ls

pwd

pwd prints the current directory.

pwd

cd

cd directory_path change directory to the path provided.

cd

mkdir

mkdir directory_name makes a directory with the name provided.

mkdir

All Spring Annotations ASAP Cheat Sheet [Core+Boot][2019]

rm

rm file_name  Remove the file with the name provided.

rm -r directory Remove the directory and its contents recursively.

rm -f file Force removal of the file without prompting for confirmation.

rm -rf directory Forcefully remove directory recursively.

rm

Copy

cp source destination Copy source file to the destination.

cp -r source destinationCopy source_directory recursively to destination. If the destination exists, copy source_directory into the destination, otherwise create the destination with the contents of source_directory.

cp

Rename

mv file1 file2 Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2.

mv

Symbolic link

ln -s /path/to/file linkname Create a symbolic link to linkname.

ln

touch

touch file Create an empty file or update the access and modification times of the file.

touch

cat

cat file View the contents of the file.

cat > filename Quickly create/overwrite a file.

cat

less

less file Browse through a text file.

How is Java Pass by Value and Not by Reference [4 Examples]

head

head file Display the first 10 lines of the file.

head

tail

tail file Display the last 10 lines of the file.

tail -f file Display the last 10 lines of the file and “follow” the file as it grows.

tail -nf file Display the last n lines of the file and follow the file as it grows.

tail

ps

ps Display your currently running processes.

ps -ef Display all the currently running processes on the system.

ps -ef | grep processname Display process information for processname.

ps

top

top Display and manage the top processes.

top

kill

kill pid Kill process with a process ID of pid.

killall processname Kill all processes named processname.

ipconfig

ifconfig -a Display all network interfaces and IP address.

ping

ping host Send ICMP echo request to the host.

whois

whois domain Display whois information for the domain.

All About Java Regular Expressions Regex 2019

tar

tar cf archive.tar directory Create a tar named archive.tar containing directory.

tar xf archive.tar Extract the contents from archive.tar.

tar czf archive.tar.gz directory Create a gzip-compressed tar file name archive.tar.gz.

tar xzf archive.tar.gz Extract a gzip-compressed tar file.

tar cjf archive.tar.bz2 directory Create a tar file with bzip2 compression.

tar xjf archive.tar.bz2 Extract a bzip2 compressed tar file.

tar

 

chmod

chmod options permissions filename changes file permission to assigned value.

chmod

chmod -R permissions directory changes directory permission to the mentioned value.

chmod permission

 

Cheatsheet

Basic Linux commands cheat sheet can be downloaded here.

[su_button url=”https://github.com/iPraBhu/ADevGuide/blob/master/Resources/linux%20cheatsheet.jpg” target=”blank” style=”3d” background=”#93ef2d” center=”yes” icon=”icon: download” download=”https://github.com/iPraBhu/ADevGuide/blob/master/Resources/linux%20cheatsheet.jpg”]Download CheatSheet[/su_button]

 

References

https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/

https://www.katacoda.com/