Shell Script to delete files
gurus.knugum at gmail.com
Sat Apr 20 11:09:58 UTC 2013
2013/4/20 Johnny Rosenberg <gurus.knugum at gmail.com>:
> 2013/4/20 Akash Jain <akash.delhite at gmail.com>:
>> My aim is to delete more than 5 days old files which are no longer used by
>> any process. As a starter I have written following script, but it does not
>> work, says line 10 command not found.
>> cd $HOME
>> for f in `find . -type f`; do
>> if [`lsof -n $f`]; then
> I think you need a space before and after [ and ] respectively:
> if [ `lsof -n $f` ]; then
> ”[” is a command and is a synonym for ”test”, therefore you need the spaces.
> Johnny Rosenberg
>> echo $f
>> Thanks !
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at:
More information about the ubuntu-users