Sort and Unique
Sort contents of a file and remove repeated lines
sort file.txt | uniq
Sort contents of a file and remove repeated lines
sort file.txt | uniq
Restoring a backup created by the dump command.
restore -if home_backup.bak
This shell script will create a build of a firefox extension in linux. This is created according to my details(eg, the guid has @binnyva.com in it) - but you can modify it and use it yourself.
app=$1
folder=$2
if [ $# -eq 0 ] ; then
echo “Useage: sh build.sh []”
elif [ $# -eq 1 ] ; then
folder=”$1@binnyva.com/”
fi
rm $app.xpi
cp -r $folder temp
cd temp
rm -rf .git
zip -r $app.xpi .>/dev/null
mv $app.xpi ..
cd ..
rm -rf temp
echo “Built $app successfully”
Show all deb packages installed on the system
dpkg -l
Make a incremental backup of directory ‘/home/binnyva’
dump -1aj -f home.bak /home/binnyva/
Make a full backup of directory ‘/home’
dump -0aj -f home.bak /home
This command removes all the even lines from the file given as the argument
cat example.txt|awk 'NR%2==1'
Use this code to force a download of any type of content with PHP
header("Content-type:application/octect-stream");
header('Content-Disposition: attachment; filename=filename_' . date('Y-m-d') . '.sql');
print "Hello World";
Makes a file immutable - it can not be removed, altered, renamed or linked
chattr +i file