rmfiles -- find/remove files in subdirectories
rmfiles [-dnv] [-f progfile] rootdir action extns
- Print debug messages.
- No execute; do not delete files. This option may be used to generate a list of binary files for some purpose other than deletion, or to verify the delete operation before destroying the files.
- Print names of files as they are deleted.
- -f progfile
- Take delete commands from the named file. If this option is specified the remaining arguments are normally omitted.
- The root directory of the directory tree to be pruned. This must be a path from the current directory or from a logical directory.
- The possible actions are listed below. This is a required parameter.
- Delete all files.
- Delete all files except those with the listed extensions.
- Delete only those files with the listed extensions.
- A list of filename extensions delimited by spaces, e.g., ".a .o .e .hlp".
The rmfiles utility is used to delete (or list) files in one or more directory trees. If only one directory tree is to be pruned the necessary instructions can be entered on the command line, otherwise a program file must be used. When developing a program file, a dry run using the "-n" switch is recommended to see what files will be deleted.
If a program file is used each line in the file has one of two possible formats. If a directory is to be pruned the syntax is the same as is used when a one line program is entered on the command line, i.e.:
rootdir action extns
The significance of each field is as described in the ARGUMENTS section above. The program file may also contain lines of the form
to delete one or more files by name. This is useful for removing files which do not fit into any recognizable class.
Comments and blank lines are permitted anywhere in the program file. All filenames are IRAF virtual filenames (or host filenames).
Rmfiles is a bootstrap utility implemented as a foreign task, hence it may be called either from within IRAF or from the host system.
1. Delete all .o, .e, .a, and .hd files in the directory "iraf$pkg". Print the names of the files as they are deleted. Note that one must move to the directory containing the directory to be pruned before running rmfiles .
cl> cd iraf cl> rmfiles -v pkg .o .e .a .hd
2. Strip the entire IRAF system, using the program in file "hlib$stripper". The use of the $ in the filename here could cause problems on some systems since rmfiles is a foreign task.
cl> cd iraf cl> rmfiles -vf hlib$stripper