mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2007-09-04, 15:17   #1
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

3×7×167 Posts
Default I want to change every file and dir to chmod xx0

At first the title was 'I want to change every file and dir to chmod 770.' Then, I realized that might not be such a good idea.

So, assuming x means that number stays what it is, is there an easy way to change everything on my Linux box to 'chmod xx0'?
jasong is offline   Reply With Quote
Old 2007-09-04, 15:24   #2
Patrick123
 
Patrick123's Avatar
 
Jan 2006
JHB, South Africa

157 Posts
Default

Hi Jasong,

The option you are looking for is -R.

chmod -R xx0 *


x is as you defined it.

This would change all files, sub-directories & files within the current sub-directory.

Regards
Patrick

Last fiddled with by Patrick123 on 2007-09-04 at 15:32
Patrick123 is offline   Reply With Quote
Old 2007-09-04, 16:59   #3
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

2×17×251 Posts
Default

Use with caution!

Xyzzy is offline   Reply With Quote
Old 2007-09-04, 21:22   #4
gribozavr
 
gribozavr's Avatar
 
Mar 2005
Internet; Ukraine, Kiev

11×37 Posts
Default

You might also want to do a chmod -R +X directory if you want your directories to have execute permission, so you can chdir() into them.
gribozavr is offline   Reply With Quote
Old 2007-09-05, 08:48   #5
patrik
 
patrik's Avatar
 
"Patrik Johansson"
Aug 2002
Uppsala, Sweden

52·17 Posts
Default

I think you want

chmod -R o= .

(or chmod -R o-rwx . if the chmod doesn't support = ; SunOS doesn't IIRC)
This changes the current dir and its sub-dirs. Using * will miss files starting with a dot and the current directory.
patrik is offline   Reply With Quote
Old 2007-09-05, 13:12   #6
Patrick123
 
Patrick123's Avatar
 
Jan 2006
JHB, South Africa

157 Posts
Default

Quote:
Originally Posted by Xyzzy View Post
Use with caution!

I agree, This can lock you out of your system completely, or.. open it up for any Tom, Dick, or Harry.

SCO Unix, has the fixmog and integrity commands to ensure correct & safe permissions. Is there anything similar in Linux?

Regards
Patrick

Last fiddled with by Patrick123 on 2007-09-05 at 13:12
Patrick123 is offline   Reply With Quote
Old 2007-09-05, 21:29   #7
jasong
 
jasong's Avatar
 
"Jason Goatcher"
Mar 2005

1101101100112 Posts
Default

Code:
chmod -R o=-r-w-x *
No idea what the star does, for a moment I thought it meant look at the end of the post for a clarification.
jasong is offline   Reply With Quote
Old 2007-09-05, 21:50   #8
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

215616 Posts
Default

Quote:
No idea what the star does, for a moment I thought it meant look at the end of the post for a clarification.
It is a wildcard.

http://en.wikipedia.org/wiki/Wildcar...cter#Computing
Xyzzy is offline   Reply With Quote
Old 2007-09-05, 21:52   #9
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

2·17·251 Posts
Default

Quote:
SCO Unix, has the fixmog and integrity commands to ensure correct & safe permissions. Is there anything similar in Linux?
Probably, although we are not aware of it.

We just use common sense and experience to guide us.

Understanding file permissions helps, too.

Xyzzy is offline   Reply With Quote
Old 2007-09-07, 20:32   #10
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

111516 Posts
Default

Quote:
Originally Posted by Patrick123 View Post
I agree, This can lock you out of your system completely, or.. open it up for any Tom, Dick, or Harry.

SCO Unix, has the fixmog and integrity commands to ensure correct & safe permissions. Is there anything similar in Linux?

Regards
Patrick
tripwire? I guess it's similar

Last fiddled with by paulunderwood on 2007-09-07 at 20:53
paulunderwood is offline   Reply With Quote
Old 2007-09-08, 06:15   #11
Patrick123
 
Patrick123's Avatar
 
Jan 2006
JHB, South Africa

157 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
tripwire? I guess it's similar
You'd need to run tripwire on the virgin system first.

The other option is to use the rpm command with the with the setperms option for each package installed.
Patrick123 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Name Change? Fred Lounge 8 2016-01-31 17:42
How can I change worktype? Andriy Information & Answers 1 2009-06-20 12:39
User name change not reflected in BAD file GP2 Data 3 2006-01-15 14:32
How Can I Change The Computer ID tmorrow PrimeNet 5 2004-05-18 11:53
How to change Pxxxx.001 file to Pxxxx file? edorajh Software 3 2003-12-31 12:30

All times are UTC. The time now is 04:12.


Fri Dec 2 04:12:47 UTC 2022 up 106 days, 1:41, 0 users, load averages: 0.93, 0.93, 0.90

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔