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 ๐
Navigation ๐
# 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
Search ๐
# Find files
find / -name "*.txt" 2>/dev/null
# Search in files
grep -r "pattern" /path/
# Locate files (requires updatedb)
locate filename