bash - Find words that are 6 characters in length -


i have file.txt

fhadja ksjfskdasd adasda sada s adasaaa 

i need extract words 6 character length there.

example of need obtain result:

fhadja adasda 

thank you.

you can use:

grep -e '^.{6}$' file fhadja adasda 

or using awk:

awk 'length($0)==6' file fhadja adasda 

or using sed:

sed -rn '/^.{6}$/p' file fhadja adasda 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -