Skip to content

Instantly share code, notes, and snippets.

@CrispyPin
Created February 17, 2022 22:18
Show Gist options
  • Save CrispyPin/c538db634dd0c2106b3a8b371a425410 to your computer and use it in GitHub Desktop.
Save CrispyPin/c538db634dd0c2106b3a8b371a425410 to your computer and use it in GitHub Desktop.
cli cheat sheet

cli cheat sheet

ffmpeg

pixel format, fixes thumbnail and works on android:
ffmpeg -i a.mp4 -pix_fmt yuv420p b.mp4
loop:
ffmpeg -stream_loop 42 -i a.mp4 b.mp4
scale:
ffmpeg -i a.mp4 -vf scale=-1:480 b.mp4
trim:
ffmpeg -i a.mp4 -ss 0:03 -to 0:14 b.mp4
don't re-encode:
... -c copy b.mp4
from image sequence:
ffmpeg -framerate 30 -start_number 1 -i a/image%03d.png -vframes 123 b.mp4

grep

grep -rnHIFi "words"
r: recursive
n: line number
H: filename
I: ignore binaries
F: fixed string instead of regex
i: ignore case

ls

ls -hAgo
h: human readable sizes
A: hidden files except . and ..
g: hide owner (otherwise like l)
o: hide group (equiv to G)

R: recursive
t: sort by newest first

tar

compress: tar -caf foo.tar.xz bar.txt
extract : tar -xaf foo.tar.xz
c: create archive
x: extract archive
a: auto detect compression type from filename
f: select file(s)

pacman / yay

list explicit packages (not dependencies):
pacman -Qqe
sync repos:
pacman -Syy
update:
pacman -Syu
remove package and dependencies:
pacman -Rs electron
install packages without reinstalling anything:
pacman -S --needed a b c d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment