1753797 Members
7298 Online
108799 Solutions
New Discussion юеВ

zero size file

 
SOLVED
Go to solution
Shah Gaurang B.
Frequent Advisor

zero size file

hi,

hello experts .how can i create 0 (zero) size of files in hp-ux ?

9 REPLIES 9
James R. Ferguson
Acclaimed Contributor
Solution

Re: zero size file

Hi:

Simply do:

# touch filename

Regards!

...JRF...
Shah Gaurang B.
Frequent Advisor

Re: zero size file

thax i was confused .thanks
A. Clay Stephenson
Acclaimed Contributor

Re: zero size file

Plan B.

cp /dev/null myfile
If it ain't broke, I can fix that.
Torsten.
Acclaimed Contributor

Re: zero size file

Plan C:

cat /dev/null >myfile

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
MarkSyder
Honored Contributor

Re: zero size file

Plan D:

> filename

No points please - you've already received three perfect answers and point hunting is even more contentious than usual at the moment. I'll take satisfaction from the fact that my answer may help somebody.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Andrew Merritt_2
Honored Contributor

Re: zero size file

Plan D (if we're going for minimum keystrokes :-) ):

$ >filename
^D

Andrew
Raj D.
Honored Contributor

Re: zero size file

Hi Gourang,

You can do this by :

1.
# echo "Creating zero byte file" ; >zerobytefile

2. You can also use touch.
# touch zerobytefile


Enjoy,
Cheers.
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Andrew Merritt_2
Honored Contributor

Re: zero size file

As Mark says, no points for me, either. I was batch processing the new threads from overnight, and didn't see he had posted too until after I had submitted mine.

Andrew
Raj D.
Honored Contributor

Re: zero size file

Andrew is right in this case.

Cheers,
" If u think u can , If u think u cannot , - You are always Right . "