Ubuntu – View size of CPU cache through the command-line

cachecommand linecpucpuinfosystem-info

How do I view the size of my CPU cache using the command-line?

I want to view information on L1, L2 and L3 cache.

Also, would it be possible to ouput only information on cache, so that all other information is filtered out?

Best Answer

lscpu will provide the info you're looking for.

lscpu | grep "cache" to filter out only cache info. This will result in something like:

L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K