System and Hardware commands in Linux
Below is the list of commands to get information about system and hardware.
- free – used to display memory information
- cat /proc/meminfo – memory information
- fdisk – hard drive partition information
- du – prints information about the disk usage
- df – information about free disk space in given directory
- lscpu – details about cpu
- cat /proc/cpuinfo – cpu information
- uname -a – Prints details of the operating system
- last reboot – prints the time when system was last time rebooted
- init 0/ shutdown -h – shutdown the system
- reboot/init 6/ shutdown -r now – command to restart the system
uptime command is used to display current time, the duration of time for which system is running, how many users are currently logged into the system. It also displays the average load on the system.
shutdown command is used to shut down the system. Here -h means halt.
$ shutdown -h now
If you want to shut down the system after 5 minutes, you can use below command.
# shutdown -h +5
If you want to reboot the system, you can use below command. Here -r means reboot.
# shutdown -r now