Integration Galaxy LogoIntegration Galaxy
HomeBlog

About

Seamlessly integrating the universe of technology—one connection at a time.

Quick Links

  • About
  • Contact

Planets

  • Integration
  • DevOps
  • API
  • Cloud Computing
  • Programming

© 2026 Integration Galaxy. All rights reserved.

DevOpsLinuxProgramming

Advanced Linux Commands Cheat Sheet

Integration Galaxy
February 8, 2025
3 min read
Advanced Linux commands cheat sheet

Share this post

Linux is a robust and flexible operating system. Mastering advanced commands can greatly enhance system administration, security, and performance optimization. This cheat sheet provides an in-depth guide to advanced Linux commands for power users.

Linux Commands Cheat Sheet for Beginners

1. Advanced File Management

  • find /path -type f -name "*.log" → Find all .log files in a directory
  • find /path -mtime -5 → Find files modified in the last 5 days
  • locate filename → Find a file using a prebuilt index
  • rsync -av source/ destination/ → Synchronize files between directories or remote systems
  • tar -czvf archive.tar.gz /path → Create a compressed archive
  • tar -xzvf archive.tar.gz → Extract a compressed archive

2. Advanced User Management

  • sudo visudo → Edit sudoers file securely
  • usermod -aG groupname username → Add a user to a group
  • chage -l username → View password aging information
  • passwd -l username → Lock a user account
  • who -a → Display detailed user login information

3. Process Management & Monitoring

  • strace -p PID → Trace system calls of a process
  • lsof -i :8080 → Find processes using port 8080
  • nice -n 10 command → Run a process with adjusted priority
  • renice -n 5 -p PID → Change priority of an existing process
  • pkill -u username → Kill all processes for a user
  • nohup command & → Run a command immune to hang-ups

4. Networking & Performance Tuning

  • ss -tulnp → Show listening ports and processes
  • ip route show → Display current routing table
  • nmap -A target-ip → Scan an IP for open ports and services
  • ethtool eth0 → Get Ethernet device settings
  • iperf -s → Run a bandwidth performance server
  • iperf -c server-ip → Test network speed to a server
  • netstat -s → Display network statistics

5. Security & Encryption

  • gpg -c file → Encrypt a file with GPG
  • gpg -d file.gpg → Decrypt a file
  • openssl rand -base64 32 → Generate a random key
  • firewalld --list-all → Show active firewall rules
  • iptables -L -v -n → Display iptables firewall rules
  • auditctl -w /etc/passwd -p wa → Monitor changes to /etc/passwd

6. Disk & Filesystem Management

  • fdisk -l → Show all partitions
  • mkfs.ext4 /dev/sdb1 → Format a partition with ext4
  • fsck /dev/sdb1 → Check and repair a filesystem
  • tune2fs -l /dev/sda1 → Show filesystem parameters
  • xfs_repair /dev/sdb1 → Repair an XFS filesystem
  • iostat -xz 1 5 → Monitor CPU and disk usage

7. System Performance & Logs

  • dstat -tcmndryl → Display CPU, memory, and network usage
  • vmstat 1 5 → Show memory and swap statistics
  • iotop → Show disk I/O usage by processes
  • journalctl -n 50 -u service → View logs for a specific service
  • dmesg | tail -20 → View last 20 kernel messages
  • sar -u 5 10 → CPU usage over time

8. Containers & Virtualization

  • docker ps -a → List all Docker containers
  • docker images → List all Docker images
  • docker exec -it container_id bash → Access a running container
  • virt-install --name VM --ram 2048 --vcpus 2 --disk size=20 --os-type linux → Create a new virtual machine
  • virsh list --all → Show all virtual machines

9. Automating Tasks with Scripting

  • echo "Hello World" > script.sh && chmod +x script.sh && ./script.sh → Create and run a script
  • for file in *.txt; do mv "$file" "${file%.txt}.bak"; done → Batch rename files
  • while true; do echo "Running..."; sleep 5; done → Loop execution every 5 seconds

10. Miscellaneous Advanced Commands

  • watch -n 2 df -h → Continuously monitor disk space usage
  • time command → Measure execution time of a command
  • timeout 30 command → Run a command for a limited time
  • alias ll='ls -lh' → Create a shortcut for a command
  • sed -i 's/oldtext/newtext/g' filename → Find and replace text in a file
  • awk '{print $1, $3}' file.txt → Process text files with awk

Conclusion

This advanced Linux cheat sheet provides powerful commands for system administration, networking, security, and performance monitoring. Continue practicing these commands to improve your Linux skills.

Let us know if you need a specialized cheat sheet (e.g., DevOps, Security, or Containers)!

0% complete
0 claps
← Back to all posts