zlib-flate -uncompress < input_fil.zlib > output_file
.tar.bz2
$ tar -cvjf file_name.tar.bz2 directory
.tar.xz
$ tar -Jcvf file_name.tar.xz directory/
$ zip -e -r file_dst.zip file_or_directory_src
<enter password>
.tar.bz2
$ tar -xvjf file_name.tar.bz2
.zip
$ gunzip file_name.zip
.rar
$ unrar x file_name.rar
.tar
$ tar -xvf file_name.tar
.tar.gz
$ tar -vzxf file_name.tar.gz
.tar.xz
$ tar -Jxf file_name.tar.xz
.bz2
$ bunzip file_name.bz2
$ find ./* -type f -exec grep -l some_word {} \;
OR (into .cc and .h files)
$ grep --include=\*.{cc,h} -rnw './' -e "some words"
$ find ./ -name file_name -exec rm {} \;
$ tr '\n' ' ' < old_file.txt > new_file.txt
$ cat file_name | grep -Ev '[:blank]*#|^[:blank]*$'
$ cat old_file.txt |grep -v host > ip.txt
$ shred -u file_name
$ diff -u old_file updated_file > file.patch
$ patch old_fle -i file.patch -o new_file
$ patch -p1 < file_name.patch
- edit (create if not exist): /etc/modprobe.d/blacklist.conf
- insert one module for a line to disable it:
blacklist name_of_module
# mount / -o remount,rw
# sed -i.bak '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab && sudo swapoff -a && sudo rm -f -r /swapfile
(source: https://www.vivaolinux.com.br/dica/Desativar-SWAP-em-Ubuntu-2004-e-derivados-com-unico-comando)
#Rip music CD: Ripperx
$ sudo apt-get install ripperx
#Convert WAV to MP3: lame
$ sudo apt-get install lame
$ lame -h music.wav music.mp3
$ sudo install exiftool
$ exiftool -all= *.jpg
(souce: https://www.shellhacks.com/remove-exif-data-images-photos-linux/)
$ ffmpeg -i video.mp4 -pix_fmt rgb24 video.gif
##CONVERT TO MP3
#Convert wav to mp3
ffmpeg -i audio.wav -acodec libmp3lame audio.mp3
#Convert ogg to mp3
ffmpeg -i audio.ogg -acodec libmp3lame audio.mp3
#Convert ac3 to mp3
ffmpeg -i audio.ac3 -acodec libmp3lame audio.mp3
#Convert aac to mp3
ffmpeg -i audio.aac -acodec libmp3lame audio.mp3
#-----------------
#Cut video (extracts video from 20 sec. to 27 sec.)
ffmpeg -i input.mp4 -ss 00:00:20 -t 00:00:27 -c copy output.mp4
#Remove video (removes a slice from 20 sec. to 27 sec.)
ffmpeg -i input.mp4 -vf "select='not(between(t,20,27))', setpts=N/FRAME_RATE/TB" -af "aselect='not(between(t,20,27))', asetpts=N/SR/TB" output.mp4
#Concatenate videos
##create a list containing input video files (list.txt):
file 'input1.mp4'
file 'input2.mp4'
file 'inputN.mp4'
#----------------
##Concat files
ffmpeg -f concat -i list.txt -c copy output.mp4
#Remove audio from video file
ffmpeg -i input.mov -c copy -an output.mov
#Compress video
ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4
#Convert dav to mp4 (SOURCE: https://stackoverflow.com/questions/32827539/ffmpeg-conversion-dav-to-any-video-files)
ffmpeg -y -i input-file.dav -c:v libx264 -crf 24 output-file.mp4
#apt install imagemagick
convert -resize x16 -gravity center -crop 16x16+0+0 input.png -flatten -colors 256 -background transparent output.ico
(souce: https://askubuntu.com/questions/867567/convert-jpg-or-png-to-ico-using-terminal-and-back)
#apt install qpdf
qpdf --password=PASSWORD --decrypt File_with_pass.pdf File_without_pass.pdf
#apt install pdftk
pdftk File.pdf burst
#apt install ghostscript
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=Reduced_file.pdf Original_file.pdf
@dnat