rm(1) DG/UX 4.30 rm(1)
NAME
rm, rmdir - remove, delete files or directories
SYNOPSIS
rm [ -f ] [ -i ] file ...
rm -r [ -f ] [ -i ] dirname
rmdir [ -p ] [ -S ] dirname
DESCRIPTION
Rm removes the entries for one or more files from a
directory. If an entry is the last link to the file, the
file is destroyed. Removal of a file requires write
permission in its directory, but neither read nor write
permission on the file itself.
When you try to remove a file that does not have write
permission and the input is a terminal, the file's
permissions, followed by a question mark, are printed and a
line is read from the standard input. It the line that you
type in begins with y, the file is deleted; otherwise, the
file remains.
If you try to remove a file that is a directory, an error
message is printed. You will not get an error message if
you use the optional argument -r.
Options are:
-f Turns prompting off for removing files that the user
has no write permission on.
-r If the file to be removed is a directory,
recursively deletes the entire contents of the
specified directory and the directory itself.
-i Interactive mode: rm and, under -r, whether to
examine each directory.
Rmdir removes entries for the named directories, which must
be empty.
Options are:
-p Try to delete the named directory and all its parent
directories, which become empty. Prints a message to
standard output indicating whether or not the whole
path is removed or part of the path remains.
-s Don't print messages to standard output when -p is in
effect.
Licensed material--property of copyright holder(s) Page 1
rm(1) DG/UX 4.30 rm(1)
EXAMPLES
$ rm code
Removes the file named "code" from the current working
directory.
$ rm -i *.o
You are asked whether each file that ends in ".o" should be
removed. If you had a file "jqr.o", the rm command would
print
jqr.o: ?
rm waits for you to respond "y" for yes, or "n" for no.
$ rm -rf $HOME/ITEMS
All files and directories in the directory "$HOME/ITEMS" are
removed and then the directory "ITEMS" itself is removed.
If you do not have write permission for a file, the "f"
option removes it without notifying you of that fact.
SEE ALSO
unlink(2) in the Programmer's Reference for the DG/UX System
DIAGNOSTICS
Generally self-explanatory. You can't remove the parent
directory pointer file (..).
Licensed material--property of copyright holder(s) Page 2