Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-15-2005, 01:32 PM   #1
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.

Old 09-15-2005, 01:35 PM   #2
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
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
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Use the find command:
find /home/twinkie -type d -exec chmod 777 {} \;
For files, issue a slightly modified command:
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
LQ Newbie
Registered: Apr 2002
Location: Palmdale, CA
Posts: 13

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

Thanks alot.


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 > Forums > Linux Forums > Linux - Newbie

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