Skip to main content

Command Palette

Search for a command to run...

Day 3: Basic Linux commands (Part-2)

DevOps Learning

Updated
2 min readView as Markdown
Day 3: Basic Linux commands (Part-2)

Recap. 🙃

In Day-2 of learning DevOps, we covered what Linux is and some of its fundamental commands . Let's continue by learning more about these commands.

Basic commands in Linux.

  1. diff: Find differences between files. Example: diff file1.txt file2.txt compares two files.

  2. cmp: Check if files are identical. Example: cmp file1.txt file2.txt compares byte by byte.

  3. comm: Combine diff and cmp. Example: comm file1.txt file2.txt shows common lines.

  4. sort: Sort file content. Example: sort file.txt arranges lines alphabetically.

  5. export: Set environment variables. Example: export MY_VAR=value sets an environment variable.

  6. zip: Zip files. Example: ziparchive.zipfiles/ creates a zip archive.

  7. unzip: Unzip files. Example: unziparchive.zip extracts files from a zip archive.

  8. ssh: Secure Shell. Example: ssh user@hostname connects to a remote server.

  9. service: Start and stop services. Example: service apache2 start manages services.

  10. ps: Display active processes. Example: ps aux lists all processes.

  11. kill and killall: Terminate processes. Example: kill -9 PID forcefully stops a process by its process ID.

  12. df: Display disk info. Example: df -h shows disk space usage.

  13. mount: Mount file systems. Example: mount /dev/sdb1 /mnt mounts a partition to a directory.

  14. chmod: Change file permissions. Example: chmod +xscript.sh makes a script executable.

  15. chown: Grant ownership. Example: chown user:group file.txt changes file ownership.

  16. ifconfig: Display network interfaces and IP addresses. Example: ifconfig eth0 shows network details.

  17. traceroute: Trace network hops. Example: traceroutegoogle.com traces the route to Google’s server.

  18. wget: Download files from the internet. Example: wgethttps://example.com/file.zip downloads a file.

  19. ufw: Firewall management. Example: ufw allow 80/tcp allows incoming HTTP traffic.

  20. iptables: Base firewall. Example: iptables -A INPUT -p tcp --dport 22 -j ACCEPT allows SSH traffic.

Watch these videos to learn more Linux commands. 🐧

Thank you for reading😉.