A few useful shell one-liners
yulia 10219ee912421f0b · · 中文 · 日本語

A few useful shell one-liners

Snippets I keep looking up anyway, so they may as well live here.

The ten largest items in a directory

du -sh ./* | sort -rh | head -10

Rename extensions in bulk

for f in *.jpeg; do mv "$f" "${f%.jpeg}.jpg"; done

Which process holds a port

lsof -i :8080

Short, but I always forget them.