D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Linux cli help!

 

On Fri, 2008-08-29 at 10:43 +0100, dclug@xxxxxxxxxxxxxxxx wrote:
> > Can you run 'ls -i' to get the inode number? If so then execute:
> >
> >     find . -inum xxx -exec /bin/rm {} \;
> >
> > where 'xxx' is the inode number.
> >
> >
> >
> > John.
> >
> 
> Thanks John,
> 
> ls -i worked but executing:
> 
> find . -inum 67715463 -exec /bin/rm {} \;
> 
> just brought up the usage instructions for the find command.
> Neither -inum or -exec were in the expression list. Now I'm wondering if
> I'm capable of running all commands or if they're restricted in some way.
> 
> Here's the expressions I can execute using find:
> 
> EXPRESSION may consist of:
>         -follow         Dereference symbolic links.
>         -name PATTERN   File name (leading directories removed) matches
> PATTERN.
>         -print          Print (default and assumed).
> 
>         -type X         Filetype matches X (where X is one of: f,d,l,b,c,...)
>         -perm PERMS     Permissions match any of (+NNN); all of (-NNN);
>                         or exactly (NNN)
>         -mtime TIME     Modified time is greater than (+N); less than (-N);
>                         or exactly (N) days
> 
> I never knew it could be so hard to delete a few files...
> Anything else to try?
> (For info the NAS box is a Qnap TS-409 pro)
>
You could try a wildcarded form of the rm command. Something like:

    /bin/rm *ACS550*    or    /bin/rm *.xls

You will, of course, need to do an 'ls' initially so as to see what
files you would be deleting.


John.

-- 
---------------------------------------------------------------
John Horne, University of Plymouth, UK  Tel: +44 (0)1752 587287
E-mail: John.Horne@xxxxxxxxxxxxxx       Fax: +44 (0)1752 587001

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html