LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-21-2005, 07:46 PM   #1
amwink
Member
 
Registered: Mar 2005
Location: Connecticut/USA
Distribution: Ubuntu 9.04
Posts: 68

Rep: Reputation: 15
Unhappy Script to set up permissions


I needed some space in my /home and decided to move a whole tree of files to a FAT partition. However, today I decided to bring those files back to the Linux partition.

Now, here is the problem: all these files became set as "executable" (pdf, mp3, tex, and other formats) after returning to my home dir. This is very annoying because when I type "ls" in konsole, these files appear green, and it is really confusing (I use xterm and konsole a lot, and the colors have always been very meaningful).

If I try something as "chmod -x * -R", then I loose the right to enter in my own dirs and subdirs, and the files' permissions are not corrected because of this.

Does anybody know a way to do a "chmod -x -R", but only for files, not for the directories themselves (maybe a script that enters in each subdir and correct the permissions for the files only)??

Tks in advance

amwink
 
Old 10-21-2005, 08:55 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Code:
find /path/to/toplevel/dir -type f -exec chmod -x {} \;
Check out man find for details on the arguments. It should be relatively straightforward though.
 
Old 10-22-2005, 09:32 AM   #3
amwink
Member
 
Registered: Mar 2005
Location: Connecticut/USA
Distribution: Ubuntu 9.04
Posts: 68

Original Poster
Rep: Reputation: 15
This very simple line worked perfectly!!
Thanks a lot for your help!
amwink
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Execute Permissions? scottlyter Linux - Software 3 10-19-2004 04:42 PM
mysql set permissions GraemeK Linux - Software 2 09-27-2004 08:04 AM
How can I set up xhost permissions again? David the H. Debian 12 07-16-2004 12:01 PM
set user permissions dskny Linux - Security 6 04-13-2004 02:29 PM
How to set Permissions ? jamaso Linux - Newbie 1 12-04-2001 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:55 PM.

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