MinhCyber
๐Ÿงlinux

Linux Commands Cheatsheet

โ€ข2 min read
#linux#commands#terminal#bash

๐Ÿ’ก Tip: Click the copy button on any code block to copy the command to your clipboard.

Linux Commands Cheatsheet ๐Ÿ”—

A quick reference for commonly used Linux commands in security work.

File Operations ๐Ÿ”—

# Change directory
cd /path/to/directory
 
# List files with details
ls -la
 
# Show current directory
pwd

File Manipulation ๐Ÿ”—

# Copy file
cp source.txt destination.txt
 
# Move/rename file
mv oldname.txt newname.txt
 
# Remove file
rm filename.txt
 
# Remove directory recursively
rm -rf directory/

Network Commands ๐Ÿ”—

Information Gathering ๐Ÿ”—

# Show IP addresses
ip addr show
 
# Show routing table
ip route
 
# DNS lookup
nslookup domain.com
dig domain.com

Connections ๐Ÿ”—

# Show active connections
netstat -tulpn
ss -tulpn
 
# Test connectivity
ping -c 4 target.com
 
# Trace route
traceroute target.com

Process Management ๐Ÿ”—

# List processes
ps aux
 
# Find process by name
pgrep -a processname
 
# Kill process
kill -9 PID
 
# Monitor system resources
top
htop

Permissions ๐Ÿ”—

# Change file permissions
chmod 755 script.sh
chmod +x script.sh
 
# Change ownership
chown user:group file.txt
 
# View permissions
ls -l file.txt
# Find files
find / -name "*.txt" 2>/dev/null
 
# Search in files
grep -r "pattern" /path/
 
# Locate files (requires updatedb)
locate filename