O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

tmpwatch

Synopsis

tmpwatch [options] hours directory

System administration command. Recursively remove regular files and directories in directory with access times older than hours. Specify the directory as an absolute path. This command is usually invoked by cron to remove old files in the /tmp directory.

Options

-a, --all

Remove all file types.

-c, --ctime

Make decision on last inode change time for files and modification time for directories instead of access time.

-d, --nodirs

Do not remove directories.

-f, --force

Force removal of read-only files (similar to rm -f).

-l, --nosymlinks

Don’t remove symbolic links.

-m, --mtime

Make decision on last modification time instead of access time.

-M, --dirmtime

Make directory deletion decisions based on modification time.

-q, --quiet

Report only fatal errors.

-s, --fuser

Before deleting, attempt to use fuser to see if a file is in use.

-t, --test

Verbosely test command, but don’t actually remove files.

-u, --atime

Make decision on access time. (This is the default.)

-U user, --exclude-user user

Don’t delete files owned by user, specified by name or user ID.

-v, --verbose

Print more details. Use two times to further increase the detail of the output.

-x, --exclude=path

Skip the specified path, the absolute path of a directory or file.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required