Print all lines in a file that are not a certain length

awk 'length($0)!=12 {print}' your_file_name
Alternatively, print all the lines that are a certain length: awk 'length($0)==12 {print}' your_file_name

2009-02-05 14:27:52

What Others Think

awk 'length != 12 {print}' your_file_name
maht · 658 weeks and 5 days ago
awk 'length != 12' your_file_name
unbibium · 658 weeks and 5 days ago
Thank goodness I found this page! doula
aegyjingoo · 42 weeks ago
Thanks for picking out the time to discuss this, I feel great about it and love studying more on this topic. It is extremely helpful for me. Thanks for such a valuable help again. N95 Face Mask
KayGasaway · 13 weeks and 1 day ago
If someone week i really ashen-haired not actually pretty, whether you will lite grope a present, thought to follow us to displays bursting with ends of the earth considerably? Inside the impeccant previous, sea ever have dried-up, my hubby and i only may very well be with all of you connected thousands of samsara. ufa
KayGasaway · 12 weeks and 2 days ago
Regular visits listed here are the easiest method to appreciate your energy, which is why why I am going to the website everyday, searching for new, interesting info. Many, thank you ??????
jackson2321 · 12 weeks and 1 day ago
Extremely helpful post. This is my first time i visit here. I discovered such a large number of intriguing stuff in your blog particularly its exchange. Truly its extraordinary article. Keep it up. ?????????????? sa
jackson2321 · 12 weeks ago
Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. ???????1688
jackson2321 · 10 weeks and 6 days ago
Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks
jackson2321 · 3 weeks and 6 days ago
Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. casino
jackson2321 · 3 weeks and 6 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? 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.


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: