Skip to content

Linux Fundamentals

🔹 Linux Commands for Cybersecurity

1️⃣ File & Directory Management

  • ls – List files in a directory.

  • pwd – Show the current directory.

  • cd – Change directories.

  • cp – Copy files and directories.

  • mv – Move or rename files.

  • rm – Delete files and directories.

  • find – Search for files and directories.

  • locate – Find file locations.

  • touch – Create an empty file.

  • mkdir – Create a directory.

  • rmdir – Remove empty directories.


2️⃣ File Permissions & Ownership

  • chmod – Change file permissions.

  • chown – Change file ownership.

  • chgrp – Change file group ownership.

  • umask – Set default file permissions.


3️⃣ User & Group Management

  • whoami – Show the current logged-in user.

  • id – Show user ID (UID) and group ID (GID).

  • who – Show logged-in users.

  • users – Show all users.

  • adduser – Create a new user.

  • userdel – Delete a user.

  • passwd – Change user password.

  • groupadd – Create a new group.

  • groupdel – Delete a group.

  • usermod – Modify user account properties.

  • groups – Show a user's groups.


4️⃣ Process Management

  • ps – Show running processes.

  • top – Monitor system processes.

  • htop – Interactive process viewer.

  • kill – Terminate a process.

  • pkill – Kill processes by name.

  • nice – Set process priority.

  • renice – Change process priority.

  • jobs – Show background jobs.

  • fg – Bring a background job to the foreground.

  • bg – Resume a background job.


5️⃣ Networking & Security

  • ifconfig – Show or configure network interfaces.

  • ip – Show or manage network settings.

  • netstat – Show active network connections.

  • ss – Show socket statistics.

  • tcpdump – Capture network packets.

  • nmap – Scan networks and ports.

  • ping – Test network connectivity.

  • traceroute – Show network hops.

  • wget – Download files from the web.

  • curl – Transfer data from URLs.

  • iptables – Configure firewall rules.

  • ufw – Manage firewall settings.


6️⃣ Log Monitoring & Analysis

  • journalctl – View system logs.

  • dmesg – View kernel logs.

  • cat /var/log/syslog – View system log file.

  • cat /var/log/auth.log – View authentication logs.

  • grep – Search for specific log entries.

  • tail -f – Monitor logs in real time.


7️⃣ System Security & Hardening

  • sudo – Run commands as root.

  • visudo – Edit the sudoers file.

  • passwd -l – Lock a user account.

  • passwd -u – Unlock a user account.

  • fail2ban – Prevent brute-force attacks.

  • firewalld – Manage firewall rules.

  • chkrootkit – Detect rootkits.

  • rkhunter – Scan for rootkits.

  • auditctl – Enable auditing of system events.

  • semanage – Manage SELinux policies.

  • getenforce – Check SELinux status.

  • setenforce – Change SELinux mode.

  • apparmor_status – Check AppArmor status.


8️⃣ Ethical Hacking & Pentesting

  • metasploit – Penetration testing framework.

  • hydra – Brute-force login credentials.

  • john – Crack hashed passwords.

  • sqlmap – Detect and exploit SQL injection.

  • burpsuite – Web application security testing.

  • aircrack-ng – Wi-Fi penetration testing.

  • wireshark – Analyze network traffic.


Let me know if you want to focus on a specific section! 🚀