Linux#
Files and Directories#
Command |
Action |
|---|---|
|
detailed list with sizes |
|
sorted by mtime, oldest first |
|
previous directory |
|
print working directory |
|
archive copy (preserves metadata, links) |
|
move / rename |
|
recursive delete |
|
create with parents |
|
symbolic link |
|
metadata |
|
resolve symlinks |
|
search by name |
|
modified in last 7 days |
|
larger than 100 MB |
|
|
|
|
|
show tree (depth 2) |
Disk Usage#
Command |
Action |
|---|---|
|
free space per filesystem |
|
total size of dir |
|
sizes of immediate children |
|
interactive du |
|
block devices |
|
show mounts |
|
tree view of mounts |
Processes#
Command |
Action |
|---|---|
|
all processes |
|
System V style |
|
top memory |
|
interactive |
|
prettier interactive |
|
find by name |
|
|
|
kill by pattern |
|
SIGKILL |
|
background, survives logout |
|
detach job from shell |
|
list shell jobs |
Permissions and Users#
Command |
Action |
|---|---|
|
current user / groups |
|
|
|
|
|
set numeric mode |
|
add execute for owner |
|
change ownership |
|
interactive root shell |
|
run as user |
|
change password |
|
user record |
|
group record |
|
add to group |
Text Processing#
Command |
Action |
|---|---|
|
|
|
recursive grep |
|
ripgrep (faster) |
|
|
|
substitute |
|
in place (GNU) |
|
column 2 |
|
|
|
field 1 of colon-separated |
|
frequency counts |
|
remove CR |
|
line count |
|
tabularize |
|
JSON |
|
YAML |
Compression and Archives#
Command |
Action |
|---|---|
|
gzip archive |
|
xz archive |
|
extract gzip |
|
list contents |
|
|
|
|
|
|
|
Packages#
Debian / Ubuntu (apt):
Command |
Action |
|---|---|
|
update and upgrade |
|
install |
|
remove |
|
search |
|
info |
|
installed packages |
|
files in package |
|
owner of file |
Fedora / RHEL (dnf):
Command |
Action |
|---|---|
|
|
|
|
|
|
|
|
|
Arch (pacman):
Command |
Action |
|---|---|
|
sync + upgrade |
|
install |
|
remove with deps |
|
|
|
|
|
Alpine (apk):
Command |
Action |
|---|---|
|
|
|
|
|
|
|
systemd#
Command |
Action |
|---|---|
|
service status |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
follow logs |
|
|
|
priority error |
Inspecting#
Command |
Action |
|---|---|
|
kernel info |
|
hostname / OS / kernel |
|
distro |
|
CPU details |
|
memory |
|
CPU / memory / IO |
|
disk IO (sysstat) |
|
who has port open |
|
listening sockets |
|
interfaces |
|
routes |
|
kernel messages |