|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Is there a command I can use to change the permissions of every file in a certain directory? I unpacked a gzip file containing 10,000+ images which were created with permission 444 by the extractor program. I need them all to have permission 644.
How can this be done from the commandline? Thanks! |
|
#2
|
|||
|
|||
|
The quickest way to find stuff like this is in the man pages.
man chmod then hit the "/" and type in "recurs" followed by enter to search the manpage for something about recursive chmods. You should find the -R switch. chmod -R 644 /dir -- no stress. if you do not need to chmod any subdirectories (hence recursion), then using globs works too. chmod 644 /dir/* |
|
#3
|
|||
|
|||
|
Thanks!
This is on a hosted server so we don't have access to the man pages. ![]() |
|
#4
|
|||
|
|||
|
Well that blows! How the hell are you supposed to get anywhere without the manpages? Are they at least available in HTML format?
check here, the Linux and Solaris specific pages are available too. http://mirrors.ccs.neu.edu/cgi-bin/unixhelp/man-cgi |
|
#5
|
|||
|
|||
|
I am getting an "argument list too long" error when I try "chmod 664 *.jpg".
One directory had about 5,000 files, and that worked okay, but the second directory I tried with 13,000+ files gave me the argument length error. ![]() |
|
#6
|
|||
|
|||
|
well, I am not sure if that is some sort of memory/buffer restriction or what. The quickest way to get around that will be to tighten up your globs. For example, you could do all the a*.jpg first. Or you could use a regex to do a-h or so. It is almost a job that warrants a small bash or perl script...
.BTW, did you try the -R. That might open things up a bit..since it is used for entire branches of the directory tree. (but be careful! ) |
|
#7
|
|||
|
|||
I think I am going to segregate the files on my end and then re-upload them. It would be easier to write a PHP script to modify our database and the location of our files than to bother with doing with every time we have to do another upload. |
|
#8
|
|||
|
|||
|
why don't you set up a mask and then copy the whole directory with a different name.
|
|
#9
|
|||
|
|||
|
That sounds good.., I'd be interested to know if it successfully avoids bottleneck that chmod suffers. What worked nuLime?
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > How do I change all permissions in one dir? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|