We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Linux Shell
- Text Processing
- Cut #7
- Discussions
Cut #7
Cut #7
Sort by
recency
|
96 Discussions
|
Please Login in order to post a comment
cut -d ' ' -f4
Other than using cut -d " " -f 4 you can also use tr ' ' '\t' | cut -f 4
This exercise has no sense. I know that it works with cut -d' ' -f4 but still the behaviour with lines that don't reach 4 words is absurd, the first word is returned or not depending on its position, and the sample to work with has no sense either: no line has 4 words so no output should be made for any of them.