empty file in linux

16 03 2010

To empty a file without tampering any attribute of that file in linux is easy. The only command to be used is just a greater than symbol > .

# ls -l
-rwxr-xr-x 1 root root 177 Feb 9 13:33 flush
# > flush
# ls -l
-rwxr-xr-x 1 root root 0 Feb 9 13:33 flush


Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: