Sponsored Content
Full Discussion: A find and sort challenge...
Top Forums UNIX for Dummies Questions & Answers A find and sort challenge... Post 73656 by ppohz on Friday 3rd of June 2005 04:43:58 AM
Old 06-03-2005
Question A find and sort challenge...

Hi,

I need to generate a listing of files that have been changed since x day. the listing is to be sorted by date.

I managed to get the 1st requirement using the find command :
find . -mtime -100 -type f -ls
but I don't know how to sort the ls listing by date. Smilie

The challenge comes when the files that have been changed for a day lies all over the directory. Smilie

Can anyone help ?

A zillion thanks !
Poh

p/s: I'm on Tru64 UNIX; and sort -M is not available...

Last edited by ppohz; 06-03-2005 at 05:50 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to sort find results

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)
Discussion started by: groundlevel
8 Replies

2. Shell Programming and Scripting

Perl find::file can I sort the out put

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)
Discussion started by: Andrek
2 Replies

3. UNIX for Dummies Questions & Answers

find command sort options?

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)
Discussion started by: mavsman
6 Replies

4. Linux

System wide find and sort

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)
Discussion started by: Housni
4 Replies

5. Shell Programming and Scripting

find command with sort

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)
Discussion started by: ningy
1 Replies

6. UNIX for Dummies Questions & Answers

sort find results

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)
Discussion started by: shellBeginner75
4 Replies

7. Shell Programming and Scripting

Find and sort by first column value

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)
Discussion started by: f_o_555
4 Replies

8. Shell Programming and Scripting

Find files and sort by timestamp

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)
Discussion started by: lalitpct
1 Replies

9. UNIX for Beginners Questions & Answers

Linux find jpg and sort by date

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
LIST-DESKTOP-PROFILES(1)				      General Commands Manual					  LIST-DESKTOP-PROFILES(1)

NAME
list-desktop-profiles - list known profiles that meet given criteria SYNOPSIS
list-desktop-profiles [OPTION] DESCRIPTION
As the number of .listing files holding metadata grows, trying to find out which profiles are present/meet certain criteria becomes increasingly unpleasant. This script remedies that allowing you to just list your criteria, and outputting all profiles meeting those cri- teria. By default it will just output the lines from the .listing files for each (matching) profile, but you can specifying a formatstring to fancy up the output. OPTIONS
-n <regexp>, --name <regexp> Limit shown profiles to those for which the name (1st) field of the profile description needs matches the given regular expression. -k <regexp>, --kind <regexp> Limit shown profiles to those for which the kind (2nd) field of the profile description needs matches the given regular expression. -l <regexp>, --location <regexp> Limit shown profiles to those for which the location (3th) field of the profile description needs matches the given regular expres- sion. -p <comparison>, --precedence <comparison> Limit shown profiles to those for which the precedence (4th) field of the profile description succeeds the given comparison. In the comparison you can Use 'gt' for 'greater then', 'lt' for 'less then', 'ge' for 'greater then or equal to', 'le' for 'less then or equal to', 'eq' for 'equal to', and 'ne' for 'not equal to'. (NOTE: empty precedence-field, is lowest possible precedence) -r <regexp>, --requirement <regexp> Limit shown profiles to those for which the requirements (5th) field of the profile description needs matches the given regular expression. -c <regexp>, --comment <regexp>, --description <regexp> Limit shown profiles to those for which the comment (6th) field of the profile description needs matches the given regular expres- sion. -u <username>, --user <username> Limit shown profiles to those for which the given user meets the requirements. (NOTE: doesn't always give correct results! Results might be wrong when using shell command requirements that depend on the users environment. Or when 'group $USER' gives a different result as 'group' executed as $USER, which can happen when adding groups through pam_group). -d <dir>, --directory <dir> Also use .listing files found in the given directory. This option can be used multiple times to add more then 1 additional directory -e <formatstring>, --entry-format <formatstring> Show profile information according to the specified format spring (instead of just echoing the profile-line). The format string may use the following variables: NAME, LOCATION, PRECEDENCE, REQUIREMENTS, KIND, DESCRIPTION, FILE; the first 6 of these refer to the corresponding field, the last refers to the .listing file the profile is in. (e.g. '$FILE_$NAME - $DESCRIPTION'). Any characters that are interpreted specially by the shell should be escaped. -s <fieldname>|<fieldnumber>, --sort-key <fieldname>|fieldnumber Sort output on the requested field (fieldname is one of name, kind, location, precedence, requirements, or description; fieldnumbers run from 1-6). EXAMPLES
list-desktop-profiles -k KDE -s precedence -u user1 List all kde-profiles that will be activated for user1 in order of precedence. list-desktop-profiles -k 'KDE|GCONF' List all kde and gnome profiles. list-desktop-profiles -p 'gt 50' List all profiles with a precedence value greater then 50. ENVIRONMENT
NAME_FILTER, LOCATION_FILTER, PRECEDENCE_FILTER, REQUIREMENT_FILTER, KIND_FILTER, DESCRIPTION_FILTER Can be used to specify the default regular expressions and comparisons. Default to empty. OUR_USER Set the user for which the requirements need to be met. Defaults to unset. EXTRA_LISTINGS Can be used to specify a (space separated) list of extra .listing files to include. Defaults to empty FORMAT Can be used to specify the default format string. By default it will output the profile-line from the .listing file. SORT_KEY Can be used to specify the default sort-key (= field number). Defaults to 1 FILES
/etc/desktop-profiles/*.listing - Files containing the metadata about installed profiles /etc/default/desktop-profiles - File containing default settings for this script (by way of the environment variables above) BUGS
The '-u <username>' is not guaranteed to work correctly for shell command requirements. Particulary this will give incorrect results if the shell command depends on some state of the user environment. AUTHOR
This manual page was written by Bart Cornelis <cobaco@skolelinux.no>. SEE ALSO
desktop-profiles(7), update-profile-cache(1), profiles-manager(1) desktop-profiles November 11, 2004 LIST-DESKTOP-PROFILES(1)
All times are GMT -4. The time now is 05:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy