Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rm * option

Status
Not open for further replies.

sfmd6307

Technical User
Feb 5, 2004
1
US
If a rm * were entered in a directory, what type files would not be removed by this? We had some files with a name.type format that were removed, and some with the same naming convention that weren't. I'm not sure why this happened. Thanks
 
Depends on the protection on the remaining files and whether they had a '.' in front of them.

I love deadlines. I like the whooshing sound they make as they fly by - Douglas Adams
 
Some other possible reasons:

Some versions of rm will ask for confirmation before removing files with no write access. If it gets run from a script and can't get confirmation, I assume it might just leave those alone.

It's possible that some versions of rm, when run with no options and confronted with a symlink, remove the pointed-to file instead of the symlink. Those versions of rm would scare me.

Depending on the OS and/or filesystem, there might be additional properties of the a file that keeps it from being deleted (e.g. an immutable bit).

If you have a weird setup where some files in a directory are on one mounted filesystem and others are on a different one (possible with shadowed filesystems), files on a filesystem mounted read-only would of course not be deleted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top