$ cat /proc/cpuinfo
Sometimes it is more convenient to be able to go through a text file page by page or line by line instead of printing the entire file into the terminal. Therefore the little program less exists.
$ less /proc/cpuinfoThis will display all lines of text in the file /proc/cpuinfo that fits into your current terminal window. Using the arrow keys UpArrow and DownArrow, you can go through your text line by line. The keys PageUp and PageDown will show the previous or next page of text. Pressing q will quit the less program. You can also search inside a text document by pressing \ followed by your query. This will jump to the nearest occurance of the query in your textfile. By pressing n or Shift+n you will be directed to the next/previous occurance. As you will deal with a lot of textfiles with data in the next lectures, there are many helper commands/programs that assist you to obtain certain informations. The program wc (word count) counts the number of words, lines and characters in the specified text file. The program grep will find out if a certain specified string is in your textfile. E.g. if you want to know if you have a pentium cpu in your workstation you might call
$ grep Pentium /proc/cpuinfoIf so, the programm will print all lines of the textfile where your query was found. It will print nothing, if the query is not found at all. Again, check
$ grep --helpor
$ man grepto find out more about the possibilities you have using the grep command.
Ronny Lorenz 2010-04-06