This question already has an answer here:
Consider the following output from
Filesystem Size Used Avail Use% Mounted on /dev/sda1 23G 6.1G 16G 29% / udev 10M 0 10M 0% /dev tmpfs 397M 420K 397M 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 1.8G 904K 1.8G 1% /run/shm /dev/sda6 890G 324G 521G 39% /home /dev/sdb1 459G 267G 169G 62% /home/user/mnt none 4.0K 0 4.0K 0% /sys/fs/cgroup
How can I only show lines that begin with
"/dev" and keep the heading, but filter out everything else. I'd also like to not have to resort to using using temporary files or variables? Note: the heading is locale dependent, therefore you can't catch it with a regexp.