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
Mike Willis
You don’t need to cat /dev/null into a file to empty it, you can just use >
For example:
16 Jul 2010, 12:20
Thanks a lot! That does seem to work better!
16 Jul 2010, 12:56
Add a comment
You are not allowed to comment on this entry as it has restricted commenting permissions.