Welcome to the most active Linux Forum on the web.
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 08-29-2007, 03:59 PM   #1
LQ Newbie
Registered: Aug 2007
Location: santa cruz
Distribution: debian
Posts: 5

Rep: Reputation: 0
I need to change access to over 5000 files in the same directory

I made the mistake of transfering all my audio files while in root. Now I have 5000 files and directories that I cannot access as a non-super-user. Is there a way to change the file permissions in one fell swoop instead of using chmod on every directory and file?
Old 08-29-2007, 04:01 PM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Yeah, recursive chmod'ing.
man chmod
after reading the important lines, which takes about 8 seconds, do this:
chmod -R new_owner /path/to/top/directory
and after that, /path/to/top/directory and all of it's subfolders and files are changed to the ownership of new_owner.
Old 08-29-2007, 04:50 PM   #3
LQ Newbie
Registered: Aug 2007
Location: santa cruz
Distribution: debian
Posts: 5

Original Poster
Rep: Reputation: 0

I looked through the man file but obviously didn't understand it. Thanks so much.
Old 08-29-2007, 04:51 PM   #4
Registered: Jun 2006
Location: Massachusetts
Distribution: Gentoo
Posts: 79

Rep: Reputation: 16
Actually, you want to change the owner of the files, not the permissions.

chown -R new_owner /path/to/top/directory


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
How can I change the prefix of multiple files in a directory 6millionbucks Programming 13 08-01-2007 12:05 PM
Change a string in all files in a directory? Randux Programming 2 05-17-2006 12:47 PM
Which directory contains files that normally change their size frequently? Simon Adebisi Linux - Software 4 06-28-2005 04:37 PM
chmod command to change all files in directory paul_mat Linux - Newbie 2 01-10-2005 10:05 PM
Script to change names of files in a directory geomonap Linux - General 2 12-03-2004 04:04 PM > Forums > Linux Forums > Linux - Newbie

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