🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #12735

Re: ¿Como vaciar el contenido de varios archivos desde linea de comando?

#12735
From: Antonio Villalon
Date: Wed, 16 May 2001 22:05
28 lines
2250 bytes
Holas,

Juan Antonio <jabb@vyb.com> wrote:
:     Alguien sabe como vaciar el contenido de mucho archivos (dejarlos a 0
: bytes sin borrarlos), usando por ejemplo el comando 'find' para encontrarlos
: y luego vaciarlos. He probado con:
:     find . -iname '*.log' -exec cat /dev/null > {} \;

[Perdon si este post llega por duplicado, o uno parecido, problemas tecnicos]

Una forma algo cutre es con:
	for i in `find . -name '*.log'`; do > $i;done
Otra forma, algo mas apanyada:
	find . -name '*.log' -exec cp /dev/null {} \;

Saludos,
			Toni

-- 
#############################################################################
#                      Toni Villalon <toni@aiind.upv.es>                    #
#           TELNET andercheran.aiind.upv.es 2895  for PGP Public Key        #
############################################################################# 
#  "The bad reputation Unix has gotten is totally undeserved, laid on by    #
#   people who don't understand, who have not gotten in there and tried     #
#   anything."                                                              #
#                                              Jim Joyce                    #
############# This .signature is written in 100% recycled bytes #############
Technical Details
Message-ID: <9dutii$va3$1@polaris.cc.upv.es>
Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.rediris.es!news.uv.es!news.upv.es!not-for-mail
References: <9du9jb$d5o$1@talia.mad.ttd.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f86c8,cf1253845289875f
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-05-16 15:18:06 PST
Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.rediris.es!news.uv.es!news.upv.es!not-for-mail
From: Antonio Villalon <toni@andercheran.aiind.upv.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: ¿Como vaciar el contenido de varios archivos desde linea de comando?
Date: 16 May 2001 22:05:06 GMT
Organization: U.P.V.
Lines: 28
Message-ID: <9dutii$va3$1@polaris.cc.upv.es>
References: <9du9jb$d5o$1@talia.mad.ttd.net>
NNTP-Posting-Host: andercheran.aiind.upv.es
X-Trace: polaris.cc.upv.es 990050706 32067 158.42.22.41 (16 May 2001 22:05:06 GMT)
X-Complaints-To: newsmaster@upv.es
NNTP-Posting-Date: 16 May 2001 22:05:06 GMT
User-Agent: tin/1.4.3-20000502 ("Marian") (UNIX) (Linux/2.2.19 (i586))