xargs. Too few people know xargs. Every time I see a "find" with "-exec" in it, my soul cries a little bit. (Yes, sometimes it might be necessary, but in the vast majority of cases not.)
find -exec is almost always faster and more secure than xargs.
Awesome but commonly unknown Linux Commands
41–50 of 88 posts
Re: Awesome but commonly unknown Linux Commands
#42If you're running a modern Linux desktop, you should have a "notify-send" command which will cause a message to be displayed by your desktop-environment's pop-up notification system (on Ubuntu, this command is in the libnotify-bin package). I have two scripts I keep around which I call "notify-success" and "notify-failure": notify-success: notify-send --icon=gtk-dialog-info Success! "$*" notify-failure: notify-send -…
My terminal (urxvt) will detect the bell and set the 'urgent' flag on the window, which is detected by Awesome, which sets the appropriate tag* icon to red.
* Tag in Awesome is more or less akin to a virtual desktop.
Re: Awesome but commonly unknown Linux Commands
#43xargs. Too few people know xargs. Every time I see a "find" with "-exec" in it, my soul cries a little bit. (Yes, sometimes it might be necessary, but in the vast majority of cases not.)
Re: Awesome but commonly unknown Linux Commands
#44xargs. Too few people know xargs. Every time I see a "find" with "-exec" in it, my soul cries a little bit. (Yes, sometimes it might be necessary, but in the vast majority of cases not.)
find -exec is almost always faster and more secure than xargs.
Re: Awesome but commonly unknown Linux Commands
#45nuff said.
Re: Awesome but commonly unknown Linux Commands
#46On Linux I very regularly use 'strace', to see what a program is currently doing (in terms of syscalls), what files were opened/read/written/closed, etc.
strace is the Daddy of debugging especially when you can attach it to an already existing program using it's PID. I have solved so many permissions errors problems with strace where the application itself just failed without logging anything.
Re: Awesome but commonly unknown Linux Commands
#47All these article links should just end up here: http://www.commandlinefu.com/commands/browse you can sort by date, #(votes) and also search The top all-time popular one is: * run last command as root: $ sudo !!
Re: Awesome but commonly unknown Linux Commands
#48iftraf sounds interesting. I was looking for just such a program the other day. I was sitting there and noticed with my iStat monitor that I was uploading something at 250 KB/sec. I closed Chrome and eventually all running programs in the doc, yet it still continued. I tried to find out WHAT was uploading that, but to no avail. Any suggestions for tools? I ended up trying iftop, lsof -i, and netstat to get a glimpse,…
Re: Awesome but commonly unknown Linux Commands
#49lsof is also great for monitoring network activity: you can have it tell you about all the tcp/udp connections, as well as who's attached to which port.
lsof -iRe: Awesome but commonly unknown Linux Commands
#50One I use all the time is this: $ pwd /Users/me/Sites/foo $ pushd . $ cd / $ pwd / $ popd $ pwd /Users/me/Sites/foo Or in English: If you're in a directory that you need to leave but you know you'll go back there in a minute, use "pushd ." to save that directory. Then go off and do whatever you need to, and when you need to return to the saved directory, use "popd" to take you straight back there.
If you set CDPATH to '.:~/dev/python', you can easily jump to your project just by doing cd my_awesome_project, it doesn't matter where you actually are in your FS!
I use it heavily with cd -, you should give it a try!