grep -r . "some random debug message" (searches for the passage recursively in all files from the directory it was executed, the main reason I like developing in linux more than windows)
If you are searching inside code specifically, you may like 'ack'. It does the same thing grep does, except it has preset 'excludes', is recursive by default, and the output is a bit prettier.
Favorite Unix Commands
61–70 of 135 posts
Re: Favorite Unix Commands
#62You can even go meta and install a command to let you search commandlinefu [2].
[0] http://news.ycombinator.com/item?id=527486
Re: Favorite Unix Commands
#63sudo !! Instant favorite
$ rm -rf somedir
rm: somedir/: Permission denied
$ fucking !!Re: Favorite Unix Commands
#64Please comment if you have a favorite not on this list.
If you use tmux (or screen) you want to use byobu! https://launchpad.net/byobu https://www.google.de/search?q=byobu+tmux&tbm=isch It's a fancy statusbar that shows CPU speed, IP-address, hostname, ...
Screenshot: http://i.imgur.com/u6JY0.png
Config file: https://github.com/tylerkahn/dotfiles/blob/master/.tmux.conf...
Works with OSX and Linux.
Re: Favorite Unix Commands
#65grep -r . "some random debug message" (searches for the passage recursively in all files from the directory it was executed, the main reason I like developing in linux more than windows)
findstr /SPINC:"some random debug message" *
Will do the same. FINDSTR is no grep, but for very simple cases like this is just fine
SPINC and SPIMC are my favorite options...
Re: Favorite Unix Commands
#66Re: Favorite Unix Commands
#67(http://www.unixhub.com/docs/hpux/hpux_boot.html)
I wish I still had that machine, but I do not.
Re: Favorite Unix Commands
#68Re: Favorite Unix Commands
#69grep -r . "some random debug message" (searches for the passage recursively in all files from the directory it was executed, the main reason I like developing in linux more than windows)
If you are searching inside code specifically, you may like 'ack'. It does the same thing grep does, except it has preset 'excludes', is recursive by default, and the output is a bit prettier.
Re: Favorite Unix Commands
#70Please comment if you have a favorite not on this list.
export CDPATH=.:~/projects
export PS1="$(uname -n)$ "
alias ltr='ls -ltr'
More of a procedure, always list file and edit the command before deleting it: $ ll file.txt
-rw-r--r-- 1 zera staff 0 Jan 7 20:28 file.txt
Ctrl-p, Ctrl-a, Ctrl-d, Ctrl-d, r,m
$ rm file.txt
So this is a sanity check to avoid this mistake: $ rm *.txt
*Edit, one more:Ensure you overwrite a file (or aren't):
$ cp -i ~/file.config /etc/