[Dirvish] Moving a Dirvish Vault

Jason Boxman jasonb at edseek.com
Fri Jun 2 14:10:17 UTC 2006


Paul Slootman wrote:
<snip>
> Use ls -i which will show the inode number. The inode number is the same
> for file a and file b; in fact, the file *is* the inode basically, the
> filenames you see in a directory are simply links to the inode. As soon
> as the last link to an inode is removed, the OS removes the file (unless
> it's opened by some process, although that could be considered a link as
> well).  This is assuming of course that both a and b are on the same
> filesystem, as inode numbers are only unique on a single filesystem.

I found it interesting that you can actually 'recover' a file you deleted on
Linux out of /proc by copying from the open FD.  Of course, a nuked file
need be held open by a running process for that to work.

<snip>
> That's because the argument list is passed in the environment, and space
> for that is limited.  A better way is to use find and xargs:
>
> find -maxdepth 1 ! -type d -print0 | xargs -0 --no-run-if-empty rm
>
> xargs takes care of not passing too many arguments to rm at one time.

`xargs` is my friend.

It's helpful to run `echo rm` first, to make sure you really want to delete
the files returned from `find`.  Further, sometimes you may want to play
with `xargs -lN`, where that controls lines passed to the command.

An exercise I found enlightening.

xargs -0 -i% echo rm %
xargs -l1 -i% -0 echo rm %

Of course, the original question was already answered...





More information about the Dirvish mailing list