wc
Programm: wc
Zählt Zeilen, Wörter und Zeichen.
Aufruf
wc [OPTION]... [FILE]...
Beschreibung
Count lines, words and bytes of each FILE, and give a total for more than one FILE. A FILE named -, or no FILE, means the keyboard or pipe.
Optionen im Simulator
4 weitere Optionen des echten Programms, im Simulator noch nicht
Beispiele
grep 404 projekte/webseite/server.log | wc -l
3 wc -l logs/app.log
17 logs/app.log
grep ERROR logs/app.log | wc -l
2 grep ERROR logs/app.log | wc -l
2
ls -lt logs | head -n 2
total 8
-rw-r--r-- 1 lerner lerner 621 Oct 17 09:41 app.log wc -l logs/app.log
8 logs/app.log Wo du ihn lernst
Lektionen
- Befehle verketten Terminal-Start
- Zeilen finden, Unterschiede finden Linux-Grundlagen, Modul 3: Text-Werkzeuge
- Ströme lenken Linux-Grundlagen, Modul 4: Pipes und Umleitungen