facing problem with cut command

hi ,
i used ls -ltr | cut -f 1 > \dev\tty

but all teh coulmns r getting printed instead of only one........how can i resolve this?

prob 2 :
wud be able start cutting from last field......supposing in the case of dyanmic list.i dunno the field number of last column.......so is here anyway to cut a word that is at end?

Thanks and Regards

how about

ls -lrt | awk '{print $9}'

im assuming this is what you are wanting to do ??

ls -ltr | cut -f1 -d ' '

nawk '{print $NF}' list.i

Thank you guys!! :slight_smile:

I will check...was struggling to get the last field......i guess i have learn awk , till now i dun have any idea abt awk...so b4 goin along with this code i guess it wud be better for me to learn basics of awk :slight_smile:

Thanks!!!

Regards
Vivek.S