It mostly involves either software that come pre-installed with most Linux distros or is available from the usual repos.
rename 'y/A-Z/a-z/' *Capture strings in filenames and reuse them:
rename -n -e 's/(\d+)randomcrap(\d+)/$1randomcrap$2/' *Remember to \escape symbols like ., # or !. To preview the result without renaming, add -n directly after rename.
Remove preceding zeroes from filenames:
rename 's/^0*//' *Take all first lines from every .txt file in the working directory and put those lines in newfile.txt:
read -n1 *.txt > newfile.txtReplace every occurence of the string 'foo' with the filename of the file it occurs in:
for f in *.txtRemove any line in file.txt that does not contain the string 'foo':
do
file="$f"
id=$(basename "$file")
namex="${name%.*}_"
sed -i -e "s/foo/$namex/g" $name
done
sed -n '/foo/p' file.txt > newfile.txt
ffmpeg -i in.* -acodec libvorbis -vn -q:a 5 out.oggConvert file to mp4 video, quality level 19:
ffmpeg -i in.* -c:v libx264 -crf 19 -strict experimental out.mp4Change volume in video to audible levels:
ffmpeg -i in.* -vcodec copy -af "volume=100dB" out.*Remove 10 seconds from start of file, output as ogg audio, compression level 5:
ffmpeg -i in.* -acodec libvorbis -ss 00:00:10 -vn -q:a 5 out.oggConvert video for Web use (webm):
ffmpeg -i in.* -vf scale=640:ih*640/iw -vcodec libvpx -b:v 0.4M -acodec libvorbis -qscale:a 5 out.webmConvert video for Web use if original video height is an uneven number of pixels:
ffmpeg -i in.* -vf scale=640:1+ih*640/iw -vcodec libvpx -b:v 0.4M -acodec libvorbis -qscale:a 5 out.webmTurn series of images into MP4 video (0001.tif, 0002.tif...)
ffmpeg -r 60 -f image2 -s 1004x1024 -i %04d.tiff -vcodec libx264 -crf 25 -pix_fmt yuv420p out.mp4Reduce gamma of video:
ffmpeg -i in.* "eq=gamma=0.7" out.*
mkvmerge -i input.mkvThen extract the track:
mkvextract tracks input.mkv [trackID]:[output].srtExample, if subtitles are in track 2:
mkvextract tracks movie.mkv 2:movie-subs.srt
for f in *.mkv; do mkvpropedit -d title "$f"; done
shnsplit -f yourfile.cue -t %n-%t -o flac yourfile.flac
cat VIDEO_TS/VTS_01_[1234].VOB > vid.vob
deja-dup --restore FILE1 FILE2Generate full list of all files in the current backup, write to file 'bakfiles':
duplicity list-current-files file:///path/to/backup/folder > bakfiles
lowriter --convert-to pdf *.docCompress images in PDF files and output a new PDF file. This particular command compresses embedded images to 'ebook' levels; decent but not beautiful.
gs -sDEVICE=pdfwrite -dNOPAUSE -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dBATCH -sOutputFile=out.pdf in.pdfThe controls aren't terribly fine-grained, but it's good enough for most purposes. Other options for the -DPDFSETTINGS flag are /screen (shit), /printer (a bit better than ebook), /prepress (nice) and /default (the best).
List all installed fonts:
fc-list