bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A request/suggestion for the behavior of chmod -X


From: James Youngman
Subject: Re: A request/suggestion for the behavior of chmod -X
Date: Sat, 7 Mar 2009 06:39:21 +0000

On Sat, Mar 7, 2009 at 2:55 AM, Charles Jie <address@hidden> wrote:
> Hi,
>
> Situation:
>
>    I often need to pull lots of files from Windows boxes or from SD
>    cards in FAT filesystem filled with photos from digital camera.
>
>    The copied files usually have the x-bit enabled, which I hate very
>    much in Unix-like systems. With it, the colored 'ls' output is not
>    correct for any highlight like .zip .jpg .mp3 etc..
>
> Problem:
>
>    "chmod -x -R *" is not useful because it clears the x-bit of
>    direcotries and forgets all files in sub-directories.
>
>    I checked the man page and hope "chmod -X -R" may help but
>    disappointed. "chomd -X does the same thing as "chomd -x".
>
> Request:
>
>    I believe "chmod -X" should do something different from "chomd -x"
>    so that the -R can be rescued from its misfortune for the special
>    combination with -x.

This isn't really the Unix way of doing things.   Instead of adding
every feature to every tool, there are instead a variety of tools that
can work together to build useful combinations.   In this way one can
achieve things that just would not make sense as features of an
individual program.   In your case you can use find.   You might use
it like this for example:

find . -type f -exec chmod -x {} +

For further information, please read the info manuals for coreutils
and findutils:

info coreutils
info find

James.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]