Expand Linux command library
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
# Command picker using fzf
|
# Command picker using fzf
|
||||||
commands() {
|
commands() {
|
||||||
local cmd
|
local selection cmd
|
||||||
cmd=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' ~/.config/commands/linux.txt |
|
|
||||||
|
selection=$(grep -vE '^[[:space:]]*#|^[[:space:]]*$' ~/.config/commands/linux.txt |
|
||||||
fzf --height 50% --layout=reverse --border --prompt='Command: ')
|
fzf --height 50% --layout=reverse --border --prompt='Command: ')
|
||||||
|
|
||||||
if [[ -n "$cmd" ]]; then
|
if [[ -n "$selection" ]]; then
|
||||||
|
cmd=$(printf '%s\n' "$selection" | sed 's/[[:space:]]*#.*$//')
|
||||||
|
cmd="${cmd%"${cmd##*[![:space:]]}"}"
|
||||||
|
|
||||||
READLINE_LINE="$cmd"
|
READLINE_LINE="$cmd"
|
||||||
READLINE_POINT=${#READLINE_LINE}
|
READLINE_POINT=${#READLINE_LINE}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,27 +1,136 @@
|
|||||||
# ===== Proxmox =====
|
# SYSTEM
|
||||||
pveversion -v
|
|
||||||
qm list
|
|
||||||
pct list
|
|
||||||
pvesm status
|
|
||||||
|
|
||||||
# ===== Docker =====
|
hostname # Show hostname
|
||||||
docker ps
|
hostnamectl # Show system hostname and OS information
|
||||||
docker compose ps
|
uptime # Show system uptime and load
|
||||||
docker compose logs -f
|
uname -a # Show kernel information
|
||||||
docker stats
|
cat /etc/os-release # Show Linux distribution information
|
||||||
|
whoami # Show current username
|
||||||
|
id # Show current user and group IDs
|
||||||
|
date # Show current date and time
|
||||||
|
timedatectl # Show system time and timezone
|
||||||
|
free -h # Show memory usage
|
||||||
|
nproc # Show number of CPU cores
|
||||||
|
lscpu # Show CPU information
|
||||||
|
|
||||||
# ===== Disk =====
|
# STORAGE
|
||||||
lsblk -f
|
|
||||||
df -h
|
|
||||||
du -sh *
|
|
||||||
sudo smartctl -a /dev/sda
|
|
||||||
|
|
||||||
# ===== Network =====
|
df -h # Show filesystem disk usage
|
||||||
ip addr
|
df -hT # Show filesystem usage and filesystem types
|
||||||
ip route
|
du -sh * # Show sizes of items in current directory
|
||||||
ss -tulpn
|
lsblk # List block devices
|
||||||
|
lsblk -f # List block devices with filesystem information
|
||||||
|
blkid # Show block device UUIDs and filesystem types
|
||||||
|
findmnt # Show mounted filesystems
|
||||||
|
mount # Show mounted filesystems
|
||||||
|
sudo fdisk -l # List disk partitions
|
||||||
|
|
||||||
# ===== Files =====
|
# NETWORK
|
||||||
ls -lah
|
|
||||||
find . -maxdepth 2 -type f
|
ip addr # Show network interfaces and IP addresses
|
||||||
rsync -avh --progress SOURCE/ DEST/
|
ip -br addr # Show concise network interface information
|
||||||
|
ip route # Show routing table
|
||||||
|
ip -br link # Show concise link status
|
||||||
|
ss -tulpn # Show listening TCP and UDP ports
|
||||||
|
ss -tunap # Show active network connections
|
||||||
|
ping -c 4 8.8.8.8 # Test network connectivity
|
||||||
|
curl -I https://example.com # Show HTTP response headers
|
||||||
|
dig example.com # Query DNS
|
||||||
|
resolvectl status # Show DNS resolver status
|
||||||
|
hostname -I # Show local IP addresses
|
||||||
|
|
||||||
|
# SYSTEMD
|
||||||
|
|
||||||
|
systemctl --failed # Show failed systemd units
|
||||||
|
systemctl list-units --type=service --state=running # Show running services
|
||||||
|
systemctl list-units --type=service --state=failed # Show failed services
|
||||||
|
systemctl status docker # Show Docker service status
|
||||||
|
journalctl -xe # Show recent system journal errors
|
||||||
|
journalctl -b # Show logs from current boot
|
||||||
|
journalctl -p err -b # Show errors from current boot
|
||||||
|
journalctl --disk-usage # Show journal disk usage
|
||||||
|
|
||||||
|
# PROCESSES
|
||||||
|
|
||||||
|
ps aux # Show all running processes
|
||||||
|
ps aux --sort=-%cpu | head # Show top CPU-consuming processes
|
||||||
|
ps aux --sort=-%mem | head # Show top memory-consuming processes
|
||||||
|
top # Interactive process monitor
|
||||||
|
htop # Interactive process monitor
|
||||||
|
pgrep -a process-name # Find processes by name
|
||||||
|
lsof -i # Show network connections by process
|
||||||
|
|
||||||
|
# PACKAGES
|
||||||
|
|
||||||
|
apt list --upgradable # Show available package updates
|
||||||
|
apt policy package-name # Show package version information
|
||||||
|
dpkg -l # List installed packages
|
||||||
|
dpkg -l | grep package-name # Search installed packages
|
||||||
|
apt-cache search package-name # Search available packages
|
||||||
|
|
||||||
|
# FILES
|
||||||
|
|
||||||
|
ls -lah # List files with details
|
||||||
|
pwd # Show current directory
|
||||||
|
find . -maxdepth 1 -type f # Find files in current directory
|
||||||
|
find . -type f -name "*.log" # Find log files recursively
|
||||||
|
du -sh ./* # Show sizes of items in current directory
|
||||||
|
stat filename # Show file metadata
|
||||||
|
file filename # Identify file type
|
||||||
|
namei -l /path/to/file # Show path permissions
|
||||||
|
|
||||||
|
# USERS
|
||||||
|
|
||||||
|
who # Show logged-in users
|
||||||
|
w # Show logged-in users and activity
|
||||||
|
last # Show recent logins
|
||||||
|
getent passwd # List local and directory users
|
||||||
|
getent group # List groups
|
||||||
|
groups # Show current user's groups
|
||||||
|
sudo -l # Show current user's sudo privileges
|
||||||
|
|
||||||
|
# DOCKER
|
||||||
|
|
||||||
|
docker ps # List running containers
|
||||||
|
docker ps -a # List all containers
|
||||||
|
docker images # List Docker images
|
||||||
|
docker volume ls # List Docker volumes
|
||||||
|
docker network ls # List Docker networks
|
||||||
|
docker stats # Show container resource usage
|
||||||
|
docker system df # Show Docker disk usage
|
||||||
|
docker compose ps # Show Compose container status
|
||||||
|
docker compose images # Show Compose images
|
||||||
|
docker compose logs -f # Follow Compose logs
|
||||||
|
|
||||||
|
# GIT
|
||||||
|
|
||||||
|
git status # Show repository status
|
||||||
|
git log --oneline -10 # Show last 10 commits
|
||||||
|
git log --oneline --decorate -10 # Show recent commits with branch information
|
||||||
|
git branch # Show local branches
|
||||||
|
git branch -a # Show all branches
|
||||||
|
git remote -v # Show Git remote URLs
|
||||||
|
git diff # Show uncommitted changes
|
||||||
|
|
||||||
|
# HARDWARE
|
||||||
|
|
||||||
|
lspci # List PCI devices
|
||||||
|
lsusb # List USB devices
|
||||||
|
lsmem # Show memory information
|
||||||
|
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS # Show detailed storage layout
|
||||||
|
sudo dmidecode -t system # Show system hardware information
|
||||||
|
|
||||||
|
# SSH
|
||||||
|
|
||||||
|
sshd -T # Show effective SSH server configuration
|
||||||
|
ssh -v localhost # Test SSH connection with verbose output
|
||||||
|
lastlog # Show last login for users
|
||||||
|
|
||||||
|
# DISK / FILESYSTEM DIAGNOSTICS
|
||||||
|
|
||||||
|
sudo dmesg -T | tail -50 # Show recent kernel messages
|
||||||
|
sudo dmesg -T | grep -i error # Search kernel messages for errors
|
||||||
|
sudo journalctl -k -b # Show kernel logs from current boot
|
||||||
|
sudo smartctl --scan # Detect available SMART devices
|
||||||
|
sudo smartctl -H /dev/sdX # Show SMART health status
|
||||||
|
sudo smartctl -a /dev/sdX # Show complete SMART information
|
||||||
|
|||||||
Reference in New Issue
Block a user