Senior
What commands can be used to check resource consumption in Linux?
sobes.tech AI
Answer from AI
In Linux, the following commands can be used to check resource consumption:
top— interactive view of processes and their CPU, memory load.htop— an improved version of top with a user-friendly interface.ps aux— displays a list of processes with resource usage information.free -m— shows memory usage.vmstat— statistics on memory, processes, input/output.iostat— statistics on disk operations.sar— collects and displays system statistics.du -sh <path>— size of disk space used by a directory or file.df -h— information on free and used disk space.
Example of using top:
top
Example of memory output:
free -m
These tools allow monitoring CPU load, memory usage, disk, and other system resources.