Useful commands for getting information about your computers memory status and hard drives.

This command used with grep will return information about your computers memory.

[email protected] ~ $ cat /proc/meminfo | grep Total
MemTotal:       12221404 kB
SwapTotal:       6216700 kB
VmallocTotal:   34359738367 kB
CmaTotal:              0 kB
HugePages_Total:       0

If you want to list all of the hard disk partitions on your Linux system then this command is for you.

[email protected] ~ $ sudo /sbin/fdisk -l

Use this command on a Linux system to list all of the supported file-systems available for mounting partitions on your Linux system.

[email protected] ~ $ cat /proc/filesystems
nodev	sysfs
nodev	rootfs
nodev	ramfs
nodev	bdev
nodev	proc
nodev	cpuset
nodev	cgroup
nodev	tmpfs
nodev	devtmpfs
nodev	debugfs
nodev	tracefs
nodev	securityfs
nodev	sockfs
nodev	bpf
nodev	pipefs
nodev	devpts
	ext3
	ext2
	ext4
	squashfs
nodev	hugetlbfs
	vfat
nodev	ecryptfs
	fuseblk
nodev	fuse
nodev	fusectl
nodev	pstore
nodev	mqueue
nodev	autofs
nodev	binfmt_misc

Use the df or disk free command to list all of your mounted partitions and their free and used space.

[email protected] ~ $ df -Hla
Filesystem      Size  Used Avail Use% Mounted on
sysfs              0     0     0    - /sys
proc               0     0     0    - /proc
udev            6.3G     0  6.3G   0% /dev
devpts             0     0     0    - /dev/pts
tmpfs           1.3G   11M  1.3G   1% /run
/dev/sdd1       309G  155G  138G  53% /
securityfs         0     0     0    - /sys/kernel/security
tmpfs           6.3G   12M  6.3G   1% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
tmpfs           6.3G     0  6.3G   0% /sys/fs/cgroup
cgroup             0     0     0    - /sys/fs/cgroup/systemd
pstore             0     0     0    - /sys/fs/pstore
cgroup             0     0     0    - /sys/fs/cgroup/hugetlb
cgroup             0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup             0     0     0    - /sys/fs/cgroup/pids
cgroup             0     0     0    - /sys/fs/cgroup/net_cls,net_prio
cgroup             0     0     0    - /sys/fs/cgroup/blkio
cgroup             0     0     0    - /sys/fs/cgroup/memory
cgroup             0     0     0    - /sys/fs/cgroup/perf_event
cgroup             0     0     0    - /sys/fs/cgroup/cpuset
cgroup             0     0     0    - /sys/fs/cgroup/freezer
cgroup             0     0     0    - /sys/fs/cgroup/devices
systemd-1          -     -     -    - /proc/sys/fs/binfmt_misc
mqueue             0     0     0    - /dev/mqueue
debugfs            0     0     0    - /sys/kernel/debug
hugetlbfs          0     0     0    - /dev/hugepages
fusectl            0     0     0    - /sys/fs/fuse/connections
binfmt_misc        0     0     0    - /proc/sys/fs/binfmt_misc
cgmfs           103k     0  103k   0% /run/cgmanager/fs
tmpfs           1.3G   54k  1.3G   1% /run/user/1000
gvfsd-fuse         0     0     0    - /run/user/1000/gvfs

And the du command is very useful for returning how much disk space a certain directory takes up.

[email protected] ~ $ du -h ~/Documents/ | tail -n 1
7.8M	/home/jason/Documents/

No comments have been made. Use this form to start the conversation :)

Leave a Reply