Whats the easiest way to completely remove a direc

2020-02-06 05:12发布

问题:

What I know is, using rmelem to remove the folder first, and this will cause all of its child elements to be moved to lost+found.

Then, go into lost+found, and repeatedly execute rmelem * until all of the elements are removed.

Is there a better way?

回答1:

The technote about lost+found is quite clear:

if you rmelem a directory, all its content will indeed be moved to lost+found, where it will has to lost+found. The technote adds:

Note: If a directory element is deleted from lost+found with rmelem, its contents will be moved to lost+found in the same manner described in the first section above.

That is why I always try to rmelem files first, then directories, in order to avoid a trip (or several trips) in lost+found.

Except I very rarely rmelem anything, as the same technote warns:

Use rmelem carefully when deleting elements or symbolic links from the lost+found directory.
While the content of lost+found typically consists of unwanted elements and symbolic links, in some circumstances it can contain elements that are cataloged elsewhere in the VOB (that is, not orphaned) that are associated by symbolic or hard links.
For this reason, do not run rmelem recursively in lost+found without first verifying it contents.

If you need to save an element that is currently in lost+found, catalog it in a versioned directory using mv as explained in the previous section

Actually, with ClearCase UCM, it is almost impossible to rmelem any element with some history, because of all the hyperlink you would compromised (related to baselines mainly).



标签: clearcase