Sponsored Content
Top Forums Shell Programming and Scripting ksh: How to get latest file from a list of files in a directory Post 37631 by Jayathirtha on Tuesday 24th of June 2003 10:17:34 AM
Old 06-24-2003
ksh: How to get latest file from a list of files in a directory

Hi,

I need to get the latest file from a list of files in a particular directory.

Please could anyone help me out to get the file.

Thank you,
- Jay.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To list only the very latest files

Hi, There are huge no of files in the directory. If i say ls -ltr it is taking too much time. i want to see only the files for Feb,2009. Please help. Thanks (3 Replies)
Discussion started by: venkatesht
3 Replies

2. Shell Programming and Scripting

Copying a directory structure with the latest versions of files

Hello I have three directory structures for code releases. Each directory structure looks like this: bash-3.00$ ls -R | more .: Test_Release_1 Test_Release_2 Test_Release_3 ./Test_Release_1/dbcode: rp_online_import_srdp.pkb-1 srdp_ar_validation.pkb-1... (1 Reply)
Discussion started by: Glyn_Mo
1 Replies

3. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

4. Shell Programming and Scripting

find the latest files in multiple directory

I want to get the latest files from multiple directories, d1, d2,d3 and d4 under the parent dierectoy d. can anyone help out with this? thx (3 Replies)
Discussion started by: shyork2001
3 Replies

5. Shell Programming and Scripting

KSH: Opening Files based on a file list

I'd like to grep files for key words using korn shell, and compile the actual contents (not just file name) of those files that contain a combination of those grepped key words into one repository file for reference. However, I'm stuck at the combining part. Here's what I have thus far: egrep... (5 Replies)
Discussion started by: drumminfool91
5 Replies

6. UNIX for Dummies Questions & Answers

Select the latest dated file-ksh script

Hello all!! I am new here and new in scripting! I want to write a ksh script to select the most recent file from a dir and use it in a variable. I have a directory with files named like: YYYMMDD A basic idea of the script I want to write is #!/usr/bin/ksh latest= latest_dated_file at... (2 Replies)
Discussion started by: chris_euop
2 Replies

7. Shell Programming and Scripting

How to retrieve the latest files from the directory.?

hi, i have some file in a directory say p1.txt.201305051200.lst p1.txt.201305051300.lst p1.txt.201306051200.lst p1.txt.201306051300.lst p2.txt.201306051200.lst p2.txt.201306051300.lst i am using p* pattern to retrieve these file ls -1 p* the files in red color are the latest... (7 Replies)
Discussion started by: Little
7 Replies

8. Shell Programming and Scripting

I have this list of files . Now I will have to pick the latest file based on some condition

3679 Jul 21 23:59 belk_rpo_error_**po9324892**_07212014.log 0 Jul 22 23:59 belk_rpo_error_**po9324892**_07222014.log 3679 Jul 23 23:59 belk_rpo_error_**po9324892**_07232014.log 22 Jul 22 06:30 belk_rpo_error_**po9324267**_07012014.log 0 Jul 20 05:50... (5 Replies)
Discussion started by: LoneRanger
5 Replies

9. Shell Programming and Scripting

Latest list of files of each type

find /tmp/testlog/kSR*"_"2018* -type f -printf '%T@ %p\n' | sort -n | tail -3 | cut -f2- -d" " /tmp/testlog/log/KSR04_2018-07-05.log /tmp/testlog/log/KSR04_2018-07-06.log /tmp/testlog/log/KSR01_2018-07-06.log But, I would see the following output(latest files for each KSR tuype) ... (3 Replies)
Discussion started by: jhonnyrip
3 Replies

10. UNIX for Beginners Questions & Answers

Need help with UNIX command to get the latest file from list of files with timestamp

Hi All, I have list of files like below with name abcxyz.timestamp. I need a unix command to pick the latest file from the list of below files. Here in this case the lates file is abcxyz.20190304103200. I have used this unix command "ls abcxyz*|tail -1" but i heard that it is not the appropriate... (2 Replies)
Discussion started by: rakeshp
2 Replies
HACK(6) 							 BSD Games Manual							   HACK(6)

NAME
hack -- exploring The Dungeons of Doom SYNOPSIS
hack [-d directory] [-n] [-u playername] hack [-d directory] [-s] [-X] [playername ...] DESCRIPTION
hack is a display oriented dungeons & dragons-like game. Both display and command structure resemble rogue. (For a game with the same structure but entirely different display - a real cave instead of dull rectangles - try Quest.) To get started you really only need to know two commands. The command ? will give you a list of the available commands and the command / will identify the things you see on the screen. To win the game (as opposed to merely playing to beat other people's high scores) you must locate the Amulet of Yendor which is somewhere below the 20th level of the dungeon and get it out. Nobody has achieved this yet and if somebody does, he will probably go down in history as a hero among heroes. When the game ends, either by your death, when you quit, or if you escape from the caves, hack will give you (a fragment of) the list of top scorers. The scoring is based on many aspects of your behavior but a rough estimate is obtained by taking the amount of gold you've found in the cave plus four times your (real) experience. Precious stones may be worth a lot of gold when brought to the exit. There is a 10% penalty for getting yourself killed. The administration of the game is kept in the directory specified with the -d option, or, if no such option is given, in the directory speci- fied by the environment variable HACKDIR, or, if no such variable exists, in the current directory. This same directory contains several auxiliary files such as lockfiles and the list of topscorers and a subdirectory save where games are saved. The game administrator may how- ever choose to install hack with a fixed playing ground, usually /var/games/hack. The -n option suppresses printing of the news. The -u playername option supplies the answer to the question "Who are you?". When playername has as suffix one of -T, -S, -K, -F, -C, or -W, then this supplies the answer to the question "What kind of character ... ?". The -s option will print out the list of your scores. It may be followed by arguments -X where X is one of the letters C, F, K, S, T, W to print the scores of Cavemen, Fighters, Knights, Speleologists, Tourists or Wizards. It may also be followed by one or more player names to print the scores of the players mentioned. AUTHORS
Jay Fenlason (+ Kenny Woodland, Mike Thome and Jon Payne) wrote the original hack, very much like rogue (but full of bugs). Andries Brouwer continuously deformed their sources into the current version - in fact an entirely different game. FILES
hack The hack program. data, rumors Data files used by hack. help, hh Help data files. record The list of topscorers. save A subdirectory containing the saved games. bones_dd Descriptions of the ghost and belongings of a deceased adventurer. xlock.dd Description of a dungeon level. safelock Lock file for xlock. record_lock Lock file for record. ENVIRONMENT
USER or LOGNAME Your login name. HOME Your home directory. SHELL Your shell. TERM The type of your terminal. HACKPAGER, PAGER Pager used instead of default pager. MAIL Mailbox file. MAILREADER Reader used instead of default (probably /usr/bin/mail). HACKDIR Playground. HACKOPTIONS String predefining several hack options (see help file). Several other environment variables are used in debugging (wizard) mode, like GENOCIDED, INVENT, MAGIC and SHOPTYPE. BUGS
Probably infinite. Mail complaints to mcvax!aeb . BSD
March 31, 1985 BSD
All times are GMT -4. The time now is 05:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy