If you use a
system to make temporary files (21.3
file can clean up the temporary files.
The exact cleanup command you'll use depends on how you create the files,
The overall setup looks something like this in .logout
(set nonomatch; cd ~/temp && rm -f *) &
The parentheses run the commands in a
so the cd
won't change the current shell's working directory.
The C shell needs a
command so the shell will be quiet if there
files to clean up;
omit that command in Bourne-type shells.
won't run unless the
first, instead of just
's command-line arguments from
getting too long (15.6
if there are lots of temporary files to remove.
If you could be logged in more than once, be careful not to remove
files that other login sessions might still be using.
One way to do this is with the
command - only remove files that
haven't been modified in the last day:
find ~/temp -type f -mtime +1 | xargs rm -f &