9
votes

As there is a windows version of this question, I decided to open a community wiki for the same question under unix, linux, and the like.

I'll be updating this list with the answers:

  • bash: exec 3<> /dev/tcp/localhost/80 # Redirect to port 80 of localhost
  • find: search for files in a directory hierarchy
  • htop: interactive process viewer, similar to top
  • xargs: build and execute command lines from standard input
  • tmux: detachable, re-attachable command line sessions
  • apropo: find relevant man pages
  • vmstat: See the state of your system

Websites:

  • commandlinefu.com
  • serverfault.com

Keyboard shortcuts: - Ctrl T (BSD specific): send SIGINFO to a running program - Magic SesRq key (Linux specific): en.wikipedia.org/wiki/Magic_SysRq_key

2
  • See @Andrew Hodgson's response.
    – Gareth
    May 14, 2009 at 1:37
  • Yeah, actually I see it.
    – Álvaro
    May 21, 2009 at 20:32

10 Answers 10

8
votes

Try commandlinefu.com.

7
votes

'screen' - allows for detachable, re-attachable command line sessions. Made extra shiny with screen-profiles (default in Ubuntu 9.04), and byobu in 10.04

3
votes

Slight dupe:

Hidden Features of Linux

Hidden Features of Linux

1
  • yeah, I didn't find it
    – Álvaro
    May 8, 2009 at 13:27
2
votes

find. Extremely useful in combination with xargs.

2
  • But also on its own. May 9, 2009 at 21:29
  • 2
    The use of -exec in find makes xargs useless most of the time.
    – raphink
    Dec 28, 2009 at 21:11
2
votes

Using 'ack' as a replacement for grep/find+xargs+grep: www.betterthangrep.com

2
votes

reset

for when you accidentally cat a binary file :-)

Cheers

1
vote

Maybe not commands per se, but I've found knowing that you can set bash to use emacs or vi-style shortcuts to navigate the prompt to be especially useful. Ctrl+A to move to the beginning of the line, Ctrl+E to move to the end of the line, and all the others (c.f. http://www.hypexr.org/bash_tutorial.php).

1
  • I know that bash uses emacs style by default, but is it actually possible to have it use vi commands? I'd love that, but I'm not sure how it'd work. (Edit: I just realized how old this is....but ah well. Legit question.) Jan 18, 2012 at 5:12
0
votes

ls - list directory contents. ls /bin ls /usr/bin ls /usr/local/bin : See what other toys you can play with

0
votes

pushd, popd - push directory, pop directory

cd - without any parameters will take you back to your home directory.

history - gives a list of all the previous command combinations that were run. You can grep this list if you're looking for something specific. And then use !n to recall it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.