Linux/Unix

2025.12.13

File Operations

CommandDescription
lsList files
ls -laDetailed list (including hidden files)
cd <dir>Change directory
pwdPrint working directory
mkdir <dir>Create directory
mkdir -p <path>Create parent directories too
rm <file>Remove file
rm -r <dir>Remove directory recursively
cp <src> <dest>Copy file
cp -r <src> <dest>Copy directory
mv <src> <dest>Move/rename file
touch <file>Create empty file
cat <file>Display file contents
less <file>View file with pagination
head <file>Show first 10 lines
tail <file>Show last 10 lines
tail -f <file>Follow file in real-time
CommandDescription
find . -name "*.txt"Find files by name
find . -type fFind files only
find . -type dFind directories only
grep "pattern" <file>Search for pattern
grep -r "pattern" .Search recursively
grep -i "pattern" <file>Case-insensitive search

Process Management

CommandDescription
psList processes
ps auxList all processes in detail
topReal-time process viewer
htopEnhanced top
kill <pid>Terminate process
kill -9 <pid>Force terminate
killall <name>Kill processes by name

Permissions

CommandDescription
chmod 755 <file>Change permissions
chmod +x <file>Add execute permission
chown user:group <file>Change owner
sudo <command>Run as administrator

Network

CommandDescription
ping <host>Check connectivity
curl <url>HTTP request
wget <url>Download file
ss -tulnShow open ports
ip addrShow IP addresses
← Back to list