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 -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -