Article View: es.comp.os.linux.programacion
Article #17381Re: Programar en el shell bash
From: J.A. Gutierrez
Date: Thu, 13 Jan 2000 00:00
Date: Thu, 13 Jan 2000 00:00
110 lines
3362 bytes
3362 bytes
Israel Olalla <iolalla@yahoo.com> wrote:
: find ./ -name "core" ;-exec rm -f {}\;
o tambien
find / -xdev -type f -name core -print | xargs rm -f
: --> Nunca lo ejecutes desde el
: raiz hay ficheros que se llaman core y no son coreDUMP
(a que ficheros te refieres?
Lo unico que encuentro yo es
/proc/sys/net/core, directorio
y
/usr/src/linux-2.2.*/net/core, directorio
)
o para paranoicos:
find / -type f -name core -exec file {} \; | \
while read line
do
expr "$line" : ".*ELF 32-bit LSB core.*" && \
rm `echo $line | sed -e 's/:.*//'`
done
: find ./ -name "*.o"; -exec rm -f {}\;
^^^ sobra ^^^ falta espacio
Algo mas agresivo:
cd
echo cleaning netscape...
rm -f .netscape/newsgroups-*
rm -f .netscape/history.db
rm -f .netscape/cert-nameidx.db .netscape/cert.db .netscape/cert5.db
rm -rf .netscape/cache/*
rm -rf .mosaic-cc* .mosaic-global-history .mosaicpid
rm -rf .netscape-*
echo cleaning misc files
rm -f .Xauthority .pine-debug* .history* .sh_history
rm -rf 'Network Trash Folder'
rm -f .lsof_*
rm -rf .ncftp/history .ncftp/log .ncftp/trace*
rm -f .xftpcache
rm -rf .hh
echo cleaning TeX
for f in `find . \( -name '*.dvi' -o -name '*.log' -o -name '*.blg' \
-o -name '*.aux' \) \
-type f -print`
do
DIR=`dirname $f`
BASE=`expr $f : '.*/\(.*\)\..*$' \| $f`
case "$f" in
*.dvi)
PS="$BASE".ps
if [ -f "$DIR/$PS" ]
then
if head -10 "$DIR/$PS" | egrep -e '^%%Creator: dvipsk'
then
rm -f "$DIR/$PS"
fi
fi
;;
*.aux|*.log)
TEX="$BASE".tex
if [ -f "$DIR/$TEX" ]
then
rm -f "$f"
fi
;;
*)
rm -f "$f"
;;
esac
done
echo cleaning more
find . \( -name '*.rg' -o -name '*.spn' -o -name '*.log' \
-o -name core -o -name '*.o' \) \
-type f -print -exec rm {} \;
echo cleaning backup
find . \( -name '*.bak' -o -name '#*#' -o -name '*~' -o -name '*%' \
-o -name '.*.bak' -o -name '.*~' -o -name '.*%' \
\) \
-type f -print -exec rm '{}' \;
--
PGP and other useless info at \ Oh, show us the way
http://www.cps.unizar.es/~spd/ \ to the next whisky bar
finger://daphne.cps.unizar.es/spd \ Weill/Bretch
es doloroso ser sabio y descubrir la sopa de ajo (Pla)
Technical Details
Message-ID:
<85kj5i$mj0$1@news.unizar.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<_68f4.244$KF2.7350@m2newsread.uni2.es> <387DF53B.8ADCD13D@yahoo.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f86c8,c925e1e2ed735b17
X-Google-Attributes: gidf86c8,public
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Subject: Re: Programar en el shell bash
Date: 2000/01/13
Message-ID: <85kj5i$mj0$1@news.unizar.es>
X-Deja-AN: 572086384
References: <_68f4.244$KF2.7350@m2newsread.uni2.es> <387DF53B.8ADCD13D@yahoo.com>
X-Complaints-To: usenet@news.unizar.es
X-Trace: news.unizar.es 947769330 23136 155.210.152.20 (13 Jan 2000 13:15:30 GMT)
Organization: Rank
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (IRIX/6.2 (IP22))
NNTP-Posting-Date: 13 Jan 2000 13:15:30 GMT
Newsgroups: es.comp.os.linux.programacion