Game Development Community

Usefull bash commands. :)

by Lloyd [Bleeptech] Godsey · in Technical Issues · 01/19/2004 (11:46 pm) · 5 replies

Try this when you're tired of chasing and deleting .dso files

find -name '*.dso' -print -exec rm -v {} \;

Replace with the directory you want it to check.

I found this while running a Tribes 2 server and it makes life a lot easier.

#1
01/20/2004 (2:42 pm)
How about:

find -name "*.dso" | xargs rm -f?

I find using xargs easier to remember. And rm -f won't bother you with errors or warnings.
#2
01/20/2004 (2:52 pm)
What about adding a -v onto that -f?
find -name "*.dso" | xargs rm -fv
Then you'd know that something is still happening (since you would see the files getting displayed as they are deleted) :)
#3
01/20/2004 (3:01 pm)
That works if you want to kill all the .dso files no questions asked.
// Also xargs is not a bash builtin, I wanted this to work on anything with
// bash without relying on externals :)

I was using this with a Shifter Server and did a "chmod -R 555 Shifter/"
// Which I wanted to keep.

The rm -v kicks an error when it hits the read-only but keeps going.
// And lets you see that it hasn't suffered a CPU-fart.

// Hey! You'll have to chmod that again to delete it. :)
// I tend do things so that I have to screw up bad to totally kill
// what I'm working on. :)
#4
01/20/2004 (3:36 pm)
That works if you want to kill all the .dso files no questions asked.

I've done some umbelievably stupid things with find and rm -rf in the same command, so I really don't blame you for being cautious :)

I never do rm -rf without trying ls with the same pattern first, just to be sure I'm deleting what I think I'm deleting. I still use rm -rf tho, I just generally hate any feedback or warnings from that particular command (or most shell commands, for that matter).
#5
02/25/2004 (9:51 am)
Remember you can use backticks just as easily:

rm -rf 'find . -name '*.dso''