31 May

Print the contents of a file from a given regular expression to another

sed -n '/start/,/end/ p' file

This will print the contents of the ‘file’ from the line that matches /start/ until the line that matches /end/

29 May

Want to show something on your machine to someone over the web? Don’t copy it or upload it somewhere. Just run “webshare” and the current directory and everything beneath it will be served from a new web server listening on port 8000. When your pal is finished, hit control-c.

python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"

For a slightly more advanced version of this server, see this article(Warning: German Article – but code is self explaining)

27 May

This command shows a notice in GUI and disappears after a few seconds…

notify-send "Hello There"
26 May

This will convert all the ico files in the folder to gif. It uses the final frame of the ico file to create the gif.

for i in *.ico; do convert mogrify -identify i|awk '{print1}'|tail -n1 \$i.gif;  done
23 May

If you are using dosbox to play old games in linux, you can use this command to create a config file. First open the dosbox console by typing ‘dosbox’ in your terminal. Then type in this command…

CONFIG -writeconf dosbox.conf

The file ‘dosbox.conf’ will be created in your home folder

Original Source

21 May

Sort contents of two files by viewing only duplicate line

sort file1 file2 | uniq -d
18 May

Find and copy all files with ‘.txt’ extention from a directory to another

find /home/binnyva -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents