Reduce space between numbers and paths in “dirs -v” output












0














I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.



Is there an easy way reduce that space?



enter image description here










share|improve this question


















  • 3




    That space is actually a single tab char... Replace head -10 with sed 's/[[:blank:]]/ /;10q'...
    – don_crissti
    Dec 16 at 20:34












  • Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 - 10q, I'd love to find out more about that. Thanks!
    – Emanuil Rusev
    Dec 16 at 21:05






  • 2




    It's explained in the manual (man sed)... 10q means quit when on line no. 10
    – don_crissti
    Dec 16 at 21:09










  • Awesome, thanks so much!
    – Emanuil Rusev
    Dec 16 at 21:14






  • 1




    dir -v | column -t can help.
    – jimmij
    Dec 16 at 21:51
















0














I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.



Is there an easy way reduce that space?



enter image description here










share|improve this question


















  • 3




    That space is actually a single tab char... Replace head -10 with sed 's/[[:blank:]]/ /;10q'...
    – don_crissti
    Dec 16 at 20:34












  • Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 - 10q, I'd love to find out more about that. Thanks!
    – Emanuil Rusev
    Dec 16 at 21:05






  • 2




    It's explained in the manual (man sed)... 10q means quit when on line no. 10
    – don_crissti
    Dec 16 at 21:09










  • Awesome, thanks so much!
    – Emanuil Rusev
    Dec 16 at 21:14






  • 1




    dir -v | column -t can help.
    – jimmij
    Dec 16 at 21:51














0












0








0







I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.



Is there an easy way reduce that space?



enter image description here










share|improve this question













I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.



Is there an easy way reduce that space?



enter image description here







zsh output






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 16 at 20:15









Emanuil Rusev

1146




1146








  • 3




    That space is actually a single tab char... Replace head -10 with sed 's/[[:blank:]]/ /;10q'...
    – don_crissti
    Dec 16 at 20:34












  • Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 - 10q, I'd love to find out more about that. Thanks!
    – Emanuil Rusev
    Dec 16 at 21:05






  • 2




    It's explained in the manual (man sed)... 10q means quit when on line no. 10
    – don_crissti
    Dec 16 at 21:09










  • Awesome, thanks so much!
    – Emanuil Rusev
    Dec 16 at 21:14






  • 1




    dir -v | column -t can help.
    – jimmij
    Dec 16 at 21:51














  • 3




    That space is actually a single tab char... Replace head -10 with sed 's/[[:blank:]]/ /;10q'...
    – don_crissti
    Dec 16 at 20:34












  • Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 - 10q, I'd love to find out more about that. Thanks!
    – Emanuil Rusev
    Dec 16 at 21:05






  • 2




    It's explained in the manual (man sed)... 10q means quit when on line no. 10
    – don_crissti
    Dec 16 at 21:09










  • Awesome, thanks so much!
    – Emanuil Rusev
    Dec 16 at 21:14






  • 1




    dir -v | column -t can help.
    – jimmij
    Dec 16 at 21:51








3




3




That space is actually a single tab char... Replace head -10 with sed 's/[[:blank:]]/ /;10q'...
– don_crissti
Dec 16 at 20:34






That space is actually a single tab char... Replace head -10 with sed 's/[[:blank:]]/ /;10q'...
– don_crissti
Dec 16 at 20:34














Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 - 10q, I'd love to find out more about that. Thanks!
– Emanuil Rusev
Dec 16 at 21:05




Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 - 10q, I'd love to find out more about that. Thanks!
– Emanuil Rusev
Dec 16 at 21:05




2




2




It's explained in the manual (man sed)... 10q means quit when on line no. 10
– don_crissti
Dec 16 at 21:09




It's explained in the manual (man sed)... 10q means quit when on line no. 10
– don_crissti
Dec 16 at 21:09












Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14




Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14




1




1




dir -v | column -t can help.
– jimmij
Dec 16 at 21:51




dir -v | column -t can help.
– jimmij
Dec 16 at 21:51










2 Answers
2






active

oldest

votes


















1














That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.



You could change the tabstop spacing on the terminal with for instance:



tabs 4


To set the tab stops every 4 columns instead of 8, or pipe the output to:



expand -t4


To convert TABs to spaces with tabstops every 4 column. Or



expand -t4,/8


To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.



Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:



sed $'s/t/ /'





share|improve this answer





























    1














    quick'n dirty



    dirs -v| sed -r 's/s{2,}/ /'





    share|improve this answer





















    • Awesome, could you please explain what each part does? Thanks!
      – Emanuil Rusev
      Dec 16 at 20:58











    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489375%2freduce-space-between-numbers-and-paths-in-dirs-v-output%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.



    You could change the tabstop spacing on the terminal with for instance:



    tabs 4


    To set the tab stops every 4 columns instead of 8, or pipe the output to:



    expand -t4


    To convert TABs to spaces with tabstops every 4 column. Or



    expand -t4,/8


    To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.



    Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:



    sed $'s/t/ /'





    share|improve this answer


























      1














      That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.



      You could change the tabstop spacing on the terminal with for instance:



      tabs 4


      To set the tab stops every 4 columns instead of 8, or pipe the output to:



      expand -t4


      To convert TABs to spaces with tabstops every 4 column. Or



      expand -t4,/8


      To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.



      Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:



      sed $'s/t/ /'





      share|improve this answer
























        1












        1








        1






        That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.



        You could change the tabstop spacing on the terminal with for instance:



        tabs 4


        To set the tab stops every 4 columns instead of 8, or pipe the output to:



        expand -t4


        To convert TABs to spaces with tabstops every 4 column. Or



        expand -t4,/8


        To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.



        Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:



        sed $'s/t/ /'





        share|improve this answer












        That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.



        You could change the tabstop spacing on the terminal with for instance:



        tabs 4


        To set the tab stops every 4 columns instead of 8, or pipe the output to:



        expand -t4


        To convert TABs to spaces with tabstops every 4 column. Or



        expand -t4,/8


        To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.



        Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:



        sed $'s/t/ /'






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 21 at 16:56









        Stéphane Chazelas

        299k54564913




        299k54564913

























            1














            quick'n dirty



            dirs -v| sed -r 's/s{2,}/ /'





            share|improve this answer





















            • Awesome, could you please explain what each part does? Thanks!
              – Emanuil Rusev
              Dec 16 at 20:58
















            1














            quick'n dirty



            dirs -v| sed -r 's/s{2,}/ /'





            share|improve this answer





















            • Awesome, could you please explain what each part does? Thanks!
              – Emanuil Rusev
              Dec 16 at 20:58














            1












            1








            1






            quick'n dirty



            dirs -v| sed -r 's/s{2,}/ /'





            share|improve this answer












            quick'n dirty



            dirs -v| sed -r 's/s{2,}/ /'






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 16 at 20:33









            La Kantara

            212




            212












            • Awesome, could you please explain what each part does? Thanks!
              – Emanuil Rusev
              Dec 16 at 20:58


















            • Awesome, could you please explain what each part does? Thanks!
              – Emanuil Rusev
              Dec 16 at 20:58
















            Awesome, could you please explain what each part does? Thanks!
            – Emanuil Rusev
            Dec 16 at 20:58




            Awesome, could you please explain what each part does? Thanks!
            – Emanuil Rusev
            Dec 16 at 20:58


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489375%2freduce-space-between-numbers-and-paths-in-dirs-v-output%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre