Gora Mohanty [EMAIL PROTECTED] writes:
ls -lr | tail -1
for time of last access. See ls -t, and ls -c for other times.
And if you're interested in the dotfiles (the otherwise invisible ones) make it
ls -lart (that sequence of letters is ez 2 rmmbr if u r l33t ;-)).
PJ
On Tue, 13 Nov 2007 10:14:14 +0530, मनीष
[EMAIL PROTECTED] said:
Ankit Can anyone tell me, how to get latest created file from a folder
Ankit to be used in shell script?
Bimal you may also take a look at find command with time
parameter, see man find for more details.
You mean -mtime,
On Nov 12, 2007 5:13 PM, ankIT WALiA [EMAIL PROTECTED] wrote:
Can anyone tell me, how to get latest created file from a folder to be
used in shell script?
I believe this will work, but only in current directory ( not recursively )
ls -l | grep -v '^total' | tr -s ' ' | sort -t ' ' -k 6,7 |
On Nov 12, 2007 5:13 PM, ankIT WALiA [EMAIL PROTECTED] wrote:
Can anyone tell me, how to get latest created file from a folder to be
used in shell script?
Try this:
getLatestFile(){
if [ $# -eq 1 ]; then
ls -tr $1 | tail -1
else
echo usage: getLatestFile dir
fi
}
ex.
$ getLatestFile ~
$
On Mon, 2007-11-12 at 17:34 +0530, Saleem Ansari wrote:
On Nov 12, 2007 5:13 PM, ankIT WALiA [EMAIL PROTECTED] wrote:
Can anyone tell me, how to get latest created file from a folder to be
used in shell script?
Well, you can't get the time of creation of a file, as that is
not stored. You
On Nov 12, 2007 6:00 PM, मनीष [EMAIL PROTECTED] wrote:
On Nov 12, 2007 5:13 PM, ankIT WALiA [EMAIL PROTECTED] wrote:
Can anyone tell me, how to get latest created file from a folder to be
used in shell script?
Try this:
getLatestFile(){
if [ $# -eq 1 ]; then
ls -tr $1 | tail -1
On Monday 12 November 2007 17:13, ankIT WALiA wrote:
Can anyone tell me, how to get latest created file from a folder to
be used in shell script?
If you want the last file whose inode was modified (which is usually the
same as the last file created):
ls -c | head -1
P.S. *nix has
On Nov 12, 2007 5:34 PM, Saleem Ansari [EMAIL PROTECTED] wrote:
On Nov 12, 2007 5:13 PM, ankIT WALiA [EMAIL PROTECTED] wrote:
Can anyone tell me, how to get latest created file from a folder to be
used in shell script?
I believe this will work, but only in current directory ( not
ankIT WALiA wrote:
Can anyone tell me, how to get latest created file from a folder to be
used in shell script?
iNotify ?
--
Karanbir Singh : http://www.karan.org/ : [EMAIL PROTECTED]
___
ilugd mailinglist -- ilugd@lists.linux-delhi.org
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
,--[ On Mon, Nov 12, 2007 at 04:20:54PM +, Karanbir Singh wrote:
| ankIT WALiA wrote:
| Can anyone tell me, how to get latest created file from a folder to be
| used in shell script?
|
|
| iNotify ?
inotify will throw events, one has to
Ankit Can anyone tell me, how to get latest created file from a folder to be
Ankit used in shell script?
Bimal you may also take a look at find command with time
parameter, see man find for more details.
You mean -mtime, -atime and -ctime options? But this will also not
give latest `created'
11 matches
Mail list logo