Essential Linux commands every developer should master
ls
– List Files and Directories: List the contents of a directory.
Example: ls -l
cd
– Change Directory: Navigate to a different directory.
Example: cd /home/user/documents
pwd
– Print Working Directory: Display the current directory’s full path.
Example: pwd
mkdir
– Make Directory: Create a new directory.
Example: mkdir your_folder_name
rm
– Remove: Delete files or directory.
Example: rm yourfile.txt
cp
– Copy: Copy files or directories.
Example: cp file.txt /destination_folder
mv
– Move: Move files or directories.
Example: mv file.txt /your_new_location
touch
– Create Empty File: Create a new empty file.
Example: touch new_file.txt
cat
– Concatenate and Display: View the content of a file.
Example: cat file.txt
nano
– Text Editor: Open a text file for editing.
Example: nano file.txt
grep
– Search Text: Search for text patterns in files.
Example: grep "pattern" file.txt
find
– Search Files and Directories: Search for files and directories.
Example: find /path/to/search -name "file_name"
chmod
– Change File Permissions: Modify file permissions.
Example: chmod 755 file.sh
chown
– Change Ownership: Change the owner and group of a file or directory.
Example: chown user:group file.txt
ps
– Process Status: Display running processes.
Example: ps aux
top
– Monitor System Activity: Monitor system processes in real-time.
Example: top
kill
– Terminate Processes: Terminate a process using its ID.
Example: kill PID
wget
– Download Files: Download files from the internet.
Example: wget https://example.com/file.zip
curl
– Transfer Data with URLs: Transfer data to or from a server.
Example: curl -O https://example.com/file.txt
tar
– Archive and Extract: Create or extract compressed archive files.
Example: tar -czvf archive.tar.gz folder
ssh
– Secure Shell: Connect to a remote server securely.
Example: ssh user@remote_host
scp
– Securely Copy Files: Copy files between local and remote systems using SSH.
Example: scp file.txt user@remote_host:/path
rsync
– Remote Sync: Synchronize files and directories between systems.
Example: rsync -avz local_folder/ user@remote_host:remote_folder/
df
– Disk Free Space: Display disk space usage.
Example: df -h
du
– Disk Usage: Show the size of files and directories.
Example: du -sh /path/to/directory
ifconfig
– Network Configuration: Display or configure network interfaces (deprecated, use ip).
Example: ifconfig
ip
– IP Configuration: Manage IP addresses and network settings.
Example: ip addr show
netstat
– Network Statistics: Display network connections and statistics (deprecated, use ss).
Example: netstat -tuln
systemctl
– System Control: Manage system services using systems.
Example: systemctl start service_name
journalctl
– Systemd Journal: View system logs using systemd’s journal.
Example: journalctl -u service_name
cron
– Schedule Tasks: Manage scheduled tasks.
Example: crontab -e
at
– Execute Commands Later: Run commands at a specified time.
Example: echo "command" | at 15:30
ping
– Network Connectivity: Check network connectivity to a host.
Example: ping google.com
traceroute
– Trace Route: Trace the route packets take to reach a host.
Example: traceroute google.com
curl
– Check Website Connectivity: Check if a website is up.
Example: curl -Is https://example.com | head -n 1
dig
– Domain Information Groper: Retrieve DNS information for a domain.
Example: dig example.com
hostname
– Display or Set Hostname: Display or change the system’s hostname.
Example: hostname
who
– Display Users: Display currently logged-in users.
Example: who
useradd
– Add User: Create a new user account.
Example: useradd newuser
usermod
– Modify User: Modify user account properties.
Example: usermod -aG groupname username
passwd
– Change Password: Change user password.
Example: passwd username
sudo
– Superuser Do: Execute commands as the superuser.
Example: sudo command
lsof
– List Open Files: List open files and processes using them.
Example: lsof -i :port
nc
– Netcat: Networking utility to read and write data across network connections.
Example: echo "Hello" | nc host port
scp
– Secure Copy Between Hosts: Copy files securely between hosts.
Example: scp file.txt user@remote_host:/path
sed
– Stream Editor: Text manipulation using regex.
Example: sed 's/old/new/g' file.txt
awk
– Text Processing: Pattern scanning and text processing.
Example: awk '{print $2}' file.txt
cut
– Text Column Extraction: Extract specific columns from text.
Example: cut -d"," -f2 file.csv
sort
– Sort Lines: Sort lines of text files.
Example: sort file.txt
diff
– File Comparison: Compare two files and show differences.
Example: diff file1.txt file2.txt
wc
– Count the word characters
Example: wc -l
No Responses to “Essential Linux commands every developer should master”