DEV Community

Cover image for Magic with Linux Commands
Lakshit Pant
Lakshit Pant

Posted on

Magic with Linux Commands

"Linux: Where Geeks Roam Free!"

Welcome to the world of Linux, a place where the nerds, tech enthusiasts, and code wizards run wild! Linux is like an amusement park for computer geeks, offering a rollercoaster of open-source adventures and thrilling command-line rides.

Picture yourself strapping into the Terminal Express, a command-line coaster that takes you on a journey through the file system's twists and turns. Hold on tight as you ls your way through directories, discovering hidden files like buried treasures waiting to be found!

A. File and Directory Management Linux Commands:

  1. ssh - Secure Shell, used for secure remote access to a system.
  2. ls - List directory contents.
    A. ls - a, (--all) : do not ignore entries starting with .
    B. ls -A, (--almost -all) : don’t list implied . and ..
    C. ls --l : with -a, print the author of each file

  3. pwd - Print the current working directory.

  4. cd - Change directory to a different folder.

  5. touch - Create an empty file or update the modified timestamp of an existing file.

  6. echo - Print a message or the value of a variable.

  7. nano- A simple text editor.

  8. vim - A more advanced text editor with many features.
    A. press “I” to Insert anything
    B. press Esc key then :wq to save and exit the changes you’ve made.

  9. cat - Print the contents of a file to the console.

  10. shred - Securely delete a file by overwriting its contents(encrypts the data)

  11. mkdir - Create a new directory.

  12. cp - Copy a file from one location to another.

  13. mv - Move a file from one location to another, or rename a file.

  14. rm - Remove a file.

  15. rmdir - Remove a directory if it is empty.

  16. ln - Create a link to a file or directory.

B. System Management Commands:

  1. clear - Clear the console.
  2. useradd - Add a new user to the system.
  3. sudo - Run a command with administrative privileges.
  4. adduser - Add a new user to the system with more options than useradd.
  5. su - Switch to another user account.
  6. exit - Close the current terminal or log out of the current user account.
  7. sudo passwd - Change the password for the current user.
  8. sudo passwd [username] - Change the password for another user.
  9. sudo apt - A package manager used to install, update and remove software packages on Debian-based systems.
  10. sudo apt update & install - Update package lists and install packages.
  11. finger - Display information about a user.
  12. man - Display the manual page of a command.
  13. whatis - Display a brief description of a command.
  14. which - Locate a command and display its path.
  15. whereis - Locate the binary, source, and manual page files for a command.
  16. wget - Download files from the web.
  17. curl - Transfer data to or from a server.
  18. zip - Compress files into a zip archive.
  19. unzip - Extract files from a zip archive.
  20. less - View a file one page at a time.

C. File Comparison and Manipulation Commands:

  1. head - Display the first lines of a file.
  2. tail - Display the last lines of a file.
  3. cmp - Compare two files byte by byte.
  4. diff - Display the differences between two files.
  5. sort - Sort the lines of a file.
  6. find - Search for files in a directory hierarchy.
  7. chmod - Change the permissions of a file or directory.
  8. chown - Change the owner of a file or directory.

D. Networking Management & Monitoring Commands:

  1. ifconfig - Configure network interfaces.
  2. ip address - Display IP address information.
  3. ip address | grep eth0 - Display the IP address of the eth0 interface.
  4. ip address | grep eth0 | grep inet | awk - Display the IP address of the eth0 interface using awk.
  5. resolvectl status - Display the current DNS resolver configuration.
  6. ping - Test network connectivity by sending packets to a host.
  7. netstat - Display network connections, routing tables, and interface statistics.
  8. -tulpn - Display active listening ports and associated programs.
  9. ss - Display socket statistics.
  10. iptables - Configure and administer the netfilter firewall.
  11. ufw - A user-friendly interface to manage iptables firewall rules.

E. System Information & Process Management Commands:

  1. uname - Print system information, including kernel name, network node hostname, kernel release, and kernel version.
  2. neofetch - Display system information in a colorful and visually appealing way. (you’ve to install neofetch with sudo apt install neofetch first)
  3. cal - Display a calendar of the current month or year.
  4. free - Display the amount of free and used system memory.
  5. df and df-H - Display disk usage statistics for a file system.
  6. ps - Report a snapshot of current processes.
  7. top - Display dynamic real-time information about running processes.
  8. kill - Send a signal to terminate a process.
  9. pkill - Send a signal to terminate one or more processes based on their name.
  10. systemctl - Control the systemd system and service manager.
  11. history - Display previously executed commands.
  12. sudo reboot - Reboot the system with administrative privileges.
  13. shutdown - Shutdown or reboot the system.

Top comments (1)

hira_zaira profile image

"Linux: Where Geeks Roam Free!"

Couldn't agree more :D And if you sudo, then BANG!!🔥