Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explain " :> " command

Tags:

bash

unix

sh

I have found this command few years ago and used it since then to empty file.

But how this really works?

:>

used like

:> /server/logs/access_log

like image 905
Marek Sebera Avatar asked Dec 03 '22 07:12

Marek Sebera


1 Answers

> is the redirection operator. : is a builtin shell command, and is equivalent to to the true command, it is used mostly as a placeholder in scripts.

:> filename will make your file empty.

like image 78
WebMonster Avatar answered Jan 02 '23 14:01

WebMonster