gawk gets fixed width field

ls -l | gawk -v FIELDWIDTHS='1 3 3 3' '{print $2}'

5
By: kev
2012-02-08 08:18:25

What Others Think

For a single field, cut is way shorter: ls -l | cut -b3-6
netizen · 483 weeks ago
Thank you very much for the sharing! COOL.. best restaurant in cozumel
xoheko1229 · 10 weeks and 2 days ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. cozumel dive site map
xoheko1229 · 10 weeks and 1 day ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. cozumel dive site map
xoheko1229 · 10 weeks and 1 day ago
I have been checking out a few of your stories and i can state pretty good stuff. I will definitely bookmark your blog best beach hotel in cancun
xoheko1229 · 9 weeks and 3 days ago
Please let me know if you’re looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Thank you! best restaurant playa del carmen
xoheko1229 · 9 weeks and 1 day ago
Thanks for every other informative site. The place else may just I get that kind of information written in such an ideal means? I have a venture that I’m just now operating on, and I have been on the look out for such information. best restaurant playa del carmen
xoheko1229 · 9 weeks and 1 day ago
Thanks for your post. I’ve been thinking about writing a very comparable post over the last couple of weeks, I’ll probably keep it short and sweet and link to this instead if thats cool. Thanks. best restaurant playa del carmen
xoheko1229 · 9 weeks and 1 day ago
Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! isla mujeres cancun
xoheko1229 · 9 weeks and 1 day ago
Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! all inclusives in isla mujeres
xoheko1229 · 8 weeks and 6 days ago
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. how to get to isla contoy
xoheko1229 · 8 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: