I have been trying to create a find command string that will find all files that end with a number 1-99 but exclude all others.
e.g. I want to find myfile1 myfile99 but not myfile456 and not myfilebackup
The regex I'm thinking of is myfile[1-9]{1,2} but I can't get this to work with find.
find . -regex '.*myfile[0-9]{1,2}'
OR
find .
Hello All,
Bash Version: 4.1.10(1)
I'm trying to "verify" some user input.
I'm trying to use find with the regex option. However my regular expression only captures the basename of the file. Is there a reference to the "directory find is currently in" I can use in my regular expression so that I don't have to account for it by means of a leading .*?
I seem to be having an issue with an egrep command and I think its the way it is interpreting my regex.
I have a test file..
Code:
###FIND THESE###
telnet
/telnet
`telnet -l`
###Dont FIND THESE###
donotfindtelnet
telnetdontfind
Working Regex on Linux/Solaris
Code:
egrep '\<(telnet|rcp)\>' $file
However...none of these work on HP-UX...what am i missing here?
also tried separatin
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:
Code:
find ${full_path_to_dir_to_search} -type f -name "*.dat" -print -o -type d -prune
which produces no output.
Hi guys,
I am trying to "grep" or "egrep" the following entry out of the file using regex:
MACCDB1 or MACCDB2
The problem is that the file might contain other entries which start with "MACCDB" string.
I was trying to use regex to "grep" the exact pattern but it fails to output the correct entry:
Code:
$ egrep -i "MACCDB[0-1]" /bb/data/
Hi,
I'm trying to find all files that have a .ksh and .p extension and that are 7 days old by using the below find command but it doesn't seem to as expected. It gives me random results.. Can someone point out what may be wrong?
Code:
find . -name "*.ksh" -o -name "*.p" -mtime -7
Hi,
The blow code does not yeild any output.
Code:
find . -name "*.jar" -o -name "*.ksh" -o -name "*.properties" -name "*.war" -o -name "*.ear" -o -name "*.sh" -o -name "*.cfg" -exec ls -l {} \;
I wish to print the filename filesize filedate in HP-UX.
Can anyone help ?
hi
I used find command to find some file names as per input from user. I used it for current directory. It was working fine. Now I tried with giving some other directory path. Its giving issues.
Here what I tried. Script will take input from user say 1_abc.txt, find the file and print list.