Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Share your command line features and tricks for Unix/Linux. Try to keep it shell/distro agnostic if possible. Interested in seeing aliases, one-liners, keyboard shortcuts, small shell scripts, etc.


locked by Michael Mrozek Nov 6 '11 at 0:41

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

63 Answers 63

My favs are below. I use most of them regularly

df -k (check filesystems) kill or kill -9 (kill a process) set -o vi (set your command line to vi) topas (performance tool) mount/unmount

oh yeah and how could I forget the > (to redirect output to a file) ls > /tmp/tmp.txt

Many more but some off the top of me head.


I often notice, just after starting a 15-minute-command, that I would have wanted to add some other stuff to the command line using && . Instead of interrupting the already-running job, I tend to use at to queue the second one, giving myself a longer time I don't need to watch the terminal.

Generally, at queues jobs for execution at a given time:

$ at 14:30
> myscript
> anotherscript
> <CTRL-D>

Entries to the queue can be viewed with atq and removed with atrm.

Another addition to the bash prompt customization tips: I like to invert the prompt, as this gives good visual cues where command output begins and ends in long terminal listings. This works well for both bright and dark backgrounds.

export PS1="\[\e[7m\][\u@\h \w]\[\e[0m\]$ "
find path expr -exec ls -ld {} \;

Nice easy way to see ownership, permissions, sizes (if files), and other characteristics of whatever your 'find' expression returns.


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