Skip to main content

Posts

2010

find command examples
··518 words·3 mins
Tips & How-To's Applications Linux Ubuntu
I’ve used find extensively and always wanted to writeup a nice post on this, but the linked post trumps my effort! Copy pasted from his blog, as the person’s allowed to do so. Also, as a general note - before using exec with the actual command, do preview it! remove empty directories # # find . -depth -type d -empty -exec rmdir {} \; change various file attributes # find .
Removing file named -rf in Unix
··66 words·1 min
Tips & How-To's Commands Linux Tutorials
I did something crazy at some point that created a file called “-rf” on my filesystem. Now I can’t figure out how to delete it. I’ve tried rm "-rf" rm \-rf But these just exit immediately. Arrgh! Anyone know how to remove this file? Preferably without accidentally cleaning out my whole folder. heh. What’re the odds, eh? via Removing “-rf” file in Unix - Super User.
[How to] Search through Bash history
··84 words·1 min
Tips & How-To's Linux Bash Applications
Quick tip - if you use the Terminal as much as I do, ever been in a situation where you’ve written a particularly long command, and then want to issue that command again but can’t recall it ? Use the history command, and pipe it to grep to search it! history | grep -i <search-term> This will give you all commands with the search term and the corresponding line number.