Sponsored Content
Top Forums UNIX for Dummies Questions & Answers "-maxdepth 1" argument for Solaris find. Other way to restrict find in only one directory? Post 302574367 by Scott on Thursday 17th of November 2011 07:14:38 AM
Old 11-17-2011
Ah! And not even /usr/xpg4/bin/find can help us. My ability to master some of the find command options is limited!

So here's a quick hack that might work, but it means replacing exec with xargs.

Code:
# find ./tmp/* -name file1 | grep -v /tmp/[^/]*/
./tmp/file1
#                                              
# mkdir tmp2
# find ./tmp/* -name file1 | grep -v /tmp/[^/]*/ | xargs -n1 -I{} mv {} tmp2
# ll tmp2
total 18
drwxr-xr-x   2 root     root         512 Nov 17 13:13 .
drwxr-xr-x  22 root     root        7680 Nov 17 13:13 ..
-rw-r--r--   1 root     root           0 Nov 17 13:09 file1

Code:
# uname -a
SunOS sol10 5.10 Generic_141445-09 i86pc i386 i86pc

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies

2. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

3. Shell Programming and Scripting

Error to "find" a matching array element in a directory

Hi, I have defined an array which holds a couple of elements which are nothing but files names. I want to find the files in a directory for the matching file name(array elements) with less than 1 day old. When I am trying to execute the code (as below), it gives an error. Your help in this... (1 Reply)
Discussion started by: mkbaral
1 Replies

4. Solaris

Find all "regular" files open for write on solaris?

How do I find all "regular" files on solaris(8) that are open for write ( +read as well). I tried using pfiles, and lsof commands, but not sure how to get exactly what I wanted. ps -e | awk '{ print $1 }' | xargs -i pfiles {} 2>/dev/null (10 Replies)
Discussion started by: kchinnam
10 Replies

5. Shell Programming and Scripting

find error?? find / -name "something.txt" 2>/dev/null

why is this giving me errors? i type this in: find / -name "something.txt" 2>/dev/null i get the following error messages: find: bad option 2 find: path-list predicate-list :confused: (5 Replies)
Discussion started by: magiling
5 Replies

6. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

7. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

8. UNIX for Dummies Questions & Answers

find/xargs/*grep: find multi-line empty "try-catch" blocks - eg, missing ; not in a commented block

How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases? This would seem to involve find, xargs, *grep, regex, etc. In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies

9. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

10. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies
swift_selinux(8)					       SELinux Policy swift						  swift_selinux(8)

NAME
swift_selinux - Security Enhanced Linux Policy for the swift processes DESCRIPTION
Security-Enhanced Linux secures the swift processes via flexible mandatory access control. The swift processes execute with the swift_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. For example: ps -eZ | grep swift_t ENTRYPOINTS
The swift_t SELinux type can be entered via the swift_exec_t file type. The default entrypoint paths for the swift_t domain are the following: /usr/bin/swift-object-info, /usr/bin/swift-object-server, /usr/bin/swift-account-reaper, /usr/bin/swift-account-server, /usr/bin/swift-con- tainer-sync, /usr/bin/swift-object-auditor, /usr/bin/swift-object-updater, /usr/bin/swift-account-auditor, /usr/bin/swift-container-server, /usr/bin/swift-container-auditor, /usr/bin/swift-container-updater, /usr/bin/swift-object-replicator, /usr/bin/swift-account-replicator, /usr/bin/swift-container-replicator PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux swift policy is very flexible allowing users to setup their swift pro- cesses in as secure a method as possible. The following process types are defined for swift: swift_t Note: semanage permissive -a swift_t can be used to make the process type swift_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. swift policy is extremely flexible and has several booleans that allow you to manipulate the policy and run swift with the tightest access possible. If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server, you must turn on the authlo- gin_nsswitch_use_ldap boolean. Disabled by default. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow all daemons to write corefiles to /, you must turn on the daemons_dump_core boolean. Disabled by default. setsebool -P daemons_dump_core 1 If you want to enable cluster mode for daemons, you must turn on the daemons_enable_cluster_mode boolean. Enabled by default. setsebool -P daemons_enable_cluster_mode 1 If you want to allow all daemons to use tcp wrappers, you must turn on the daemons_use_tcp_wrapper boolean. Disabled by default. setsebool -P daemons_use_tcp_wrapper 1 If you want to allow all daemons the ability to read/write terminals, you must turn on the daemons_use_tty boolean. Disabled by default. setsebool -P daemons_use_tty 1 If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to allow confined applications to run with kerberos, you must turn on the kerberos_enabled boolean. Enabled by default. setsebool -P kerberos_enabled 1 If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. setsebool -P nis_enabled 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Disabled by default. setsebool -P nscd_use_shm 1 NSSWITCH DOMAIN
If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server for the swift_t, you must turn on the authlogin_nsswitch_use_ldap boolean. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow confined applications to run with kerberos for the swift_t, you must turn on the kerberos_enabled boolean. setsebool -P kerberos_enabled 1 MANAGED FILES
The SELinux process type swift_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. cluster_conf_t /etc/cluster(/.*)? cluster_var_lib_t /var/lib/pcsd(/.*)? /var/lib/cluster(/.*)? /var/lib/openais(/.*)? /var/lib/pengine(/.*)? /var/lib/corosync(/.*)? /usr/lib/heartbeat(/.*)? /var/lib/heartbeat(/.*)? /var/lib/pacemaker(/.*)? cluster_var_run_t /var/run/crm(/.*)? /var/run/cman_.* /var/run/rsctmp(/.*)? /var/run/aisexec.* /var/run/heartbeat(/.*)? /var/run/cpglockd.pid /var/run/corosync.pid /var/run/rgmanager.pid /var/run/cluster/rgmanager.sk root_t / /initrd swift_data_t /srv/node(/.*)? /srv/loopback-device(/.*)? swift_tmp_t swift_var_cache_t /var/cache/swift(/.*)? swift_var_run_t /var/run/swift(/.*)? FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type. You can see the context of a file using the -Z option to ls Policy governs the access confined processes have to these files. SELinux swift policy is very flexible allowing users to setup their swift processes in as secure a method as possible. STANDARD FILE CONTEXT SELinux defines the file context types for the swift, if you wanted to store files with these types in a diffent paths, you need to execute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk. semanage fcontext -a -t swift_data_t '/srv/swift/content(/.*)?' restorecon -R -v /srv/myswift_content Note: SELinux often uses regular expressions to specify labels that match multiple files. The following file types are defined for swift: swift_data_t - Set files with the swift_data_t type, if you want to treat the files as swift content. Paths: /srv/node(/.*)?, /srv/loopback-device(/.*)? swift_exec_t - Set files with the swift_exec_t type, if you want to transition an executable to the swift_t domain. Paths: /usr/bin/swift-object-info, /usr/bin/swift-object-server, /usr/bin/swift-account-reaper, /usr/bin/swift-account-server, /usr/bin/swift-container-sync, /usr/bin/swift-object-auditor, /usr/bin/swift-object-updater, /usr/bin/swift-account-auditor, /usr/bin/swift-container-server, /usr/bin/swift-container-auditor, /usr/bin/swift-container-updater, /usr/bin/swift-object-replicator, /usr/bin/swift-account-replicator, /usr/bin/swift-container-replicator swift_tmp_t - Set files with the swift_tmp_t type, if you want to store swift temporary files in the /tmp directories. swift_unit_file_t - Set files with the swift_unit_file_t type, if you want to treat the files as swift unit content. swift_var_cache_t - Set files with the swift_var_cache_t type, if you want to store the files under the /var/cache directory. swift_var_run_t - Set files with the swift_var_run_t type, if you want to store the swift files under the /run or /var/run directory. Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), swift(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) swift 14-06-10 swift_selinux(8)
All times are GMT -4. The time now is 03:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy