Sponsored Content
Top Forums UNIX for Dummies Questions & Answers chmod 777 on all directories below...how do I do that using the "find" command? Post 2779 by alwayslearningunix on Monday 4th of June 2001 06:26:12 AM
Old 06-04-2001
It's clear the "domain" directory is not a universal name and so it's hard to use one find command to chmod all the directories under these "domain" directories - I am presuming you don't want the actual "domain" directories chmodded?

If there are no other directories, other than the ones you wish to operate the chmod command on, in /home/domains you can issue this command:

find /home/domains/*/ -type d -exec chmod 777 {} \;

Which will chmod all the directories under all the directories under /home/domains/domains1-100 - if you get what I mean Smilie

Another way to do it is to make a file which contains all the directory names under /home/domains under which you want the directories chmodded - which you may have if this is a commercial hosting service (an administration file of users/domain names would contain this information).

Put that file in the directory from which you can then issue this command on the command line;

filelist=the file with the list of directories
[cr] = carriage return:

for x in `cat filelist` [cr]
do [cr]
find /home/domains/$x/ -type d -exec chmod 777 {} \; [cr]
done [cr]

Hope this helps.

Regards

alwayslearningunix
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Listing only directories in the current working directory using the "ls" command

Hello All, I am trying to list only directories in my current directory using the command "ls -d". But the output only contains the default directory "." and doesn't list the rest of the directories in the working directory. Can anyone explain why this is happening (2 Replies)
Discussion started by: igandu
2 Replies

2. Shell Programming and Scripting

bash: cd command to access "strange" directories

I have a problem using bash. Simply, I cannot find the right command (if there's one!) to enter in the "- Arch_02 -" directory. As you can see, the name begins with a hyphen and this is causing some trouble: localhost arch2 # pwd /mnt/arch2 localhost arch2 # ls -l total 4 dr-x------ 1 root... (3 Replies)
Discussion started by: robotronic
3 Replies

3. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

4. UNIX for Dummies Questions & Answers

Using "find" in restricted directories

Hi, I would like to know is there any way to find/search filenames or directories inside the directories which has resticted permission. When we use normal "find" command it returns "permission denied" message for the root directories or directories with restricted permissions. Thanks (2 Replies)
Discussion started by: forstudy3
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

7. AIX

find command to list all the 777 files and directories owned by root user

Hi I'm logged in to an AIX box now and we need to do an audit on this box. cbssapr01:# pwd / Which command will show all the files and directories owned by root user with permissions as 777 ? (8 Replies)
Discussion started by: newtoaixos
8 Replies

8. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

9. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

10. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies
asadmin-list-domains(1AS)					   User Commands					 asadmin-list-domains(1AS)

NAME
asadmin-list-domains, list-domains - lists the domains in the given domains directory SYNOPSIS
list-domains [--domaindir install_dir/domains] [--terse=false] [--echo=false] list-domains lists the domains in the given domains directory. This command is supported in local mode only. OPTIONS
--domaindir directory where the domains are located. If specified, path must be accessible in the filesystem. If not specified, the domains in the default install_dir/domains directory are listed. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. Example 1: Using list-domains asadmin> list-domains List of domains: domain1 running samples not running Where: the domain1 and samples are listed and their status printed. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-domain(1AS), asadmin-delete-domain(1AS), asadmin-start-domain(1AS), asadmin-stop-domain(1AS) J2EE 1.4 SDK March 2004 asadmin-list-domains(1AS)
All times are GMT -4. The time now is 07:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy