one line command to change mode only if necessary


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting one line command to change mode only if necessary
# 8  
Old 03-01-2012
I'll bite:
Code:
find . -type f  ! -perm 554 -exec chmod 554 {} \;

This User Gave Thanks to gary_w For This Post:
# 9  
Old 03-01-2012
...we tried hard to make the person search a bit and you gave the answer away...Smilie
well, still waiting an answer about timestamp...Smilie
# 10  
Old 03-01-2012
Sorry. Smilie
# 11  
Old 03-01-2012
Smilie Smilie
# 12  
Old 03-01-2012
Gary, that was exactly what i needed, thank you.

Regarding why i am doing this, when chmod is done the 'c' attribute (ls -ltc) gets updated and i don't want this to be changed for those files that are already have the correct permissions.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

How to start Fedora 11 in command line mode and skip damaged programs ??

Hi All, Please let me know that how to start Fedora 11 in command line mode and skip damaged programs ?? Scenario being: I have Fedora 11 ( pretty ole... eh !! ). If I try to start the PC , then after some steps of startup... it just hangs and does not boots. I tried entering the mode... (4 Replies)
Discussion started by: dipanchandra
4 Replies

2. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

3. UNIX for Advanced & Expert Users

What is the difference between single line mode and multiline mode in Regular expressions?

Hi All, Can please let me know what is the difference between the single line mode and multi line mode in regular expresions? Thanks, Chidhambaram B (3 Replies)
Discussion started by: chidhu.anu
3 Replies

4. Shell Programming and Scripting

Change filename extensions..from command line

I want to change the extensions of a folder full of files (some of the files are located in subfolders as well) to another extension, but instead of replacing the files I want the new files to be copied into a newly created folder. Here is the folder structure: /Downloads/3eb... (3 Replies)
Discussion started by: bound4h
3 Replies

5. Shell Programming and Scripting

Using sed command to change end of line

I am looking to change a data file into a javascript string and this is the code that I am using: sed -i '' -e 's/^/str += "/' -e 's/$/";/' file.xml The first part -e 's/^/str += "/' works as intended, but the second part -e 's/$/";/' adds an additional newline to my file, so that instead of... (3 Replies)
Discussion started by: figaro
3 Replies

6. UNIX for Advanced & Expert Users

How to change size of command line in unix

Hi, I'm trying to execute my program from $prompt by passing many parameters which is more than 300 charecters in line but unix not accepting those many charecters, could some one help me how to increase the size? thanks (7 Replies)
Discussion started by: krishna
7 Replies

7. UNIX for Dummies Questions & Answers

Insert line break in vi's command mode

Hi, When working in vi, the CTRL+j command for merging lines is very convenient. Is there an equivalent for splitting them (inserting a line break)? I often find myself pressing "i" + "return" + "esc", which I find a bit lengthy. Thanks in advance! (3 Replies)
Discussion started by: Skogsmulle
3 Replies

8. UNIX for Dummies Questions & Answers

How do I change IP addresses in command mode...

How do I change IP addresses in command mode? i need to assign custom (non DHCP) addresses from the command line. Actually I also need to know how to change the subnet mask, the gateway and the primary, secondary, ... dns servers. (6 Replies)
Discussion started by: Super.Anyak
6 Replies

9. Linux

How change GRUB command line to graphical interface?

Hi, I am i new Unix linux user. I've installed the linux 9 and i uninstall it. the first time i install the linux, the GRUB show the graphical interface. But after i reinstall it again, the GRUB change to command line. I can't boot my comp now. What should I do? And i don't know how to deal with... (4 Replies)
Discussion started by: lee_chongeu
4 Replies

10. Shell Programming and Scripting

How to change the GRUB command line to graphical interface?

Hi, I am i new Unix linux user. I've installed the linux 9 and i uninstall it. the first time i install the linux, the GRUB show the graphical interface. But after i reinstall it again, the GRUB change to command line. I can't boot my comp now. What should I do? And i don't know how to deal with... (1 Reply)
Discussion started by: lee_chongeu
1 Replies
Login or Register to Ask a Question