Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I need to grep only /

I need to grep on a output line, but only keeping the line with /

tmpfs                                401848      1200    400648   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  19430032   9664212   8753496  53% /
tmpfs                               2009224         8   2009216   1% /dev/shm
tmpfs                                  5120         0      5120   0% /run/lock
/dev/sda2                           1992552    253624   1617688  14% /boot
Shared                            498179396 371979712 126199684  75% /mnt/share
tmpfs                                401844         4    401840   1% /run/user/1000

In this case, the second line

df | grep / gives all the lines

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

$ matches end of line:

df | grep /$
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading