cut / grep df -h

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?



Filesystem Size Used Avail Use% Mounted on

vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07









share|improve this question









New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Possible duplicate of How do I get / available space with "df" and output it to a log file?
    – Jeff Schaller
    4 mins ago














up vote
1
down vote

favorite












How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?



Filesystem Size Used Avail Use% Mounted on

vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07









share|improve this question









New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Possible duplicate of How do I get / available space with "df" and output it to a log file?
    – Jeff Schaller
    4 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?



Filesystem Size Used Avail Use% Mounted on

vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07









share|improve this question









New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











How can I get the mount point "3.1T" under the column " Avail" (using grep or cut)?



Filesystem Size Used Avail Use% Mounted on

vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07






linux text-processing disk-usage columns






share|improve this question









New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 7 mins ago









Jeff Schaller

32.9k849111




32.9k849111






New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









Luan Pham

61




61




New contributor




Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Luan Pham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Possible duplicate of How do I get / available space with "df" and output it to a log file?
    – Jeff Schaller
    4 mins ago
















  • Possible duplicate of How do I get / available space with "df" and output it to a log file?
    – Jeff Schaller
    4 mins ago















Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago




Possible duplicate of How do I get / available space with "df" and output it to a log file?
– Jeff Schaller
4 mins ago










4 Answers
4






active

oldest

votes

















up vote
5
down vote













Use awk



awk 'print $4'
3.1T

echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'


or cut:



cut -d" " -f4
3.1T

echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4


or grep



 echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'

grep -o 'b3.1Tb'
3.1T

b in a regular expression means "word boundary".
-o, --only-matching





share|improve this answer






















  • given the Linux tag, it might be worth mentioning --output
    – Jeff Schaller
    6 mins ago










  • @JeffSchaller. Kindly where?
    – Goro
    2 mins ago

















up vote
1
down vote













try the below command,



df -h | grep /vstorage/cluster07 | awk 'print $4'





share|improve this answer



























    up vote
    0
    down vote













    With sed:



    df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'





    share|improve this answer



























      up vote
      0
      down vote













      Tell df what to output:



      df -h --output=avail | tail -n1




      share




















        Your Answer







        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );






        Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.









         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471790%2fcut-grep-df-h%23new-answer', 'question_page');

        );

        Post as a guest






























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        5
        down vote













        Use awk



        awk 'print $4'
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'


        or cut:



        cut -d" " -f4
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4


        or grep



         echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'

        grep -o 'b3.1Tb'
        3.1T

        b in a regular expression means "word boundary".
        -o, --only-matching





        share|improve this answer






















        • given the Linux tag, it might be worth mentioning --output
          – Jeff Schaller
          6 mins ago










        • @JeffSchaller. Kindly where?
          – Goro
          2 mins ago














        up vote
        5
        down vote













        Use awk



        awk 'print $4'
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'


        or cut:



        cut -d" " -f4
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4


        or grep



         echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'

        grep -o 'b3.1Tb'
        3.1T

        b in a regular expression means "word boundary".
        -o, --only-matching





        share|improve this answer






















        • given the Linux tag, it might be worth mentioning --output
          – Jeff Schaller
          6 mins ago










        • @JeffSchaller. Kindly where?
          – Goro
          2 mins ago












        up vote
        5
        down vote










        up vote
        5
        down vote









        Use awk



        awk 'print $4'
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'


        or cut:



        cut -d" " -f4
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4


        or grep



         echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'

        grep -o 'b3.1Tb'
        3.1T

        b in a regular expression means "word boundary".
        -o, --only-matching





        share|improve this answer














        Use awk



        awk 'print $4'
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | awk 'print $4'


        or cut:



        cut -d" " -f4
        3.1T

        echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | cut -d" " -f4


        or grep



         echo vstorage://cluster07 4.0T 907G 3.1T 23% /vstorage/cluster07 | grep -o 'b3.1Tb'

        grep -o 'b3.1Tb'
        3.1T

        b in a regular expression means "word boundary".
        -o, --only-matching






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 33 secs ago

























        answered 1 hour ago









        Goro

        4,77352358




        4,77352358











        • given the Linux tag, it might be worth mentioning --output
          – Jeff Schaller
          6 mins ago










        • @JeffSchaller. Kindly where?
          – Goro
          2 mins ago
















        • given the Linux tag, it might be worth mentioning --output
          – Jeff Schaller
          6 mins ago










        • @JeffSchaller. Kindly where?
          – Goro
          2 mins ago















        given the Linux tag, it might be worth mentioning --output
        – Jeff Schaller
        6 mins ago




        given the Linux tag, it might be worth mentioning --output
        – Jeff Schaller
        6 mins ago












        @JeffSchaller. Kindly where?
        – Goro
        2 mins ago




        @JeffSchaller. Kindly where?
        – Goro
        2 mins ago












        up vote
        1
        down vote













        try the below command,



        df -h | grep /vstorage/cluster07 | awk 'print $4'





        share|improve this answer
























          up vote
          1
          down vote













          try the below command,



          df -h | grep /vstorage/cluster07 | awk 'print $4'





          share|improve this answer






















            up vote
            1
            down vote










            up vote
            1
            down vote









            try the below command,



            df -h | grep /vstorage/cluster07 | awk 'print $4'





            share|improve this answer












            try the below command,



            df -h | grep /vstorage/cluster07 | awk 'print $4'






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 58 mins ago









            EBIN GLADSON

            976




            976




















                up vote
                0
                down vote













                With sed:



                df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'





                share|improve this answer
























                  up vote
                  0
                  down vote













                  With sed:



                  df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'





                  share|improve this answer






















                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    With sed:



                    df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'





                    share|improve this answer












                    With sed:



                    df -h | sed -rn 's|[^ ]+ +([^ ]+) .*|1|p'






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 56 mins ago









                    Hkoof

                    89966




                    89966




















                        up vote
                        0
                        down vote













                        Tell df what to output:



                        df -h --output=avail | tail -n1




                        share
























                          up vote
                          0
                          down vote













                          Tell df what to output:



                          df -h --output=avail | tail -n1




                          share






















                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            Tell df what to output:



                            df -h --output=avail | tail -n1




                            share












                            Tell df what to output:



                            df -h --output=avail | tail -n1





                            share











                            share


                            share










                            answered 1 min ago









                            RoVo

                            1,665213




                            1,665213




















                                Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.









                                 

                                draft saved


                                draft discarded


















                                Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.












                                Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.











                                Luan Pham is a new contributor. Be nice, and check out our Code of Conduct.













                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471790%2fcut-grep-df-h%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Comments

                                Popular posts from this blog

                                What does second last employer means? [closed]

                                List of Gilmore Girls characters

                                Confectionery