remove file that has sensitive info safely. Overwrites it 33 times with zeros
deborphan(1) must be installed.
To decrypt the files replace "ccenrypt" with "ccdecrypt. ccrypt(1) must be installed. It uses the AES (Rijndael) block cipher. To make it handier create an alias.
Often I need to edit a bash or perl script I've written. I know it's in my path but I don't feel like typing the whole path (or I don't remember the path).
During this operation : # mv Joomla_1.5.10-Stable-Full_Package.zip /var/www/joomla/ I invoke /var/www/joomla/ as last command argument. To change in this directory I can use # cd !$ So I go to hob:/var/www/joomla#
Assuming that 219,229 and 221 are entries in history, I recall them in a single line for execute multiple commands 219 ifdown wlan0 ... 221 ifup wlan0 ... 229 iwconfig wlan0 mode Managed so the result is execution of # ifdown wlan0 ; iwconfig wlan0 mode Managed ; ifup wlan0
tailf same as tail -f follow the flow of a log file, showing it in real time to stdout.
Yeah, there are many ways to do that. Doing with sed by using a for loop is my favourite, because these are two basic things in all *nix environments. Sed by default does not allow to save the output in the same files so we'll use mv to do that in batch along with the sed. Show Sample Output
When you have to manage lot of servers, it's boring to type ssh root@myhost for each connection. Now you can type juste "s someting" and you are connected. You can too add bash_completion script to complet with tab the name of your servers. This will be the next tips from me ;) Show Sample Output
You will need libnotify-bin for this to work:
sudo aptitude install libnotify-bin
From time to time one forgets either thier gpg key or other passphrases. This can be very problematic in most cases. But luckily there's this script. Its based off of pwsafe which is a unix commandline program that manages encrypted password databases. For more info on pwsafe visit, http://nsd.dyndns.org/pwsafe/. What this script does is it will help you store all your passphrases for later on and allow you to copy it to your clipboard so you can just paste it in, all with one password. Pretty neat no? You can find future releases of this and many more scripts at The Teachings of Master Denzuko - denzuko.wordpress.com. Show Sample Output
With this command you can use shell variables inside sed scripts. This is useful if the script MUST remain in an external file, otherwise you can simply use an inline -e argument to sed.
bash.org is a collection of funny quotes from IRC.
WARNING: some of the quotes contain "adult" jokes... may be embarrassing if your boss sees them...
Thanks to Chen for the idea and initial version!
This script downloads a page with random quotes, filters the html to retrieve just one liners quotes and outputs the first one.
Just barely under the required 255 chars :)
Improvment:
You can replace the head -1 at the end by:
awk 'length($0)>0 {printf( $0 "\n%%\n" )}' > bash_quotes.txt
which will separate the quotes with a "%" and place it in the file.
and then:
strfile bash_quotes.txt
which will make the file ready for the fortune command
and then you can:
fortune bash_quotes.txt
which will give you a random quote from those in the downloaded file.
I download a file periodically and then use the fortune in .bashrc so I see a funny quote every time I open a terminal.
Show Sample Output
See all fonts installed in your system Show Sample Output
This is a bit to bit copy so if you have a 500GB hard disk it will take a long time even if have Gigabit Ethernet
This opens up nautilus in the current directory, which is useful for some quick file management that isn't efficiently done from a terminal.
Find all corrupted jpeg in the current directory, find a file with the same name in a source directory hierarchy and copy it over the corrupted jpeg file. Convenient to run on a large bunch of jpeg files copied from an unsure medium. Needs the jpeginfo tool, found in the jpeginfo package (on debian at least).
Copy a file to a range of other files. Show Sample Output
I have a bash alias for this command line and find it useful for searching C code for error messages. The -H tells grep to print the filename. you can omit the -i to match the case exactly or keep the -i for case-insensitive matching. This find command find all .c and .h files Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: