Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google site



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-25-2005
Registered User
 

Join Date: May 2005
Posts: 69
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
Sponsored Links
  #2 (permalink)  
Old 05-25-2005
Registered User
 

Join Date: May 2005
Location: Scotland
Posts: 28
awk

how about

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


im assuming this is what you are wanting to do ??
  #3 (permalink)  
Old 05-25-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,199
Quote:
Originally Posted by vivekshankar
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?
ls -ltr | cut -f1 -d ' '
Quote:
Originally Posted by vivekshankar
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?
nawk '{print $NF}' list.i

Quote:
Originally Posted by vivekshankar


Thanks and Regards
  #4 (permalink)  
Old 05-25-2005
Registered User
 

Join Date: May 2005
Posts: 69
Thank you guys!! :-)

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 :-)

Thanks!!!

Regards
Vivek.S
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
facing problem in starting a process in background using shell script. dtomar Shell Programming and Scripting 8 04-17-2008 09:11 AM
Problem facing with sed and awk jisha Shell Programming and Scripting 19 04-11-2008 06:20 AM
Facing an issue related to cronjob parindam HP-UX 1 09-13-2006 05:11 PM
please help as i am facing problem with uptime guy009 Solaris 3 06-02-2005 07:59 PM
facing a problem in redirection vivekshankar UNIX for Dummies Questions & Answers 4 05-23-2005 01:24 PM



All times are GMT -4. The time now is 03:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0