Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-14-2003, 03:43 PM   #1
LQ Newbie
Registered: Dec 2003
Posts: 15

Rep: Reputation: 0
howto chmod files but not nested dirs?

I am using rox as my filemanager, but it cannot associate applications with filetypes if the file is "executable", so I enter the following command to make all files on my data drive to be "non-executable":

chmod -R -x *

But this command also makes the subdirectories "non-executable", which apparently means "un-readable". So I lock my self out of my subdirectories. For example, if I have a bunch of MP3's organize by music type under a directory called "music", I wont be able to get to the directories inside "music" called "rock", "pop", and "jazz".

So what I have been doing is manually turning the "executable" bit back on for the directories themselves via this command:

chmod +x <dirname>

Is there an easier way to turn on the "x" flag for files, but not for directories, and have it recursively do this on all my files and directories?

Old 12-14-2003, 06:26 PM   #2
Registered: Mar 2003
Location: Berlin
Distribution: Slackware current
Posts: 310

Rep: Reputation: 31
Just looked through the man page and there's no option to ignore directories.

What you can do however is writing a little script that checks whether it is a directory or not before hand ... or search for one on the net.
Old 12-14-2003, 06:29 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,047
Blog Entries: 11

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
find <where/to/start> -type f -exec chmod ugo-x {} \;

This will only touch files, not dirs.

To make dirs readable again,
find <where/to/start> -type d -exec chmod ugo+x {} \;


Last edited by Tinkster; 12-14-2003 at 06:31 PM.
Old 12-19-2003, 06:37 PM   #4
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,811

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Great tip! This has been my only complaint so far with ROX-Filer which otherwise..... ROCKS!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
chkrootkit - suspicious files and dirs Dave Lerner Linux - Security 2 07-09-2005 09:49 AM
invisible files and dirs karmine Slackware - Installation 8 12-26-2004 04:05 PM
Canīt see certain files/dirs in debian partition jimdaworm Slackware 2 10-11-2004 07:54 AM
ls, dirs first, files later TroelsSmit Linux - Newbie 4 05-31-2004 12:47 PM
Cmd to rm dir thats has files and other dirs psyklops Linux - General 4 04-17-2002 09:12 PM

All times are GMT -5. The time now is 06:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration