The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: ls command
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 05-29-2007
praveenkumar_l's Avatar
praveenkumar_l praveenkumar_l is offline
Registered User
  
 

Join Date: May 2007
Posts: 36
Quote:
Originally Posted by rinku
I want to print only the name of one file which is last modified.
I use ::

$ls -ltr S07* |cut -f 8-9

but it is not working.

it gives the outut

-rw-r--r-- 1 aaaaa aaaaa 0 May 29 00:32 S070528D
-rw-r--r-- 1 aaaaa aaaaa 0 May 29 00:41 S070528S

I want the output

S070528S

please help me.
Try this

ls -1 |tail -1

NOTE: ls option is not l (el), but 1 (one)