Linux Guide

Welcome to My Linux Cheatsheet

This is a quick reference for common Linux commands and configurations β€” organized into categories. Use the menu above to switch between topics.

πŸ“§ Contact information

Name: Ivan Lazic

Email: code@mycipher.net

Address: 11407 Selevac, Serbia

πŸ“‚ File Management

Basic Commands
ls -l          # List files in long format
cp a b         # Copy a to b
mv a dir/      # Move or rename file
rm file        # Delete file
mkdir folder   # Create directory
rmdir folder   # Remove directory
        
Permissions
chmod 755 file        # rwxr-xr-x
chown user:group file # Change owner
umask 022             # Default permission mask
        
Compression
tar -czf archive.tar.gz folder/   # Create tar.gz
tar -xzf archive.tar.gz           # Extract tar.gz
zip -r archive.zip folder/        # Create zip
unzip archive.zip                 # Extract zip
        
Disk Usage
df -h             # Disk space usage
du -sh folder/    # Folder size
lsblk             # List block devices
mount /dev/sdX /mnt # Mount drive
        

πŸ”‘ User Management

Account Management
adduser name     # Create new user
deluser name     # Delete user
passwd name      # Change password
su - user        # Switch user
whoami           # Show current user
        
Groups
groupadd admins          # Create group
usermod -aG admins ivan  # Add user to group
groups ivan              # Show user groups
        
Permissions & Sudo
visudo        # Edit sudoers
sudo command  # Run with root privileges
id            # Display UID and groups
        
System Info
who          # Who is logged in
w            # Show current users
last         # Last logins
finger user  # Show user info
        

🌐 Network

Interface Management
ifconfig              # Show interfaces (deprecated)
ip a                  # Show IPs
ip link set eth0 up   # Enable interface
dhclient eth0         # Request IP from DHCP
        
Connectivity
ping 8.8.8.8          # Test connectivity
ping -c 4 google.com  # 4 pings only
traceroute host       # Show route
curl ifconfig.me      # Show public IP
        
Diagnostics
netstat -tulnp    # Show listening ports
ss -tuln          # Show open sockets
nslookup host     # DNS lookup
dig host +short   # DNS info
        
Firewall
ufw status          # Show firewall status
ufw allow 22/tcp    # Allow SSH
ufw deny 80/tcp     # Block port 80
iptables -L -v      # Show rules
        
Monitoring
iftop               # Live bandwidth
nload               # Network traffic
tcpdump -i eth0     # Capture packets
        

βš™οΈ System Configuration

System Files
/etc/fstab         # Mount configuration
/etc/hosts         # Hostname mapping
/etc/resolv.conf   # DNS settings
/etc/hostname      # System hostname
        
Service Configs
systemctl start nginx
systemctl enable ssh
systemctl status apache2
journalctl -xe
        
Security
/etc/ssh/sshd_config
/etc/sudoers
/etc/pam.d/
        
Boot Settings
grub-mkconfig -o /boot/grub/grub.cfg
update-initramfs -u