Skip to main content
added 97 characters in body
Source Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k

As noted by others:

df -hPh | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -hPh /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The -P option guarantees that df won't break a line even if one of the columns is wide.

The advantage with the second method is that df will space the columns appropriately for the output.

As noted by others:

df -h | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -h /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The advantage with the second method is that df will space the columns appropriately for the output.

As noted by others:

df -Ph | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -Ph /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The -P option guarantees that df won't break a line even if one of the columns is wide.

The advantage with the second method is that df will space the columns appropriately for the output.

deleted 23 characters in body
Source Link
user14755
user14755

As suggestednoted by others, you could use awk:

df -h | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -h /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The advantage with the second method is that df will space the columns appropriately for the output.

As suggested by others, you could use awk:

df -h | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -h /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The advantage with the second method is that df will space the columns appropriately for the output.

As noted by others:

df -h | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -h /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The advantage with the second method is that df will space the columns appropriately for the output.

Source Link
user14755
user14755

As suggested by others, you could use awk:

df -h | awk 'NR == 1 || $0 ~ "^/dev/nvme"'

Alternatively, Linux df allows you to specify the device file on the command line:

df -x devtmpfs -h /dev/nvme*

The -x devtmpfs is to prevent the /dev filesystem from showing up when a matching device is not mounted.

The advantage with the second method is that df will space the columns appropriately for the output.