Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here are a few I haven't seen in a lot of places but come in really handy.

First, alias this on Linux to get the 'open' command to work like OSX (e.g. 'open file.pdf'). It shadows a real 'open' command, but I have never used it, so no big loss :

  alias open='xdg-open'
The second one I use all the time. A process that is stuck on I/O (or other uninterruptible syscalls), or even a Python interpreter stuck in a C extension, won't always respond well to Ctrl-C. However, Ctrl-Z (suspend) and this alias (kills the last suspended process group) do work relatively well :

  alias killit='kill -9 %%'
This one I use a lot for copying the output of a command to the clipboard. Just run 'command | pbcopy' and then Ctrl-V elsewhere. pbcopy is actually an OSX command, I aliased it on Linux for ease of use :

  alias pbcopy='xclip -selection clipboard'
  alias pbpaste='xclip -selection clipboard -o'
This one runs a program under GDB. You can run e.g. 'gdbrun =python test.py' and debug C extensions more easily:

  alias gdbrun='gdb -ex=r --args'


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: