[oclug] Changing Permissions and LS

Matthew Wilcox willy at debian.org
Mon Jul 12 07:30:50 EDT 2004


On Mon, Jul 12, 2004 at 02:47:12AM -0400, Michael Bazdell wrote:
> I have a whole bunch of mp3 files and they're all +x for some reason. So
> I want to change them all into -x but this will take a really long time
> to do, and if I do it too broad, I'll -x directories... I tried doing
> something like,
> 
> #!/bin/sh
> 
> chmod -x "$1"
> 
> 
> and then I'd do,
> 
> find ./ -iname *.mp3|script
> 
> 
> But I'd always get "chmod: failed to get attributes of `': No such file
> or directory"... I can't figure out the trick.... any suggestions?

find -type f |xargs chmod a-x

> Also I was wondering if it's possible to show directories first when
> doing "ls". I tried "ls -X" but that doesn't really give the directories
> first...

I don't think GNU ls has this option.  I'm not sure why you'd want it
really.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain



More information about the OCLUG mailing list