NavigationFile ManagementViewing FilesSearchingPermissionsProcessesDisk/MemoryNetworkCompressionRedirection/PipesText ProcessingSystem
#File Management
| Command | Description | |
|---|---|---|
ls | List files | |
ls -la | List all with details | |
ls -lh | Human readable sizes | |
touch [file] | Create empty file | |
cp [src] [dest] | Copy file | |
cp -r [src] [dest] | Copy directory | |
mv [src] [dest] | Move/rename | |
rm [file] | Remove file | |
rm -rf [dir] | Force remove directory | |
mkdir [dir] | Create directory | |
mkdir -p [path] | Create with parents | |
rmdir [dir] | Remove empty directory | |
ln -s [target] [link] | Create symbolic link |
#Viewing Files
| Command | Description | |
|---|---|---|
cat [file] | Print file content | |
less [file] | View with pagination | |
head [file] | Show first 10 lines | |
head -n 20 [file] | Show first 20 lines | |
tail [file] | Show last 10 lines | |
tail -f [file] | Follow file in real-time | |
wc [file] | Count lines/words/bytes | |
wc -l [file] | Count lines only |
#Searching
| Command | Description | |
|---|---|---|
find [path] -name [pattern] | Find by name | |
find . -type f | Find files only | |
find . -type d | Find directories only | |
find . -mtime -7 | Modified in last 7 days | |
grep [pattern] [file] | Search pattern | |
grep -r [pattern] [dir] | Recursive search | |
grep -i [pattern] | Case insensitive | |
grep -n [pattern] | Show line numbers | |
grep -v [pattern] | Invert match | |
which [cmd] | Find command path | |
whereis [cmd] | Find binary/source/manual |
#Permissions
| Command | Description | |
|---|---|---|
chmod 755 [file] | Change mode (numeric) | |
chmod +x [file] | Add execute permission | |
chmod -w [file] | Remove write permission | |
chmod u+x [file] | Add execute for owner | |
chown [user] [file] | Change owner | |
chown user:group [file] | Change owner and group | |
chgrp [group] [file] | Change group |
#Processes
| Command | Description | |
|---|---|---|
ps | Current processes | |
ps aux | All processes detailed | |
ps aux | grep [name] | Search processes | |
top | Real-time process monitor | |
htop | Enhanced process monitor | |
kill [pid] | Kill process | |
kill -9 [pid] | Force kill | |
killall [name] | Kill by name | |
bg | Send to background | |
fg | Bring to foreground | |
jobs | List background jobs | |
nohup [cmd] & | Run after logout |
#Disk/Memory
| Command | Description | |
|---|---|---|
df -h | Disk usage | |
du -sh [dir] | Directory size | |
du -h --max-depth=1 | Sizes at depth 1 | |
free -h | Memory usage | |
mount [dev] [dir] | Mount device | |
umount [dir] | Unmount |
#Network
| Command | Description | |
|---|---|---|
ping [host] | Check host connection | |
curl [url] | Request URL | |
curl -O [url] | Download file | |
wget [url] | Download file | |
ssh user@host | SSH connection | |
scp [file] user@host:[path] | Remote file copy | |
netstat -tulpn | Show open ports | |
ss -tulpn | Socket statistics | |
ifconfig | Network interfaces | |
ip addr | Show IP addresses |
#Compression
| Command | Description | |
|---|---|---|
tar -cvf arch.tar [files] | Create tar archive | |
tar -xvf arch.tar | Extract tar archive | |
tar -czvf arch.tar.gz [files] | Create gzip archive | |
tar -xzvf arch.tar.gz | Extract gzip archive | |
zip arch.zip [files] | Create zip archive | |
unzip arch.zip | Extract zip archive | |
gzip [file] | Gzip compress | |
gunzip [file.gz] | Gzip decompress |
#Redirection/Pipes
| Command | Description | |
|---|---|---|
cmd > file | Redirect output (overwrite) | |
cmd >> file | Redirect output (append) | |
cmd < file | Redirect input from file | |
cmd 2> file | Redirect stderr | |
cmd &> file | Redirect stdout and stderr | |
cmd1 | cmd2 | Pipe output | |
cmd | tee file | Output and save to file | |
cmd | xargs [cmd2] | Pass as arguments |
#Text Processing
| Command | Description | |
|---|---|---|
sort [file] | Sort lines | |
sort -r [file] | Reverse sort | |
sort -n [file] | Numeric sort | |
uniq [file] | Remove duplicates | |
cut -d: -f1 [file] | Extract field | |
awk '{print $1}' [file] | Print first column | |
sed 's/old/new/g' [file] | Replace string | |
tr 'a-z' 'A-Z' | Translate characters |
#System
| Command | Description | |
|---|---|---|
uname -a | System information | |
hostname | Hostname | |
uptime | Uptime | |
whoami | Current user | |
id | User ID info | |
date | Current date/time | |
cal | Calendar | |
history | Command history | |
sudo [cmd] | Run as root | |
su - [user] | Switch user | |
shutdown -h now | Shutdown now | |
reboot | Reboot |
이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.