Welcome to bashoneliners.com, a growing collection of practical and well-explained Bash tips and tricks. We are committed to review every contributed one-liner to ensure its high quality, practical usefulness, and a solid explanation of how it works. We want to document one-liners for frequent (non-trivial) tasks executed in the shell, written in the best possible way, following good practices known in the industry. To get the latest Bash one-liners, follow @bashoneliners on Twitter. If you find any problems, please report on GitHub Issues.
0 score

Find video files cached by the flash plugin in browsers

 $ file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d:

Aug. 27, 2011, 1:46 p.m.Janos

0 score

Force the preferred language when downloading a web page with wget

 $ wget -–header='Accept-Language: en-us' http://www.timeanddate.com/calendar/index.html?year=2008&country=26 -O calendar.html

Aug. 21, 2011, 1:40 p.m.Janos

0 score

Burn the contents of a directory to dvd without needing a gui application

 $ growisofs -dvd-compat -Z /dev/scd0 -R -J -pad /path/to/dir

Aug. 14, 2011, 9:35 p.m.Janos

0 score

Convert all flac files in the current directory to mp3 format using "lame"

 $ for i in *.flac; do flac -c -d "$i" | lame -m j -b 192 -s 44.1 - "${i%.flac}.mp3"; done

Aug. 9, 2011, 9:57 p.m.Janos

0 score

Halt the system in Linux without the halt command or gui

 $ echo o > /proc/sysrq-trigger

Aug. 9, 2011, 9:55 p.m.Janos

0 score
0 score

Create an encrypted tar file with openssl

 $ tar c paths_to_files_and_dirs | gzip -c | openssl des3 > encrypted.tar.gz

Aug. 9, 2011, 1:30 a.m.Janos

0 score

Make another user superuser in Ubuntu

 $ for i in $(grep :boss /etc/group | cut -f1 -d:); do adduser wife $i; done

Aug. 5, 2011, 8:57 p.m.Janos

0 score

Change the label of a USB drive in Linux without a gui

 $ sudo mlabel -i /dev/sdd1 ::NewLabel

Aug. 5, 2011, 8:57 p.m.Janos

0 score

Mirror from one Subversion repository to another Subversion repository

 $ bzr co https://repo1/proj1/trunk proj1 && cd proj1 && bzr push https://repo2/vendor/proj1/trunk

Aug. 5, 2011, 8:57 p.m.Janos

2 score

Rename all files in a directory to lowercase names

 $ paste <(ls) <(ls | tr A-Z a-z) | while read OLD NEW; do echo mv -v $OLD $NEW; done

Aug. 5, 2011, 8:57 p.m.Janos

0 score

Find Flash videos stored by browsers on a Mac

 $ find /private/ 2>/dev/null | grep /Flash

Aug. 5, 2011, 8:57 p.m.Janos