Thank you, I tried your suggestion below but i'm getting result as "1"
But when i run the below i get "32" !!
Also, i just realised that in some FTP_FILES folders there are sub-directories named by date and the actual files are in the date directories. The above command just list the directories.. but i need those files to be displayed as well. i know i might be asking some basics here sorry i'm still learning.
Hello my friends,
I need to write a simple shell bad file :D that search and delete a file it's name 'Microsoft.txt' in the current directory and its subdirectories?
So can you help to guide me how i can write this shell, Just give me the beginning :o thank you. (1 Reply)
Hi guys,
I am searching some files not equal to the pattern with this command
find ! -name "PATTERN" -type f
but my problem is the find command because he also search inside subdirectories and that's the thing i don't want that.
Is there any comand to ignore the directories... (4 Replies)
Hi! I want to find files located in subdirectories. I have tried
ls -R | grep myfile
but this won't tell me where the file is, only that it is there.
Any one have a better idea?
Thanks,
--Euclid (3 Replies)
Hi
I have a directory with two subdirectories and also have a code like below to search files modified in last 2 minutes.
# ls
hello080909.txt inbox outbox
# find . -type f -mmin +2
./inbox/hello2080909.txt
./outbox/hi0080909.txt
./hello080909.txt
The above code just searches and... (3 Replies)
Please advice how can we search for a string say (abc) in multiple files and to get total occurrence of that searched string. (Need number of records that exits in period of time).
File look like this (read as filename.yyyymmdd)
a.20100101
b.20100108
c.20100115
d.20100122
e.20100129... (2 Replies)
Hi there,
I'm new to shell scripting...
I've a situation like to find *.tar files under all subdirectories in "/home/abcd" and i used the below,
find /opt/lhapp ! -name "temp" | more
the above works fine.. Now don't need search few direcotries like "/home/abcd/aaaa",... (15 Replies)
Hi all...
I have a directory called dbrn. This directory contains an unknown number of subdirectories which in turn contain an unknown number of files.
What I want to know is:
How many files with extention .ABC can be found in /dbrn across all subdirecties, and what is the total size for... (9 Replies)
Hi Forum,
I am using the below command to find files older than x days in a directory excluding subdirectories. From the previous forums I got to know that prune command helps us not to descend in subdirectories. Though I am using it here, not getting the desired result.
cd $dir... (8 Replies)
findcon(1) General Commands Manual findcon(1)NAME
findcon - SELinux file context search tool
SYNOPSIS
findcon FCLIST [OPTIONS] [EXPRESSION]
DESCRIPTION
findcon allows the user to search for files with a specified context. Results can be filtered by object class as described below.
FCLIST
The findcon tool operates upon a file context list source. There are three valid file context lists.
directory
If FCLIST is a name of a directory then begin the search at that directory and recurse within it. Be sure there are no circular
mounts within it.
file_contexts
If FCLIST is the name of a file_contexts file (e.g., /etc/selinux/strict/contexts/files/file_contexts) then open that file and find
matching entries.
database
If FCLIST is the name of a database as created by a previous run of indexcon or apol then open the database and execute queries into
it.
EXPRESSION
The following options allow the user to specify which files to print. A file must meet all specified criteria. If no expression is pro-
vided, all files are printed.
-t TYPE, --type=TYPE
Search for files with a context containing the type TYPE.
-u USER, --user=USER
Search for files with a context containing the user USER.
-r ROLE, --role=ROLE
Search for files with a context containing the role ROLE.
-m RANGE, --mls-range=RANGE
Search for files with a context with the MLS range of RANGE. Note that findcon ignores the SELinux translation library, if present.
In addition, this flag is ignored if the FCLIST has no MLS information.
--context=CONTEXT
Search for files matching this partial context. This flag overrides -t, -u, -r, and -m.
-p PATH, --path=PATH
Search for files which include PATH.
-c CLASS, --class=CLASS
Search only files of object class CLASS.
OPTIONS
The following additional options are available.
-R, --regex
Search using regular expressions instead of exact string matching. This option does not affect the --class flag.
-h, --help
Print help information and exit.
-V, --version
Print version information and exit.
PARTIAL CONTEXT
The --context flag specifies a partial context, which is a a colon separated list of user, role, and type. If the system supports MLS, the
context may have a fourth field that gives the range. If a field is not specified or is the literal asterisk, then the query will always
match the field.
OBJECT CLASSES
Valid object class strings are
block, char, dir, fifo, file, link, or sock.
NOTE
The findcon utility always operates on "raw" SELinux file contexts. If the system has an installed translation library (i.e., libsetrans),
those translations are ignored in favor of reading the original contexts from the filesystem (if FCFILE is a directory).
EXAMPLES
findcon .
Find every context in the current directory and all of its subdirectories.
findcon -u user_u .
Find every context whose user is user_u in the current directory and all subdirectories.
findcon -u system_u -t bin_t file_contexts
Find entries user system_u and type bin_t within a file_contexts file, assuming that file_contexts is a file contexts file.
findcon --context=system_u::bin_t file_contexts
This is equivalent to the previous example.
findcon --context=system_u:*:bin_t:* file_contexts
This is also equivalent to the above example.
AUTHOR
This manual page was written by Jeremy A. Mowery <jmowery@tresys.com>.
COPYRIGHT
Copyright(C) 2003-2007 Tresys Technology, LLC
BUGS
Please report bugs via an email to setools-bugs@tresys.com.
SEE ALSO replcon(1), indexcon(1)findcon(1)