The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How do I get the name of latest file?
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
How do I get the name of latest file?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
01-02-2009
pludi
Moderator
Join Date: Dec 2008
Location: .at
Posts: 1,947
Yes, deleting all files from a directory is safe... until you inadvertently hit a system directory and your config/essential programs go bye-bye.
To get the newest file, issue a VAR=`ls -tr1|head -n 1`
pludi
View Public Profile
Find all posts by pludi
Find pludi's past nominations received
Find pludi's present nominations given