based on preparation of: dwaves.de/2017/04/26/linux-bash-searching-and-colorful-highlighting-of-text-patterns-in-files-with-grep-regular-expressions/
[cc lang=”bash” escaped=”true” width=”600″]
wc -w; # basically starting wc in “interactive” mode, quit with Ctrg+Z
joe is very hungry today
5
wc -w < termine; # word count, count the words in that file
10
cat artikel.txt termine | wc -w; # count words of two files artikel.txt and termine
29
user@suse:~> cat a* termine | wc -w; # count all words of all files in the current directory that start with an “a” but also all words in termine (same result)
29
cat << EOF; # instead of Ctrl+Z when typing EOF and hitting enter it runs the command and quits the program
> hello
> here it is
> warm
> EOF
hello
here it is
warm
cat << EOF > editor_for_poor.txt; # starts cat in interactive mode, creates a file and writes to that file
> this was written
> with a very cheap editor
> EOF
[/cc]
liked this article?
- only together we can create a truly free world
- plz support dwaves to keep it up & running!
- (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
- really really hate advertisement
- contribute: whenever a solution was found, blog about it for others to find!
- talk about, recommend & link to this blog and articles
- thanks to all who contribute!