Shell Script to delete files
lists at joenyland.co.uk
Sat Apr 20 10:43:53 UTC 2013
On 20 Apr 2013, at 10:31, Nils Kassube <kassube at gmx.net> wrote:
> Akash Jain wrote:
>> 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
> It isn't clear where your script starts, so it is difficult to guess
> which line the shell doesn't like. But I would suggest to carefully
> check the line above.
The following runs with no issues here:
for f in `find . -type f`; do
if [[ `lsof -n $f` ]]; then
Hope this helps.
More information about the ubuntu-users