Sponsored Content
Full Discussion: Help with find -perm option
Top Forums Shell Programming and Scripting Help with find -perm option Post 302514093 by stevensw on Thursday 14th of April 2011 08:09:58 PM
Old 04-14-2011
Help with find -perm option

How to find all files for instance that match the permission rwxr*x--- where * is a wildcard which can be optionally asserted but all the others must match? Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find -perm query

I was going through a find tutorial and just couldn't get it...can someone explain it like he/she would explain a brain damaged dodo? "find allows you to specify a pattern that can be bit-wise ANDed with the permissions of the file. Simply put a minus sign before the octal value. The group write... (1 Reply)
Discussion started by: napolayan
1 Replies

2. Shell Programming and Scripting

Wild card in find perm

Hi, Is there a way to use find command to list the directories for certain permissions. I know we can use find . -type d -perm nnn, where nnn is the permission number . However I wold like to know if I wanna search for wild card permissions i.e 75* / 7* / 55* , as i do not know the actual... (1 Reply)
Discussion started by: braindrain
1 Replies

3. UNIX for Dummies Questions & Answers

Find and EXECDIR option

Hello, I was reading the man pages of find and it says that the -exec option should not be used. I read the following about the recommended option, -execdir: -execdir command {} + Like -exec, but the specified command is run from the subdirec‐ tory containing... (1 Reply)
Discussion started by: mojoman
1 Replies

4. Shell Programming and Scripting

find with prune option

Hi, I want to list files only from the current dir and its child dir (not from child's child dir). i have the following files, ./ABC/1.log ./ABC/2.log ./ABC/ABC1/A.log ./ABC/ABC1/B.log ./ABC/ABC1/XYZ/A1.log ./ABC/ABC1/XYZ/A2.log Here i want to list only the log file from current... (1 Reply)
Discussion started by: apsprabhu
1 Replies

5. Shell Programming and Scripting

Find in Bash with -a option

Hi, The proble is below: Assume i have files starting from "process" then date/time then ".log". ex . process.20100504092942.log process.20100503152213.log process.20100430144217.log process.20100429153644.log process.20100428121200.log process.20100427130746.log... (2 Replies)
Discussion started by: meetvipin
2 Replies

6. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

7. Shell Programming and Scripting

find -regex option

I'm trying to use regular expression arguments as variables. I have to surround the regular expression with double quotes or else it automatically expands that regular expression to whatever is in that directory. Unfortunately when I run 'find' it further surrounds the double quotes with single... (6 Replies)
Discussion started by: stevensw
6 Replies

8. UNIX for Dummies Questions & Answers

find with prune option help needed

Hello, I am using ksh93 (/usr/dt/bin/dtksh) on Solaris and am stuck when trying to use find with the -prune option. I need to search a directory (supplied in a variable) for files matching a certain pattern, but ignore any sub-directories. I have tried: find ${full_path_to_dir_to_search}... (9 Replies)
Discussion started by: gary_w
9 Replies

9. UNIX for Dummies Questions & Answers

find with mtime option

Hi, Please give me more details on the following examples, about "mtime" option. When I try this, I could not get the expected output, please help. find . -mtime -1 -print find . -mtime +1 -print find . -mtime 1 -print How do I get the files modified between two dates, say from... (4 Replies)
Discussion started by: Dev_Dev
4 Replies

10. UNIX for Dummies Questions & Answers

How to find directory listing from root to all files in tree format with details of perm/own/grp?

Hi, My apologies if my query is already available on this forum but I am new and could not find. I need a script to list all directories/sub directories and files with permissions/groups/owners. The script would run from home directory and should capture every directory. How do I do this? ... (4 Replies)
Discussion started by: 8709711
4 Replies
filelib(3erl)						     Erlang Module Definition						     filelib(3erl)

NAME
filelib - File utilities, such as wildcard matching of filenames DESCRIPTION
This module contains utilities on a higher level than the file module. The module supports Unicode file names, so that it will match against regular expressions given in Unicode and that it will find and process raw file names (i.e. files named in a way that does not confirm to the expected encoding). If the VM operates in Unicode file naming mode on a machine with transparent file naming, the fun() provided to fold_files/5 needs to be prepared to handle binary file names. For more information about raw file names, see the file module. DATA TYPES
filename() = string() | atom() | DeepList | RawFilename DeepList = [char() | atom() | DeepList] RawFilename = binary() If VM is in unicode filename mode, string() and char() are allowed to be > 255. RawFilename is a filename not subject to Unicode translation, meaning that it can contain characters not conforming to the Unicode encoding expected from the filesystem (i.e. non-UTF-8 characters although the VM is started in Unicode filename mode). dirname() = filename() EXPORTS
ensure_dir(Name) -> ok | {error, Reason} Types Name = filename() | dirname() Reason = posix() -- see file(3erl) The ensure_dir/1 function ensures that all parent directories for the given file or directory name Name exist, trying to create them if necessary. Returns ok if all parent directories already exist or could be created, or {error, Reason} if some parent directory does not exist and could not be created for some reason. file_size(Filename) -> integer() The file_size function returns the size of the given file. fold_files(Dir, RegExp, Recursive, Fun, AccIn) -> AccOut Types Dir = dirname() RegExp = regular_expression_string() Recursive = true|false Fun = fun(F, AccIn) -> AccOut AccIn = AccOut = term() The fold_files/5 function folds the function Fun over all (regular) files F in the directory Dir that match the regular expression RegExp (see the re module for a description of the allowed regular expressions). If Recursive is true all sub-directories to Dir are processed. The regular expression matching is done on just the filename without the directory part. If Unicode file name translation is in effect and the file system is completely transparent, file names that cannot be interpreted as Unicode may be encountered, in which case the fun() must be prepared to handle raw file names (i.e. binaries). If the regular expression contains codepoints beyond 255, it will not match file names that do not conform to the expected character encoding (i.e. are not encoded in valid UTF-8). For more information about raw file names, see the file module. is_dir(Name) -> true | false Types Name = filename() | dirname() The is_dir/1 function returns true if Name refers to a directory, and false otherwise. is_file(Name) -> true | false Types Name = filename() | dirname() The is_file/1 function returns true if Name refers to a file or a directory, and false otherwise. is_regular(Name) -> true | false Types Name = filename() The is_regular/1 function returns true if Name refers to a file (regular file), and false otherwise. last_modified(Name) -> {{Year,Month,Day},{Hour,Min,Sec}} | 0 Types Name = filename() | dirname() The last_modified/1 function returns the date and time the given file or directory was last modified, or 0 if the file does not exist. wildcard(Wildcard) -> list() Types Wildcard = filename() | dirname() The wildcard/1 function returns a list of all files that match Unix-style wildcard-string Wildcard . The wildcard string looks like an ordinary filename, except that certain "wildcard characters" are interpreted in a special way. The following characters are special: ? : Matches one character. * : Matches any number of characters up to the end of the filename, the next dot, or the next slash. [Character1,Character2,...] : Matches any of the characters listed. Two characters separated by a hyphen will match a range of characters. Example: [A-Z] will match any uppercase letter. {Item,...} : Alternation. Matches one of the alternatives. Other characters represent themselves. Only filenames that have exactly the same character in the same position will match. (Match- ing is case-sensitive; i.e. "a" will not match "A"). Note that multiple "*" characters are allowed (as in Unix wildcards, but opposed to Windows/DOS wildcards). Examples: The following examples assume that the current directory is the top of an Erlang/OTP installation. To find all .beam files in all applications, the following line can be used: filelib:wildcard("lib/*/ebin/*.beam"). To find either .erl or .hrl in all applications src directories, the following filelib:wildcard("lib/*/src/*.?rl") or the following line filelib:wildcard("lib/*/src/*.{erl,hrl}") can be used. To find all .hrl files in either src or include directories, use: filelib:wildcard("lib/*/{src,include}/*.hrl"). To find all .erl or .hrl files in either src or include directories, use: filelib:wildcard("lib/*/{src,include}/*.{erl,hrl}") wildcard(Wildcard, Cwd) -> list() Types Wildcard = filename() | dirname() Cwd = dirname() The wildcard/2 function works like wildcard/1 , except that instead of the actual working directory, Cwd will be used. Ericsson AB stdlib 1.17.3 filelib(3erl)
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy