In the realm of Linux, where the Force flows through every line of code, mastering the art of command is a path to true enlightenment. As Jedi Masters of this mystical operating system, we hold the key to unlocking its vast potential and harnessing its power for the greater good.
With these commands at your command, you will traverse the treacherous paths of system management with grace and efficiency. No longer will you be bound by the chains of manual labor, for automation shall be your ally. From the mystical incantations of “ls” to the Jedi mind tricks of “grep,” each command has been carefully chosen to empower you on your quest.
So, my fellow Jedi, are you ready to embark on this epic journey? Take my hand, and together we shall unlock the true potential of Linux, illuminating the path for all who follow. This list has been shared by Jedi Dean Marc over at Liwaiwai. Each command has been carefully selected based on its significance, versatility, and potential to streamline operations across various Linux distributions. By familiarizing oneself with these essential commands, users can unlock the true potential of Linux, harnessing its robust capabilities to meet the demands of modern computing environments.
-
ls – List directory contents
Example:ls -l
(List files in long format) -
cd – Change directory
Example:cd /path/to/directory
(Change to a specific directory) -
pwd – Print working directory
Example:pwd
(Display the current directory path) -
mkdir – Make directory
Example:mkdir new_directory
(Create a new directory) -
rm – Remove files or directories
Example:rm file.txt
(Delete a file) -
cp – Copy files and directories
Example:cp file.txt destination/
(Copy a file to a destination) -
mv – Move or rename files and directories
Example:mv file.txt new_name.txt
(Rename a file) -
touch – Create an empty file
Example:touch file.txt
(Create a new empty file) -
cat – Concatenate and display file content
Example:cat file.txt
(Display the content of a file) -
grep – Search for patterns in files
Example:grep "pattern" file.txt
(Search for a specific pattern in a file) -
find – Search for files and directories
Example:find /path/to/directory -name "filename"
(Find a specific file in a directory) -
chmod – Change file permissions
Example:chmod 755 file.txt
(Change the permissions of a file) -
chown – Change file ownership
Example:chown user:group file.txt
(Change the ownership of a file) -
tar – Archive files and directories
Example:tar -czvf archive.tar.gz directory/
(Create a compressed archive of a directory) -
unzip – Extract files from a ZIP archive
Example:unzip archive.zip
(Extract files from a ZIP file) -
ssh – Secure shell remote login
Example:ssh username@hostname
(Connect to a remote server using SSH) -
sudo – Execute a command with superuser privileges
Example:sudo apt update
(Update package lists using sudo) -
apt-get – Package handling utility for Debian-based systems
Example:apt-get install package_name
(Install a package using apt-get) -
man – Display the manual page of a command
Example:man ls
(Display the manual for the “ls” command) -
ps – Display running processes
Example:ps aux
(Display all running processes) -
top – Display system resource usage
Example:top
(Monitor system resource utilization) -
du – Estimate file and directory space usage
Example:du -sh directory/
(Show the total size of a directory) -
df – Display disk space usage
Example:df -h
(Display disk space usage in a human-readable format) -
ping – Send ICMP echo requests to a network host
Example:ping google.com
(Ping a website to check network connectivity) -
ifconfig – Configure network interfaces
Example:ifconfig eth0 up
(Bring up a network interface) -
wget – Retrieve files from the web
Example:wget http://example.com/file.txt
(Download a file from a URL) -
curl – Transfer data to or from a server
Example:curl http://example.com
(Retrieve the contents of a web page) -
systemctl – Control the systemd system and service manager
Example:systemctl start service_name
(Start a system service) -
journalctl – Query the systemd journal
Example:journalctl -u service_name
(View the logs of a specific service) -
scp – Securely copy files between hosts
Example:scp file.txt user@host:/path/to/destination
(Copy a file to a remote host) -
grep -r – Search for text recursively in files and directories
Example:grep -r "pattern" directory/
(Search for a pattern recursively in a directory) -
sed – Stream editor for filtering and transforming text
Example:sed 's/foo/bar/' file.txt
(Replace occurrences of “foo” with “bar” in a file) -
awk – Text processing and pattern scanning language
Example:awk '{ print $1 }' file.txt
(Print the first column of a file) -
ssh-keygen – Generate SSH key pairs Example:
ssh-keygen -t rsa
(Generate an RSA SSH key pair) -
systemctl status – Display the status of a systemd unit
Example:systemctl status service_name
(Check the status of a service) -
diff – Compare files line by line
Example:diff file1.txt file2.txt
(Compare two files and show the differences) -
head – Output the first part of files
Example:head -n 10 file.txt
(Display the first 10 lines of a file) -
tail – Output the last part of files
Example:tail -n 5 file.txt
(Display the last 5 lines of a file) -
tar -xvf – Extract files from a tar archive
Example:tar -xvf archive.tar
(Extract files from a tar archive) -
history – Display the command history
Example:history
(Show a list of previously executed commands) -
ln – Create links between files
Example:ln -s file.txt link.txt
(Create a symbolic link to a file) -
mount – Mount a file system
Example:mount /dev/sda1 /mnt
(Mount a partition to a mount point) -
umount – Unmount a file system
Example:umount /mnt
(Unmount a mounted file system) -
chmod +x – Make a file executable
Example:chmod +x script.sh
(Make a script executable) -
grep -v – Invert match and exclude lines matching a pattern
Example:grep -v "pattern" file.txt
(Print lines not containing the pattern) -
kill – Terminate a process
Example:kill process_id
(Terminate a process by its ID) -
systemctl enable – Enable a systemd unit to start on boot
Example:systemctl enable service_name
(Enable a service to start automatically) -
chown -R – Change ownership recursively
Example:chown -R user:group directory/
(Change the ownership of a directory and its contents) -
useradd – Create a user account
Example:useradd username
(Create a new user account) -
usermod – Modify user account properties
Example:usermod -aG groupname username
(Add a user to a group) -
passwd – Change user password
Example:passwd username
(Change the password for a user) -
systemctl restart – Restart a systemd unit
Example:systemctl restart service_name
(Restart a service) -
sort – Sort lines of text files
Example:sort file.txt
(Sort the lines of a file alphabetically) -
which – Locate the executable of a command
Example:which command
(Find the location of a command’s executable) -
crontab – Schedule periodic tasks
Example:crontab -e
(Edit the user’s crontab file) -
ssh-key-copy – Copy SSH public key to a remote server
Example:ssh-copy-id user@host
(Copy SSH public key to a remote server) -
ln -s – Create a symbolic link
Example:ln -s /path/to/file link_name
(Create a symbolic link to a file) -
history -c – Clear command history
Example:history -c
(Clear the command history) -
alias – Create an alias for a command
Example:alias l='ls -l'
(Create an alias “l” for the “ls -l” command) -
echo – Print a message
Example:echo "Hello, World!"
(Print the message “Hello, World!”) -
systemctl stop – Stop a systemd unit
Example:systemctl stop service_name
(Stop a service) -
gzip – Compress files
Example:gzip file.txt
(Compress a file using gzip) -
gunzip – Decompress files compressed with gzip
Example:gunzip file.txt.gz
(Decompress a file compressed with gzip) -
tar -cvf – Create a tar archive
Example:tar -cvf archive.tar directory/
(Create a tar archive of a directory) -
tar -tvf – View the contents of a tar archive
Example:tar -tvf archive.tar
(List the files in a tar archive) -
df -h – Display disk space usage in a human-readable format
Example:df -h
(Show disk space usage in a human-readable format) -
df -i – Display inode usage
Example:df -i
(Display inode usage) -
ifconfig -a – Display all network interfaces
Example:ifconfig -a
(Display all network interfaces) -
netstat -tuln – Display listening ports
Example:netstat -tuln
(Show listening ports) -
systemctl reload – Reload a systemd unit configuration
Example:systemctl reload service_name
(Reload a service configuration) -
systemctl disable – Disable a systemd unit from starting on boot
Example:systemctl disable service_name
(Disable a service from starting automatically) -
free -m – Display memory usage in megabytes
Example:free -m
(Show memory usage in megabytes) -
ps -ef – Display a snapshot of the current processes
Example:ps -ef
(Display all running processes) -
ssh-keygen -p – Change passphrase of an SSH private key
Example:ssh-keygen -p
(Change the passphrase of an SSH private key) -
history -w – Write the current history to the history file
Example:history -w
(Write the current history to the history file) -
find -type f -name – Search for files with a specific name
Example:find /path/to/directory -type f -name "filename"
(Search for a file by name) -
locate – Find files by name
Example:locate file.txt
(Find the path of a file by name) -
systemctl list-units – List all systemd units
Example:systemctl list-units
(List all active systemd units) -
cat file1.txt file2.txt – Concatenate multiple files and display the content
Example:cat file1.txt file2.txt
(Concatenate the content of two files) -
grep -i – Perform a case-insensitive pattern search
Example:grep -i "pattern" file.txt
(Search for a pattern case-insensitively) -
chmod -R – Change permissions recursively
Example:chmod -R 755 directory/
(Change the permissions of a directory and its contents recursively) -
wc -l – Count the number of lines in a file
Example:wc -l file.txt
(Count the number of lines in a file) -
tail -f – Output the last part of a file and follow its changes
Example:tail -f file.txt
(Display the last part of a file and follow new lines as they are appended) -
chgrp – Change group ownership
Example:chgrp groupname file.txt
(Change the group ownership of a file) -
gzip -d – Decompress files compressed with gzip
Example:gzip -d file.txt.gz
(Decompress a file compressed with gzip) -
tar -xvf – Extract files from a tar archive
Example:tar -xvf archive.tar
(Extract files from a tar archive) -
awk ‘{print $NF}’ – Print the last field of each line
Example:awk '{print $NF}' file.txt
(Print the last field of each line in a file) -
sort -r – Sort lines of text files in reverse order
Example:sort -r file.txt
(Sort the lines of a file in reverse order) -
sed ‘s/foo/bar/g’ – Replace all occurrences of a string with another string
Example:sed 's/foo/bar/g' file.txt
(Replace all occurrences of “foo” with “bar” in a file) -
tail -n +2 – Display all lines of a file except the first line
Example:tail -n +2 file.txt
(Display all lines of a file except the first line) -
tee – Read from standard input and write to standard output and files
Example:command | tee file.txt
(Execute a command and write its output to a file) -
df -h -T – Display disk space usage with file system type
Example:df -h -T
(Show disk space usage with file system type) -
ps aux | grep process_name – Display information about a specific process
Example:ps aux | grep sshd
(Display information about the SSH daemon process) -
mount -t – Mount a specific file system type
Example:mount -t ext4 /dev/sda1 /mnt
(Mount an ext4 file system to a mount point) -
df -h – Display disk space usage in a human-readable format
Example:df -h
(Show disk space usage in a human-readable format) -
tar -xvf – Extract files from a tar archive
Example:tar -xvf archive.tar
(Extract files from a tar archive) -
tar -tvf – View the contents of a tar archive
Example:tar -tvf archive.tar
(List the files in a tar archive) -
df -h – Display disk space usage in a human-readable format
Example:df -h
(Show disk space usage in a human-readable format) -
df -i – Display inode usage
Example:df -i
(Display inode usage) -
ifconfig -a – Display all network interfaces
Example:ifconfig -a
(Display all network interfaces)