Hi--
Ok. I have now found that:
find -x -ls
will do what I need as far as finding all files on a particular volume. Now I need to sort the results by the file's modification date/time.
Is there a way to do that?
Also, I notice that for many files, whereas the man for find says ls is... (8 Replies)
Perl file::find can I sort the out put
I am using file::find in my script but how I wish to process each file found in date order.
Can I sort this module?
eg
part of current script is....
use File::Find;
# Recursively find all files and directories in $mqueue_directory
find(\&wanted,... (2 Replies)
Hi - are there sort options with the find command? I don't see any in man. I have a script that is looping through a set a files to be processed and I need to process them in date timestamp order. tia
for file in `find ${LANDING_FILE_DIR}${BTIME_FILENAME_PATTERN1}`
do....
... (6 Replies)
Hi,
I need to look for a config file (ldap.conf) and pick the latest modified file.
`locate` tells me there are many ldap.conf's, some in /etc, /usr, /home, etc.
Is there some way I can sort them by last modified time via bash?
I was thinking maybe I could pipe the output of `locate` to `ls... (4 Replies)
HI
Find command is sorting differently in different machines.
I am trying a script to find file with -name option and delete the files other and keep the latest. the problem I am facing is in one machine find command is returning output sorted with oldest first and latest . But in another... (1 Reply)
Hi,
I have a problem with a shell script.
The script should find all .cpp and .h files and list them.
With:
for file in `find $src -name '*.h' -o -name '*.cpp'
it gives out this:
H:\FileList\A\E\F\G\newCppFile.cpp
H:\FileList\header01.h
H:\FileList\B\nextCppFile.cpp
... (4 Replies)
Hi,
I have two text files
file 1 with N lines
AAAAA 2.092290E-12
BBBBB 1.727740E-07
CCCCC 9.608710E-17
DDDDD 0.000000E+00
EEEEE 0.000000E+00
FFFFF 0.000000E+00
GGGGG 0.000000E+00
HHHHH 0.000000E+00
IIIII 3.300320E-04
...
The text in the first column is unique for each row and... (4 Replies)
Used below command to get list of files sorted by timestamp
find -L . -type f -name '*dat*' | xargs ls -ltrg
I want to get only the filenames so I tried adding basename but it doenst work , can some one advise on how to get only file name (1 Reply)
I want to find all jpg files and then sort them by modification date. This is where I started.
find . -type f -name "*.jpg"
I tried to pipe a sort in there but that did not seem to work. Do I need to use xargs? (10 Replies)
Discussion started by: cokedude
10 Replies
LEARN ABOUT MINIX
find
FIND(1) General Commands Manual FIND(1)NAME
find - find files meeting a given condition
SYNOPSIS
find directory expression
EXAMPLES
find / -name a.out -print
# Print all a.out paths
find /usr/ast ! -newer f -ok rm {} ;
# Ask before removing
find /usr -size +20 -exec mv {} /big ;
# move files > 20 blks
find / -name a.out -o -name '*.o' -exec rm {};
# 2 conds
DESCRIPTION
Find descends the file tree starting at the given directory checking each file in that directory and its subdirectories against a predi-
cate. If the predicate is true, an action is taken. The predicates may be connected by -a (Boolean and), -o (Boolean or) and ! (Boolean
negation). Each predicate is true under the conditions specified below. The integer n may also be +n to mean any value greater than n, -n
to mean any value less than n, or just n for exactly n.
-name s true if current filename is s (include shell wild cards)
-size n true if file size is n blocks
-inum n true if the current file's i-node number is n
-mtime ntrue if modification time relative to today (in days) is n
-links ntrue if the number of links to the file is n
-newer ftrue if the file is newer than f
-perm n true if the file's permission bits = n (n is in octal)
-user u true if the uid = u (a numerical value, not a login name)
-group gtrue if the gid = g (a numerical value, not a group name)
-type x where x is bcdfug (block, char, dir, regular file, setuid, setgid)
-xdev do not cross devices to search mounted file systems
Following the expression can be one of the following, telling what to do when a file is found:
-print print the file name on standard output
-exec execute a MINIX command, {} stands for the file name
-ok prompts before executing the command
SEE ALSO test(1), xargs(1).
FIND(1)