The unix shell command to do nothing. It's almost compeltely useless, I think, except for creating or zeroing out a file.

% :>filename

I like to use this command to zero out log and temporary files. And it's much shorter than touch!


Outside of the bourne shell tradition, the ":" is called a colon, and is used grammatically introduce a quotation, an explaination or a list.

The : command is often used in shell scripts to trap and ignore signals received by the script.

Thus

trap : 1 2 3 9 15

will cause the shell ignore any signal 1, 2, 3, or 15 sent to it while executing commands in the script.
Sorry, Nobody can ignore a signal 9.
Re: ":" and vi. Technically, ":" is an escape from the visual front-end of vi out to the underlying editing program, ex. Typing a : inside vi allows you to execute any ex command. This escape key is a colon because ex's traditional prompt is a colon.

Also, it's the beginning of most commands in vi. For instance, :q quits. That's my favorite command of all. It frees up a lot of screen space for emacs windows!

Log in or register to write something here or to contact authors.