:

(thing) by eric+ Fri Jun 16 2000 at 3:14:52

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.

(idea) by Gorgonzola Fri Jun 16 2000 at 3:40:10
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.
(thing) by ApoxyButt Fri Jun 16 2000 at 3:57:53

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!

Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.