Skip to content

How to create a empty File in Linux

Well, it is realy simple to create a file in Linux, but some developers tend to use "special" commands to acheive it.

Here are the normal ones, I bet you know them:

touch $FILE
echo -n "" > $FILE
# (for temporary files)
mktemp ${FILE}.XXX

But these days I was confronted by a astonishing new solution to that problem:

cp /dev/null $FILE

I'd say 0 points for UNIX knowledge, 10 points for coolnes.


Keine Trackbacks


Ansicht der Kommentare: Linear | Verschachtelt

Noch keine Kommentare

Kommentar schreiben

BBCode-Formatierung erlaubt
Standard-Text Smilies wie :-) und ;-) werden zu Bildern konvertiert.