![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to find latest executable in particular directory and start that particular ex | kvineeth | Shell Programming and Scripting | 6 | 09-24-2007 04:19 AM |
| Find all files created by a specified user in a directory and its subdirectories | abhilashnair | UNIX for Dummies Questions & Answers | 5 | 06-12-2007 11:37 PM |
| want to cat the latest log file created | vkandati | UNIX for Dummies Questions & Answers | 1 | 03-08-2005 02:13 PM |
| ksh: How to get latest file from a list of files in a directory | Jayathirtha | Shell Programming and Scripting | 1 | 06-24-2003 07:23 AM |
| new directory - how to force files created in it to inherit grp,own and permissions | avisb | UNIX for Dummies Questions & Answers | 2 | 04-26-2002 01:47 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Get the latest directory created
hi,
I need to get the latest directory created for example wheni run ls -altr *xyz_Integration* I have plenty of directories created like my_build_77_xx_Integration_050908_150714: total 177898 -rw-rw--- 1 xyzmgr cchyg 7687338 May 9 19:29 myapp.ear my_build_77_xx_Integration_050908_163337: total 177898 -rw-rw--- 1 xyzmgr cchyg 7687338 May 9 19:29 myapp.ear my_build_77_xx_Integration_050908_165636: total 177898 -rw-rw--- 1 xyzmgr cchyg 7687338 May 9 19:29 myapp.ear my_build_77_xx_Integration_050908_183534: total 177898 -rw-rw--- 1 xyzmgr cchyg 7687338 May 9 19:29 myapp.ear my_build_77_xx_Integration_050908_191844: total 177898 -rw-rw--- 1 xyzmgr cchyg 7687338 May 9 19:29 myapp.ear I need to print only the name of the latest directory created like my_build_77_xx_Integration_050908_191844 Can anybody help me in getting this.. I am new to scripting. Thanks Vikram |
| Forum Sponsor | ||
|
|
|
|||
|
Hi
Thx for the response.. I am having multiple files under the same directory my_build_59_xx_Integration_050908_191844: total 177860 -rw-rw-r-- 1 xyzmgr ccbbld 39238299 May 9 19:29 app.ear -rw-rw-r-- 1 xyzmgr ccbbld 51716251 May 9 19:29 my.ear drwxrwxr-x 2 fxyzmgr ccbbld 512 May 9 19:29 src drwxrwxr-x 3 xyzmgr ccbbld 512 May 9 19:29 cfg -rw-rw-r-- 1 xyzmgr ccbbld 16468 May 9 19:29 my.jar drwxrwxr-x 4 xyzmgr ccbbld 512 May 9 19:29 data drwxrwxr-x 3 xyzmgr ccbbld 512 May 9 19:29 cfg02 drwxrwxr-x 6 xyzmgr ccbbld 512 May 9 19:29 . drwxrwxr-x 42 xyzmgr ccbbld 3584 May 12 12:03 .. By running that command I can only get drwxrwxr-x 3 xyzmgr ccbbld 512 May 9 19:29 cfg02 |
|||
| Google UNIX.COM |