All entries for Thursday 15 July 2010
July 15, 2010
Linux tips and tricks (2)
Say you are on a network computer and wish to know the system specs. You can use:
cat /proc/cpuinfo
cat /proc/meminfo
Which will return you information about the CPU and memory in the system. There are more files in /proc which will give you information.
Searching for number of instances of a string in a file:
e.g. grep 'Y =' *log|wc (to search for the string 'Y =' in all files ending with log. wc gives word count)
Clearing a file. Recall the standard output operator. Now use:
cat /dev/null > test2.log