RE: nullifying file content..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try this one
> filename

Clears the file, keeping the name.

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of IT Dept
Sent: Thursday, December 16, 2004 4:08 PM
To: 'General Red Hat Linux discussion list'
Subject: RE: nullifying file content..


To bypass the 'noclobber' setting shouldn't it be:

cat /dev/null >| <filename>

Not sure which is right. Don't have that option (noclobber) set so I don't usually need the command.

Paul Pettit
CCB Inc.

P.s. sorry about that 'rm' recommendation, needed more coffee at the time.

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Schott, Erik J Mr ANOSC/FCBS
Sent: Thursday, December 16, 2004 11:31 AM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..


It sounds like you have "noclobber" set.  If you want to temporarily override it to clear out the file, do this:

cat /dev/null >! <your_file>

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Rigler, Stephen C.
Sent: Thursday, December 16, 2004 9:44 AM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..


cp /dev/null filename

-Steve 

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx]
On Behalf Of Mulley, Nikhil
Sent: Thursday, December 16, 2004 10:23 AM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..

The thing is it is not working under tcsh , while I invoked bash , and did the same thing which you have shown , it worked , But I did not understand why it did not work under  tcsh  ... Can any please throw light on this ....

Thanks,
Nikhil

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Karasik, Vitaly
Sent: Thursday, December 16, 2004 5:10 PM
To: General Red Hat Linux discussion list
Subject: RE: nullifying file content..


well, there is noclobber option which prevent overwriting: http://unixhelp.ed.ac.uk/environment/env7.html

> -----Original Message-----
> From: redhat-list-bounces@xxxxxxxxxx 
> [mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Mulley, Nikhil
> Sent: Thu, December 16, 2004 1:30 PM
> To: General Red Hat Linux discussion list
> Subject: RE: nullifying file content..
> 
> 
> I tried it , but was no use
> $>mylog.log
> mycron.log: File exists
> $
>  :(
> Thanks,
> Nikhil
> 
> -----Original Message-----
> From: redhat-list-bounces@xxxxxxxxxx 
> [mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Karasik, Vitaly
> Sent: Thursday, December 16, 2004 3:50 PM
> To: General Red Hat Linux discussion list
> Subject: RE: nullifying file content..
> 
> 
> > filename
> 
> > -----Original Message-----
> > From: redhat-list-bounces@xxxxxxxxxx 
> > [mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Mulley, Nikhil
> > Sent: Thu, December 16, 2004 12:16 PM
> > To: redhat-list@xxxxxxxxxx
> > Subject: nullifying file content..
> > 
> > 
> >     Hi , I have some 400MB file in my home dir , How do I
> > remove /clear the file content immediately with in a single 
> > command or should I cat it to /dev/null .
> > Can any body please tell me HOWTO...
> >  °v°
> > /(_)\
> >   ^ ^
> >  
> > --
> > redhat-list mailing list
> > unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=subscribe
> > https://www.redhat.com/mailman/listinfo/redhat-list
> > 
> **************************************************************
> *********************
> Information contained in this email message is intended only
> for use of the individual or entity named above. If the 
> reader of this message is not the intended recipient, or the 
> employee or agent responsible to deliver it to the intended 
> recipient, you are hereby notified that any dissemination, 
> distribution or copying of this communication is strictly 
> prohibited. If you have received this communication in error, 
> please immediately notify the postmaster@xxxxxxx and destroy 
> the original message.
> **************************************************************
> *********************
> 
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
> 
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
> 
************************************************************************
****
*******
Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@xxxxxxx and destroy the original message.
************************************************************************
****
*******

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux