Sponsored Content
Operating Systems Linux Red Hat Find and Chown all files in a DIR except for Root Post 302823761 by alister on Wednesday 19th of June 2013 08:19:34 PM
Old 06-19-2013
If there are already a lot of files in that hierarchy that are user1:group1, you can use a negated -group with find to avoid pointless chowns (unless you want to update their ctime timestamps).

You can also improve efficiency by using -exec...+ instead of -exec...\;.

Regards,
Alister
This User Gave Thanks to alister For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Setuid root and chown

I am trying to run chown and chmod from a script owned by root. The permissions are set to 4755 so that users can execute the script as root. However, when I run the script as a user other than root, I get "Operation not permitted" for both chown and chmod. Any ideas as to why this is? (6 Replies)
Discussion started by: johnmsucpe
6 Replies

2. UNIX for Dummies Questions & Answers

root dir ? home dir ?

I am little bit confused when the words "root directory" and "home directory" and "parent directory" are used. Can anybody explains the difference. I am trying to list the names and protections levels and size of visible files in the root directory would it be correct if I just typed: ls... (2 Replies)
Discussion started by: hinman
2 Replies

3. UNIX for Dummies Questions & Answers

Find and purge a files in a dir

HI All, I have recuirement to purge the files in a directory . In that directory i an having many sub-directory . When i use find command like find ~/work/test/insert -name "*.*" -mtime +12 it is listing the file not accesed before 12 , It also takes the subdirectories inside the... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies

4. Shell Programming and Scripting

How to find sticky bit dir/files

I need to find all sticky bit dir/files on my system and clean them up if necessary. How to I write a script to do this? Thanks. (2 Replies)
Discussion started by: pdtak
2 Replies

5. UNIX for Dummies Questions & Answers

chown -R under root directory

Hi I executed command "chown -R xxx:xxx /" with user root... and it was too late when I found the mistake. Ownership of some files under the root directory had already become xxx:xxx. Is there a way that can recovery the ownership of all my files back to the point where they were? I really thanks. (2 Replies)
Discussion started by: password636
2 Replies

6. UNIX and Linux Applications

CPIO Problem, copy to the root dir / instead of current dir

HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file! I tried all these commands cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies

7. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

8. Shell Programming and Scripting

what is the find command to find exact dir from the root

I want to find a dir called STOP from the root.so what is the find command. Thanks & Regards Rajkumar (1 Reply)
Discussion started by: rajkumar_g
1 Replies

9. UNIX for Dummies Questions & Answers

chown: Operation not permitted as root

Hi Expert, I am trying to change ownership of one file to another user that is exist in the system but getting operation not permitted error what could be the correct way? # ls -lh .Xauthority_ori -rw------- 1 maxim atlas 2.8K Jul 27 17:18 .Xauthority_ori # id -a uid=0(root)... (8 Replies)
Discussion started by: regmaster
8 Replies

10. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies
KNEWSD(1)						      General Commands Manual							 KNEWSD(1)

NAME
knewsd - a tiny nntp demon SYNOPSIS
knewsd [ options ] DESCRIPTION
Knewsd is intended to be used with knews(1) to read news (in)directly from the spool directory or even from a mail folder hierarchy. It reads NNTP commands from standard input and writes replies to standard output. The following commands are implemented: ARTICLE [number] BODY [number] HEAD [number] Return the head and/or body of the current or the specified article. Message-id lookups are not supported. GROUP newsgroup Enters the given newsgroup. HELP Gives a list of the implemented commands. LIST [active | newsgroups] Lists the active file or the newsgroups file. NEXT Changes the current article pointer to the next article POST Post an article via the specified posting agent. If none has been specified, the reply will be '440 Posting not implemented.' QUIT Makes knewsd exit. STAT number Sets the current article pointer. XOVER range Returns the overview data for the specified range of articles. Knewsd implements the 'xover' command either by using the overview files if present, or creating overview records on the fly, or a combina- tion of both if the overview file is incomplete. In the latter case, if the -update flag is given, knewsd will update the overview files. OPTIONS
There is no need to spell out the entire option name, it is sufficient to give a unique prefix, such as -a for -active. -spool directory This is the spool directory. It must be specified, either at compile time or at run time. -active file This is the active file containing the newsgroups and the high and low article counts. If this is not specifed, knews must be told not to try to read the active file. -newsgroups file This is the newsgroups file containing the group descriptions. It's entirely optional. -overview dir This can be used if the overview files reside in a different directory hierarchy than the spool directory. -update If this is set, knewsd will (try to) update any incomplete overview files it encounters. Not a good idea if you're reading a system wide spool directory. -postingagent agent If this is set, the 'agent' will be used to post articles. A possible agent is 'exec inews -h'. This command is interpreted by the shell, and it is important that it is exec'ed, so that knewsd may kill it on a broken pipe to prevent posting of duplicate or trun- cated articles. Knewsd will warn about this on startup. AUTHOR
This software is Copyright 1995, 1996 by Karl-Johan Johnsson. SEE ALSO
knews(1), inews(1) 1996 KNEWSD(1)
All times are GMT -4. The time now is 10:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy