Sponsored Content
Top Forums Shell Programming and Scripting to find the last updated file from different groups of files. Post 302398468 by methyl on Wednesday 24th of February 2010 06:47:15 PM
Old 02-24-2010
Untested.
The idea is to find all the unique filename prefixes, then find the most recent file with that prefix.

Code:
ls -1 basel_??_????????\.txt 2>/dev/null | cut -c1-8 | sort | uniq | while read prefix
do
         ls -1t "${prefix}"* | sed -n "1 p"
done


Last edited by methyl; 02-24-2010 at 07:52 PM.. Reason: One more underscore in filename and specific number of characters. And allow for no files present.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find last updated file

Hi all, my problem is teh following: I need to move a file from a folder to another and I usually do it by the get command but in this case I have a list of file in the source folder and I have to select only the lust updated one. Ho to do this? All the files have the same name followed... (4 Replies)
Discussion started by: callimaco0082
4 Replies

2. Shell Programming and Scripting

Find recently updated files in home directory

Is there a shell command that will allow me to list index files in the /home directory for all users on a server that have been updated within the past 24 hours? (e.g. index.htm .html .php in/home/user1/public_html /home/user2/public_html /home/user3/public_html etc ) (2 Replies)
Discussion started by: Kain
2 Replies

3. Shell Programming and Scripting

find recently modified/ updated file

hi gurus, i would like to know how can i find logs files which were recently modified or updated? :confused: using this command? find . -name "*.log" -mtime ?? so what should i put for mtime? thanks. wee (9 Replies)
Discussion started by: lweegp
9 Replies

4. Shell Programming and Scripting

shell script to find unowned users and groups

Hello, I am new to Unix and shell scripting. I am trying to find unowned files and groups on my servers. I know, i could use the below command to find it on individual server. #find / -nouser -o -nogroup -print But I was wondering, if someone could help with a shell script so that I can... (2 Replies)
Discussion started by: ut916
2 Replies

5. Shell Programming and Scripting

Find last updated files and rename

HI I have a requirement to find the last updated files from a directory whcih has subdirectories and inside them we have files with .txt,.doc,.xls .. extensions. i have to find those files which were updated in the last 1hr and rename the files with respective <sub-directory>_<filename> and copy... (3 Replies)
Discussion started by: ramse8pc
3 Replies

6. Shell Programming and Scripting

multiple groups of files processing

I have five directories, dir1 to dir5 for each directory, I have all same number-named folders. There are four types of folders, {1..10}, {20..30}, { 40..50}, {60..70} Now for each types of folder, I will do the same thing, here is the code for i in {1..5} do cd dir$i mkdir temp1 for... (5 Replies)
Discussion started by: ksgreen
5 Replies

7. Shell Programming and Scripting

How to find last updated date and time of a folder in Perl?

Hi All, I have a process which after some time continues move a files to some folder(say the name of the folder is logdir) What i am trying to do is as the files are coming to the logdir folder, I want the latest updated time and date of the folder in PERL. (1 Reply)
Discussion started by: parthmittal2007
1 Replies

8. Shell Programming and Scripting

Find out whether directory has been updated with files in the last 5 minutes or not

Hi, I am trying to work on this script that needs to monitor a Directory. In case there are no files received in that Directory for the last 5 minutes, it has to send out an alert. Could someone please suggest any approach for the same. Note: I did check out various previous psts -... (8 Replies)
Discussion started by: rituparna_gupta
8 Replies

9. Shell Programming and Scripting

Move groups of files

G'day all, I'm have tons of image files I need to process, but I don't need to process all of them and it would take a long time to process them all if I don't have to. The images are arranged in folders like this... folder1/RawData folder2/RawData folder3/RawData ... folderN/RawData ... (2 Replies)
Discussion started by: Dan_S
2 Replies

10. Shell Programming and Scripting

How to find the any log which is not updated since particular date?

Hello, Iam running with one issue, since particular date looks like one of the script vanished from the system after restarting of the system. I dont know which scrit it was but definatelt there should be one. but might be some logs would be there which have not updated from that day. so... (2 Replies)
Discussion started by: ajju
2 Replies
ACPIHELP(1)						      General Commands Manual						       ACPIHELP(1)

NAME
acpihelp - ACPI help utility SYNOPSIS
acpihelp <option>... [<name-prefix>|<hex-value>] DESCRIPTION
This manual page briefly documents the acpihelp command. The option list is taken from the acpihelp interactive help. acpihelp provides descriptive text for AML and ASL keywords, methods, and opcodes. Much more detailed documentation may be found at http://www.acpica.org/documentation/. If neither a <name-prefix> or a <hex-value> is provided, acpihelp will do the logical equivalent of a "display all." A default search (that is, a search with no options) and a <name-prefix> can mean two different things: (1) if <name-prefix> does not start with an underscore, find ASL operator names, or (2) if <name-prefix> does start with an underscore, find ASL predefined method names. OPTIONS
ACPI Names and Symbols -k [<name-prefix>] Find/Display ASL non-operator keyword(s) -m [<name-prefix>] Find/Display AML opcode name(s) -p [<name-prefix>] Find/Display ASL predefined method name(s) -s [<name-prefix>] Find/Display ASL operator name(s) ACPI Values -e [<hex-value>] Decode ACPICA exception code -i Display known ACPI Device IDs (_HID) -i [<hex-value>] Decode hex AML opcode AUTHOR
acpihelp was written by Robert Moore <robert.moore@intel.com>. This manual page was written by Al Stone <ahs3@redhat.com> for the Fedora project (but may be used by others). January 23, 2013 ACPIHELP(1)
All times are GMT -4. The time now is 01:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy