Archive all files with a given extension
Find all files with ‘.log’ extention and make an bzip archive
find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2
Find all files with ‘.log’ extention and make an bzip archive
find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2
Configure IP Address using the ifconfig command
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
Decompress a compressed tar archive in bzip2
tar -xvfj archive.tar.bz2tar -xvfj archive.tar.bz2
create a tarball compressed into bzip2
tar -cvfj archive.tar.bz2 dir
Usie this command to encrypt and decrypt a file using PGP in linux.
gpg -c file
gpg -o file -d file.gpg (output to file)
Works on OS X, Linux, anywhere with OpenSSL installed:
To encrypt a file:
openssl des3 -salt -in infile.txt -out encryptedfile.txt
To decrypt the file:
openssl des3 -d -salt -in encryptedfile.txt -out normalfile.txt
Delete all \n chars in a file…
tr -d "\n"
extract a tarball into / tmp
tar -xvf archive.tar -C /tmp
FFMPEG command to mix an audio file with a video file to create a final video.
ffmpeg -vcodec flv -qscale 9.5 -r 25 -ar 22050 -ab 32k -s 320x240 -i 1.mp3 -i Meta.ogv final.flv
Linux command to convert a video file to PSP format using ffmpeg. After converting, copy the OutputFile to the video folder in your PSP.
ffmpeg -i "OriginalFile.avi" -f psp -r 29.97 -b 768k -ar 24000 -ab 64k -s 320x240 "OutputFile.mp4"