Why you should learn the linux terminal and file system

Peter GariPeter Gari
3 min read

The Linux terminal and file system are powerful tools that can really enhance your computing experience. While graphical interfaces are user-friendly, mastering the command line offers unparalleled control and efficiency.

The Linux terminal has a rich history, evolving from early Unix systems. Today, a significant percentage of servers worldwide run on Linux, primarily because of its stability and flexibility. Servers, by definition, handle backend infrastructure and often lack graphical interfaces, making the terminal essential for managing them.

Learning the Linux terminal allows you to perform tasks more efficiently. You can navigate directories, manage files, and automate processes with simple commands. This skill is invaluable for system administrators, developers, and anyone interested in IT.

The Linux file system is another area where the terminal shines. Understanding its structure and commands can help you organize and manipulate files with precision. Whether you're moving files, changing permissions, or searching for specific data, the terminal provides robust tools to get the job done.

If you're still not convinced, consider the cool factor. Working in the terminal has a certain allure—it’s sleek, professional, and you can make it look like a scene from the matrix.

this is just be checking the information about the PCI buses and devices in the system, but it makes you feel like Neo, no?.

For security-minded individuals, the terminal is a treasure trove of powerful networking commands.

Here are some networking commands I use sometimes;

  1. Check IP Address:

    • ip addr or ip a: Displays IP addresses and network interfaces.

    • ifconfig: Shows network interface configurations (deprecated but still widely used).

  2. Network Scanning:

    • nmap <target>: Scans a target IP or network for open ports and services.
      Example: nmap 192.168.1.1

    • netdiscover: Scans the local network for devices (ARP-based).

      Running netdiscover

  3. Monitor Network Connections:

    • netstat -tuln: Lists all listening ports (TCP/UDP).

    • ss -tuln: A modern alternative to netstat for checking open ports.

    • lsof -i: Lists open files (including network connections).

  4. Packet Analysis:

    • tcpdump: Captures and analyzes network traffic.
      Example: tcpdump -i eth0 (captures traffic on eth0).

    • wireshark: Graphical tool for deep packet analysis (launched from terminal).

  5. DNS and Network Diagnostics:

    • dig <domain>: Queries DNS information for a domain.
      Example: dig example.com

    • nslookup <domain>: Looks up DNS records for a domain.

    • ping <host>: Checks connectivity to a host.
      Example: ping google.com

    • traceroute <host>: Traces the path packets take to reach a host.

  6. Firewall and Security:

    • ufw status: Checks the status of the Uncomplicated Firewall (UFW).

    • iptables -L: Lists firewall rules (for advanced users).

    • fail2ban-client status: Monitors login attempts and bans suspicious IPs.

  7. Network Configuration:

    • nmcli: Command-line tool for managing NetworkManager.
      Example: nmcli device show (displays network device details).

    • route or ip route: Displays the routing table.

  8. Secure Remote Access:

    • ssh <user>@<host>: Connects to a remote server securely.
      Example: ssh user@192.168.1.100

    • scp <file> <user>@<host>:<path>: Securely copies files over SSH.
      Example: scp file.txt user@192.168.1.100:/home/user/

  9. Network Traffic Control:

    • iftop: Monitors real-time network bandwidth usage.

    • bmon: Displays network traffic in a visual format.

  10. ARP and MAC Addresses:

    • arp -a: Displays the ARP table (IP to MAC address mappings).

    • macchanger -r <interface>: Randomizes the MAC address of a network interface (useful for privacy).

I was gonna attach a screenshot of each command running on my terminal but I realized that some of that information might be too sensitive so…try it yourself.

Learning the Linux terminal and file system is a worthwhile investment. It enhances your technical skills, improves efficiency, and opens up new opportunities. Start exploring the terminal today, and you'll soon appreciate its power and versatility.

0
Subscribe to my newsletter

Read articles from Peter Gari directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Peter Gari
Peter Gari