1844169 Members
2683 Online
110229 Solutions
New Discussion

Reg : file commands

 
harikrishna
Advisor

Reg : file commands

Hi ,
can any one please help me in geeting last arrived file in a directory through ftp in unix.it is very urgent need for me.

Thanks in advance.

Regards,
Hari Krishna
4 REPLIES 4
Michael Tully
Honored Contributor

Re: Reg : file commands

Using the open ftp connection:

ftp > ls -ltr
This will show the last file written to the directory as the last file in the list.
Anyone for a Mutiny ?
Sanjiv Sharma_1
Honored Contributor

Re: Reg : file commands

ftp> ls -lRt
Everything is possible
harikrishna
Advisor

Re: Reg : file commands

Hi Michael ,
the ls -ltr is showing all the files not the last file .can you please send the correct command for geeting the last arrived file in a directorey on HP-UX server.
Thanks for your Help.

Regards,
Hari Krishna
T G Manikandan
Honored Contributor

Re: Reg : file commands

If you are doing a mput thru ftp then use

ftp>!ls -lrt|tail -1

If you are doing a mget thru ftp

ftp>ls -lrt