Introduction

After part one we will look into more linux commands to enhance our use of commandline and troubleshoot any problems.

  1. ln - Create hard or symbolic links to files.

    ln -s /path/to/source/file link_name
    
  2. uptime - Display system uptime and load averages.

    uptime
    
  3. who - Display information about logged-in users.

    who
    
  4. whatis - Display one-line manual page descriptions.

    whatis command_name
    
  5. chroot - Change the root directory for a command.

    chroot /new/root /bin/bash
    
  6. which - Display the path of an executable.

    which command_name
    
  7. uptime - Display system uptime and load averages.

    uptime
    
  8. nmcli - Command-line client for NetworkManager.

    nmcli connection show
    
  9. rsync - Sync files and directories between systems.

    rsync -avz source/ destination/
    
  10. cut - Remove sections from lines of files.

cut -d, -f2 file.csv
  1. sed - Stream editor for text manipulation.
sed 's/old_text/new_text/' file.txt
  1. awk - Text processing tool for data extraction.
awk '{print $1}' file.txt
  1. sort - Sort lines of text files.
sort file.txt
  1. uniq - Remove duplicate lines from sorted files.
sort file.txt | uniq
  1. diff - Compare files line by line.
diff file1.txt file2.txt
  1. tar - Archive and compress files.
tar -cvzf archive.tar.gz directory/
  1. crontab - Schedule repetitive tasks using cron.
crontab -l
crontab -e
  1. wget - Download files from the internet.
wget https://example.com/file.zip
  1. curl - Transfer data to/from servers.
curl -O https://example.com/image.jpg
  1. zip and unzip - Create and extract compressed zip archives.
zip archive.zip file1.txt file2.txt
  1. ps - Display information about running processes.
ps aux
  1. kill - Terminate processes.
kill process_id
  1. killall - Terminate processes by name.
killall process_name
  1. nice - Adjust process priority.
nice -n 10 command
  1. renice - Change the priority of a running process.
renice -n 5 -p process_id
  1. whereis - Locate the binary, source, and manual page files for a command.
whereis command_name
  1. alias - Create shortcut commands.
alias ll='ls -al'
  1. file - Determine file type.
file file.txt
  1. df - Display disk space usage.
df -h
  1. du - Display file and directory space usage.
du -sh /var
  1. quota - Manage disk quotas for users.
quota -u user
  1. ssh-keygen - Generate SSH key pairs.
ssh-keygen -t rsa
  1. ssh-copy-id - Copy SSH keys to a remote server.
ssh-copy-id user@remote_server
  1. scp - Securely copy files between systems.
scp file.txt user@remote_server:/path/to/destination/
  1. ping - Check network connectivity.
ping google.com
  1. traceroute - Trace the route packets take to a destination.
traceroute google.com
  1. netstat - Display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
netstat -tuln
  1. ss - Display socket statistics.
ss -tuln
  1. route - Display and manipulate IP routing table.
route -n
  1. hostname - Display or set the system’s host name.
hostname
  1. history - View command history.
history
  1. shutdown and reboot - Shutdown or restart the system.
sudo shutdown -h now
sudo reboot
  1. file - Determine file type.
file file.txt
  1. lsblk - List block devices.
lsblk
  1. parted - Disk partitioning tool.
parted /dev/sdX
  1. nmcli - Command-line client for NetworkManager.
nmcli connection show
  1. useradd and userdel - Add and delete user accounts.
sudo useradd newuser
sudo userdel olduser
  1. groupadd and groupdel - Manage user groups.
sudo groupadd mygroup
sudo groupdel mygroup
  1. w - Show who is logged on and what they are doing.
w
  1. chsh - Change login shell.
    chsh -s /bin/bash username
    

Conclusion

With these 50 additional Linux commands and examples, you can expand your knowledge and enhance your proficiency in managing and working with Linux systems. These commands cover a wide range of tasks, from text processing and file manipulation to network diagnostics and system administration. Continue to explore and experiment with these commands to become a more skilled Linux user.