![21 Basic Linux Commands Every Developer Must Know [2019]](/images/blog/2019-12-Basic-Linux-Commands-Every-Developers-Must-Know.jpg)
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.
pwd
pwd prints the current directory.
cd
cd directory_path change directory to the path provided.
mkdir
mkdir directory_name makes a directory with the name provided.
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.
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.
Rename
mv file1 file2 Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2.
Symbolic link
ln -s /path/to/file linkname Create a symbolic link to linkname.
touch
touch file Create an empty file or update the access and modification times of the file.
cat
cat file View the contents of the file.
cat > filename Quickly create/overwrite a file.
less
less file Browse through a text file.
https://adevguide0926.live-website.com/how-is-java-pass-by-value-and-not-by-reference/
head
head file Display the first 10 lines of the file.
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.
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.
top
top Display and manage the top processes.
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.
https://adevguide0926.live-website.com/java-regular-expressions-regex/
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.
chmod
chmod options permissions filename changes file permission to assigned value.
chmod -R permissions directory changes directory permission to the mentioned value.
Cheatsheet
Basic Linux commands cheat sheet can be downloaded here.
References
https://www.linuxtrainingacademy.com/linux-commands-cheat-sheet/