LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2007, 02:46 AM   #1
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Rep: Reputation: 32
Change file permissions of files in folders


I just copied a backup of several hundred folders from a CD in my /home/user direcorty. Originally, the folders themselves were 700 and the files within were all 644. However, on the CD the folders and the files are all 444 for some reason that I cannot fathom.

In order to correct the problem, I figured that I'd chmod everything to 644 and then chmod the folders to 700 like so:
Code:
chmod 644 -R *
chmod 700 *
However, that did not work because the folders got 644'ed first, and then I did not have write permissions to chmod the files! How can I get out of this mess?

Thanks in advance!
 
Old 05-19-2007, 02:56 AM   #2
dotancohen
Member
 
Registered: Dec 2004
Location: Haifa
Distribution: Fedora Core 4, Kubuntu
Posts: 235

Original Poster
Rep: Reputation: 32
Solved my own problem! I found the X flag, which I did not know about, in the chmod man page. So this did what I need:
Code:
dotancohen@laptop:$ chmod o=r -R *
dotancohen@laptop:$ chmod g=r -R *
dotancohen@laptop:$ chmod u=rwX -R *
dotancohen@laptop:$ chmod 700 *
dotancohen@laptop:$
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
change permissions of all folders and sub folders cad Linux - General 3 01-28-2007 10:21 AM
Change File permissions on numerous files ryanzietlow Linux - General 9 11-03-2006 04:43 PM
permissions of files and folders binary_dreamer Linux - General 2 04-05-2006 11:13 PM
File permissions for web site files/folders mackayr Linux - Networking 1 12-01-2004 11:49 AM
recursive file permissions does not change new files in same directory PAB Linux - Newbie 2 03-08-2004 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:07 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