rm
The rm command removes one or more files from a directory and can also be used to remove the directory itself. Going back to our earlier discussion on permissions, you must have both write and execute permissions on a directory in order to remove a file from it. If you own the directory from which you are going to remove files, then you can probably remove files from it. If, however, you don't have the appropriate permissions on a directory, then the rm fails.
As with some of the other commands we have covered, you can use the -i option, which asks you to confirm each file as it is removed. This means that if you are asked whether you really wish to remove a file and you respond n, then the file is not removed. If you respond y, the file is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access