I think that michaelrozar17 is correct in that you need to quote the expression, but may I ask why "*.*" Do you specifically need files containing a full stop? if not, just a single asterix will suffice or even not specify it, then it matches every file anyway.
It might also be sensible to grow your find to:
Code:
for file in `find . -type f`
... so that you only get files, unless you don't mind getting every directory, link, pipe etc. If you have submounted filesystems, you can exclude them by adding -xdev or -mount depending on your operating system.
Robin
Last edited by rbatte1; 12-03-2010 at 07:45 AM..
Reason: Added section to look for files on and marker to search only current filesystem.
Hi all,
I have a shell script(ksh) which has the code as follows.
------------------
cd $mydir
for i in `find ./ -type f -mtime +$k`
do
echo $i
done
-----------------------
And in $mydir , i have some files which have space in theie names like "Case att15".
The out put of the... (6 Replies)
Hi,
Having a simple issue with find command on Sun. The command works fine if the variable is set to the actual filesystem but fails when the variable is set to a link which is pointing to the same filesystem.
export DUMPDEST=/oradata1/exports/pbm - Set the variable
... (2 Replies)
Hi all, i'm new at shell scripting world...
I'm working on a script for searching old files on a server, this scripts runs with a configuration file wich indicates where to search the files, the script should search for all files that are older than an x qty of days, and the only clue that i have... (9 Replies)
Hi,
I am issuing find command below mentioned ways but it givs different count. I don't understand the behaviour. Could any one have any clue?
$ find . -mtime -5 -maxdepth 1 -exec ls -lrt {} \; | wc -l
169
$ find . -mtime -5 -maxdepth 1 | wc -l
47
$ find . -mtime -5 -maxdepth 1 | wc -l... (2 Replies)
I am currently using below command to get the 1st three characters of a file(PDM). Issue is, when i use find command in root dir, it finds all the files in sub dir also.
How to limit the find command search to a given path only(ie: say only find file in apps/cmplus/datamigration/data path... (3 Replies)
Hi,
I am not root user. I am trying to find the file which has contains pattern "fvsfile" in root directory.
If i run the find cmd then i got permission denied and all the files are listed include pattern files. i cant get file name yet
find . print | xargs grep -i "fvsfile"
I want... (2 Replies)
Hi,
I have created a shell script for Server Log Automation Process. I have used
find xargs grep command to search the string.
for Example,
find -name | xargs grep "816995225" > test.txt .
Here my problem is,
We have lot of records and we want to grep the string... (4 Replies)
Guys,
Here is my requirement..
Sample.cfg
file="*log.gz *txt.gz"
sample.sh
#!/bin/sh
. $HOME/Sample.cfg
find . -name "$file" -mtime +20 -exec ls -la {} \;
Its not finding the given *log.gz and txt.gz files.
Could anyone please help me? (8 Replies)
Hi
I am using the below code to find mv the files.
Files are moving to the Target location as expected but find is displaying some errors like below.
find ./ -name "Archive*" -mtime +300 -exec mv {} /mnt/X/ARC/ \;
find: `./Archive_09-30-12': No such file or directory
find:... (6 Replies)
Hi Guys,
I have a file called error.logs. am just trying to display the content in the file which was modified last 1 day. I tried below command but it doesnt give the proper output.
find /u/text/vinoth/bin "error.logs" -mtime -1 -exec cat {} \; >> mail.txt
Any help is much... (21 Replies)
Discussion started by: Vinoth Kumar G
21 Replies
LEARN ABOUT OPENSOLARIS
setfiles
setfiles(8)setfiles(8)NAME
setfiles - set file SELinux security contexts.
SYNOPSIS
setfiles [-c policy ] [-d] [-l] [-n] [-e directory ] [-o filename ] [-q] [-s] [-v] [-vv|-p] [-W] [-F] spec_file pathname...
DESCRIPTION
This manual page describes the setfiles program.
This program is primarily used to initialize the security context database (extended attributes) on one or more filesystems. This program
is initially run as part of the SE Linux installation process.
It can also be run at any time to correct errors, to add support for new policy, or with the -n option it can just check whether the file
contexts are all as you expect.
It is the same executable as setfiles but operates in a slightly different manner depending on it's argv[0].
OPTIONS -c check the validity of the contexts against the specified binary policy.
-d show what specification matched each file.
-l log changes in file labels to syslog.
-n don't change any file labels.
-p show progress by printing * every 1000 files.
-q suppress non-error output.
-r rootpath
use an alternate root path
-e directory
directory to exclude (repeat option for more than one directory.)
-F Force reset of context to match file_context for customizable files
-o filename
save list of files with incorrect context in filename.
-s take a list of files from standard input instead of using a pathname on the command line.
-v show changes in file labels, if type or role are changing.
-vv show changes in file labels, if type, role, or user are changing.
-p show a progress indication in the form of one dot per 1000 files.
-W display warnings about entries that had no matching files.
-0 Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every char-
acter is taken literally). Disables the end of file string, which is treated like any other argument. Useful when input items
might contain white space, quote marks, or backslashes.The GNU find -print0 option produces input suitable for this mode.
ARGUMENTS
spec_file The specification file which contains lines of the following form
regexp [ -type ] ( context | <<none>> )
The regular expression is anchored at both ends. The optional type field specifies the file type as shown in the mode field by the ls(1)
program, e.g. -- to match only regular files or -d to match only directories. The context can be an ordinary security context or the
string <<none>> to specify that the file is not to have its context changed.
The last matching specification is used. If there are multiple hard links to a file that match different specifications and those specifi-
cations indicate different security contexts, then a warning is displayed but the file is still labeled based on the last matching specifi-
cation other than <<none>>.
pathname...
The pathname for the root directory of each file system to be relabeled. Not used if the -s option is used.
AUTHOR
This man page was written by Russell Coker <russell@coker.com.au>. The program was written by Stephen Smalley <sds@epoch.ncsc.mil>
SEE ALSO load_policy(8), checkpolicy(8)
2002031409 setfiles(8)