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 2778 by Neko on Monday 4th of June 2001 05:02:08 AM
Old 06-04-2001
chmod 777 on all directories below...how do I do that using the "find" command?

I've got 100 directories that each have 2 directories with in them.
Structered like this:
/home/domains/domain1/
through to
/home/domains/domain100/

and those 2 directories mentioned above are here:
/home/domains/domain1/directory1/
/home/domains/domain1/directory2/
through to
/home/domains/domain100/directory1/
/home/domains/domain100/directory2/

I need to chmod 777 on /directory1/ and /directory2/

How can I do this really quickly using the find command?
I had to chmod 755 on .cgi files in those directories and I did that using this command:

find . -name "*.cgi" -exec chmod 755 {} \;

How do I modify that command to chmod 777 on all directories but not the files in those directories?
 

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
dircmp(1)						      General Commands Manual							 dircmp(1)

NAME
dircmp - Compares two directories SYNOPSIS
dircmp [-d] [-s] directory1 directory2 The dircmp command reads directory1 and directory2, compares their contents, and writes the results to standard output. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: dircmp: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Displays for each common file name the differing contents of the two files, if any. The display format is the same as that of the diff command. Does not list the names of identical files. OPERANDS
The path name of a directory to be compared. DESCRIPTION
First, dircmp compares the file names in each directory. When the same file name appears in both, dircmp compares the contents of the two files. In the output, dircmp lists the files unique to each directory. It then lists the files with identical names but different contents. If entered without a option, dircmp also lists files that have both identical names and identical contents. NOTES
[Tru64 UNIX] In many cases, diff -r, rather than dircmp, is preferred. The dircmp command is marked LEGACY. The diff -r command should be used instead. EXAMPLES
To summarize the differences between the files in two directories, enter: dircmp proj.ver1 proj.ver2 This displays a summary of the differences between the directories proj.ver1 and proj.ver2. The summary lists separately the files found only in one directory or the other, and those found in both. If the file is found in both directories, the file is listed. If the files are identical, dircmp displays identical; otherwise, dircmp displays different. To show the details of the differences between files, enter: dircmp -d -s proj.ver1 proj.ver2 The -s option suppresses information about identical files. The -d option displays a diff listing for each of the differing files found in both directories. SEE ALSO
Commands: cmp(1), diff(1) Standards: standards(5) dircmp(1)
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy