LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-15-2005, 01:32 PM   #1
zolo44
LQ Newbie
 
Registered: Apr 2002
Location: Palmdale, CA
Posts: 13

Rep: Reputation: 0
Unhappy dumn chmod question..


I'm in the process of untaring a file but as i do that all the files including the directories don't have the permissions that i need.

I mean, i need the directories to have 777 and the files, well the files need to be at least 644. Now, i know i can do this manually, but there are hundreds of directories under directories that i would need to do...

Now, my question is that if there a command that i can do to change them all?

My umask is: 022, and i'm under fedora core 1.

Any help will be appreciated.

Thanks
 
Old 09-15-2005, 01:35 PM   #2
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
the "-R" flag makes it recursive (be careful - it's fairly indescriminate!)

ie "chmod -R 777 /home/twinkie" would make ~/twinkie and every subdirectory (and file) 777
 
Old 09-15-2005, 01:37 PM   #3
zolo44
LQ Newbie
 
Registered: Apr 2002
Location: Palmdale, CA
Posts: 13

Original Poster
Rep: Reputation: 0
right, but i don't want to make the files 777 just the directories. Wondering if this can be done?
 
Old 09-15-2005, 03:07 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Use the find command:
Code:
find /home/twinkie -type d -exec chmod 777 {} \;
For files, issue a slightly modified command:
Code:
find /home/twinkie -type f -exec chmod 644 {} \;
You can get fancier with the options to find. Specifically, you could tell it to find only files that don't already have the permissions you want. As it is, the commands above will execute the chmod regardless of the current permissions.

The find command: learn it, live it, love it.
 
Old 09-15-2005, 03:36 PM   #5
zolo44
LQ Newbie
 
Registered: Apr 2002
Location: Palmdale, CA
Posts: 13

Original Poster
Rep: Reputation: 0
that worked like a charm.

Thanks alot.
 
  


Reply


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
chmod question Napalm Llama Linux - General 2 06-17-2005 09:17 AM
chmod question tongar Linux - Newbie 2 01-30-2005 02:43 PM
chmod -R question spooge Linux - General 2 01-13-2005 02:58 PM
chmod question odious1 Linux - General 1 11-28-2003 11:41 PM
Question regarding chmod Yohhan Linux - Software 3 01-26-2003 02:24 AM

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

All times are GMT -5. The time now is 07:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration