How to display lines in a file like ls displays files in a directory? [duplicate] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionA shell tool to “tablify” input dataHow can a space-delimited list of words be folded into tabular columns that fit in the terminal's widthControlling what files to displayDifferent colour for the KiB range in `ls -l`Filesystem content inspection GUI (like gconf-/dconf-editor)?Why *not* parse `ls` (and what do to instead)?How to split file and save parts to multiple locations?Is there a method to make Multipart or Virtual Files?How to cat all lines together in file/for all files in a directoryAppend lines to beginning of all files in a directoryApplying a command to the current line in less?Find and delete files, whilst keeping any matching files if in a specific directory

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

What's the purpose of writing one's academic biography in the third person?

What LEGO pieces have "real-world" functionality?

Why aren't air breathing engines used as small first stages

How to find out what spells would be useless to a blind NPC spellcaster?

English words in a non-english sci-fi novel

Extract all GPU name, model and GPU ram

Should I use a zero-interest credit card for a large one-time purchase?

How can I make names more distinctive without making them longer?

How does the particle を relate to the verb 行く in the structure「A を + B に行く」?

Using audio cues to encourage good posture

What would be the ideal power source for a cybernetic eye?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

ListPlot join points by nearest neighbor rather than order

Should I discuss the type of campaign with my players?

Why didn't this character "real die" when they blew their stack out in Altered Carbon?

Generate an RGB colour grid

What's the meaning of 間時肆拾貳 at a car parking sign

Check which numbers satisfy the condition [A*B*C = A! + B! + C!]

If a contract sometimes uses the wrong name, is it still valid?

Why was the term "discrete" used in discrete logarithm?

How do pianists reach extremely loud dynamics?

What is the logic behind the Maharil's explanation of why we don't say שעשה ניסים on Pesach?

List of Python versions



How to display lines in a file like ls displays files in a directory? [duplicate]



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionA shell tool to “tablify” input dataHow can a space-delimited list of words be folded into tabular columns that fit in the terminal's widthControlling what files to displayDifferent colour for the KiB range in `ls -l`Filesystem content inspection GUI (like gconf-/dconf-editor)?Why *not* parse `ls` (and what do to instead)?How to split file and save parts to multiple locations?Is there a method to make Multipart or Virtual Files?How to cat all lines together in file/for all files in a directoryAppend lines to beginning of all files in a directoryApplying a command to the current line in less?Find and delete files, whilst keeping any matching files if in a specific directory



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5
















This question already has an answer here:



  • A shell tool to “tablify” input data

    2 answers



  • How can a space-delimited list of words be folded into tabular columns that fit in the terminal's width

    2 answers



I have a long file with short lines (one word) f that I would like to inspect.
It would fit on the screen if it wasn't for the newlines.



If the data was already arranged in columns I could just do column -t but I want my one column to be split into many.



Knowing the length of the file I could just do:



$ sed -n '1,10p' f > f1
$ sed -n '11,20p' f > f2
$ sed -n '21,30p' f > f3
$ sed -n '31,40p' f > f4
$ sed -n '41,50p' f > f5
$ paste f[1-5]


I imagine one could also make a new directory, apply touch on every line, do ls, delete the directory.



But is there an easy way to do this without creating any files?










share|improve this question









New contributor




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











marked as duplicate by muru, Kusalananda Apr 12 at 14:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























    5
















    This question already has an answer here:



    • A shell tool to “tablify” input data

      2 answers



    • How can a space-delimited list of words be folded into tabular columns that fit in the terminal's width

      2 answers



    I have a long file with short lines (one word) f that I would like to inspect.
    It would fit on the screen if it wasn't for the newlines.



    If the data was already arranged in columns I could just do column -t but I want my one column to be split into many.



    Knowing the length of the file I could just do:



    $ sed -n '1,10p' f > f1
    $ sed -n '11,20p' f > f2
    $ sed -n '21,30p' f > f3
    $ sed -n '31,40p' f > f4
    $ sed -n '41,50p' f > f5
    $ paste f[1-5]


    I imagine one could also make a new directory, apply touch on every line, do ls, delete the directory.



    But is there an easy way to do this without creating any files?










    share|improve this question









    New contributor




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











    marked as duplicate by muru, Kusalananda Apr 12 at 14:38


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















      5












      5








      5









      This question already has an answer here:



      • A shell tool to “tablify” input data

        2 answers



      • How can a space-delimited list of words be folded into tabular columns that fit in the terminal's width

        2 answers



      I have a long file with short lines (one word) f that I would like to inspect.
      It would fit on the screen if it wasn't for the newlines.



      If the data was already arranged in columns I could just do column -t but I want my one column to be split into many.



      Knowing the length of the file I could just do:



      $ sed -n '1,10p' f > f1
      $ sed -n '11,20p' f > f2
      $ sed -n '21,30p' f > f3
      $ sed -n '31,40p' f > f4
      $ sed -n '41,50p' f > f5
      $ paste f[1-5]


      I imagine one could also make a new directory, apply touch on every line, do ls, delete the directory.



      But is there an easy way to do this without creating any files?










      share|improve this question









      New contributor




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













      This question already has an answer here:



      • A shell tool to “tablify” input data

        2 answers



      • How can a space-delimited list of words be folded into tabular columns that fit in the terminal's width

        2 answers



      I have a long file with short lines (one word) f that I would like to inspect.
      It would fit on the screen if it wasn't for the newlines.



      If the data was already arranged in columns I could just do column -t but I want my one column to be split into many.



      Knowing the length of the file I could just do:



      $ sed -n '1,10p' f > f1
      $ sed -n '11,20p' f > f2
      $ sed -n '21,30p' f > f3
      $ sed -n '31,40p' f > f4
      $ sed -n '41,50p' f > f5
      $ paste f[1-5]


      I imagine one could also make a new directory, apply touch on every line, do ls, delete the directory.



      But is there an easy way to do this without creating any files?





      This question already has an answer here:



      • A shell tool to “tablify” input data

        2 answers



      • How can a space-delimited list of words be folded into tabular columns that fit in the terminal's width

        2 answers







      files ls cat






      share|improve this question









      New contributor




      user2740 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




      user2740 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 Apr 12 at 8:23







      user2740













      New contributor




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









      asked Apr 11 at 11:40









      user2740user2740

      23118




      23118




      New contributor




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





      New contributor





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






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




      marked as duplicate by muru, Kusalananda Apr 12 at 14:38


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by muru, Kusalananda Apr 12 at 14:38


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






















          3 Answers
          3






          active

          oldest

          votes


















          10














          Oh, nevermind! column does that:



          column f displays newline separated items in file f in columns, which has the same effect as ls on a directory.






          share|improve this answer










          New contributor




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




















          • @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

            – user2740
            Apr 11 at 13:45


















          4














          Alternatively, there's the fmt utility (check your local man page):



          $ seq 100 > f
          $ fmt --width 50 file
          1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
          19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
          35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
          51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
          67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
          83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
          99 100


          or pr:



          $ pr -15 -w 50 -a -s' ' -t file
          1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
          16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
          31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
          46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
          61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
          76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
          91 92 93 94 95 96 97 98 99 10





          share|improve this answer






























            2














            With zsh:



            $ seq 20 > file
            $ print -rC5 -- $(f)"$(<file)"
            1 5 9 13 17
            2 6 10 14 18
            3 7 11 15 19
            4 8 12 16 20
            $ print -raC5 -- $(f)"$(<file)"
            1 2 3 4 5
            6 7 8 9 10
            11 12 13 14 15
            16 17 18 19 20





            share|improve this answer





























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              10














              Oh, nevermind! column does that:



              column f displays newline separated items in file f in columns, which has the same effect as ls on a directory.






              share|improve this answer










              New contributor




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




















              • @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

                – user2740
                Apr 11 at 13:45















              10














              Oh, nevermind! column does that:



              column f displays newline separated items in file f in columns, which has the same effect as ls on a directory.






              share|improve this answer










              New contributor




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




















              • @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

                – user2740
                Apr 11 at 13:45













              10












              10








              10







              Oh, nevermind! column does that:



              column f displays newline separated items in file f in columns, which has the same effect as ls on a directory.






              share|improve this answer










              New contributor




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










              Oh, nevermind! column does that:



              column f displays newline separated items in file f in columns, which has the same effect as ls on a directory.







              share|improve this answer










              New contributor




              user2740 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 answer



              share|improve this answer








              edited Apr 11 at 13:40





















              New contributor




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









              answered Apr 11 at 11:48









              user2740user2740

              23118




              23118




              New contributor




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





              New contributor





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






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












              • @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

                – user2740
                Apr 11 at 13:45

















              • @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

                – user2740
                Apr 11 at 13:45
















              @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

              – user2740
              Apr 11 at 13:45





              @SaggingRufus I've edited my answer to include the exact command. As for how I came up with it, I had used column -t in the past to prettyprint files that were already organized into columns and tried column without parameters more to see what happens than because I expected it to work.

              – user2740
              Apr 11 at 13:45













              4














              Alternatively, there's the fmt utility (check your local man page):



              $ seq 100 > f
              $ fmt --width 50 file
              1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
              19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
              35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
              51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
              67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
              83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
              99 100


              or pr:



              $ pr -15 -w 50 -a -s' ' -t file
              1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
              16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
              31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
              46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
              61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
              76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
              91 92 93 94 95 96 97 98 99 10





              share|improve this answer



























                4














                Alternatively, there's the fmt utility (check your local man page):



                $ seq 100 > f
                $ fmt --width 50 file
                1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
                19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
                35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
                51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
                67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
                83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
                99 100


                or pr:



                $ pr -15 -w 50 -a -s' ' -t file
                1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
                16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
                31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
                46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
                61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
                76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
                91 92 93 94 95 96 97 98 99 10





                share|improve this answer

























                  4












                  4








                  4







                  Alternatively, there's the fmt utility (check your local man page):



                  $ seq 100 > f
                  $ fmt --width 50 file
                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
                  19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
                  35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
                  51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
                  67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
                  83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
                  99 100


                  or pr:



                  $ pr -15 -w 50 -a -s' ' -t file
                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
                  16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
                  31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
                  46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
                  61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
                  76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
                  91 92 93 94 95 96 97 98 99 10





                  share|improve this answer













                  Alternatively, there's the fmt utility (check your local man page):



                  $ seq 100 > f
                  $ fmt --width 50 file
                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
                  19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
                  35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
                  51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
                  67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
                  83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
                  99 100


                  or pr:



                  $ pr -15 -w 50 -a -s' ' -t file
                  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
                  16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
                  31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
                  46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
                  61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
                  76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
                  91 92 93 94 95 96 97 98 99 10






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 11 at 19:39









                  Jeff SchallerJeff Schaller

                  45.1k1164147




                  45.1k1164147





















                      2














                      With zsh:



                      $ seq 20 > file
                      $ print -rC5 -- $(f)"$(<file)"
                      1 5 9 13 17
                      2 6 10 14 18
                      3 7 11 15 19
                      4 8 12 16 20
                      $ print -raC5 -- $(f)"$(<file)"
                      1 2 3 4 5
                      6 7 8 9 10
                      11 12 13 14 15
                      16 17 18 19 20





                      share|improve this answer



























                        2














                        With zsh:



                        $ seq 20 > file
                        $ print -rC5 -- $(f)"$(<file)"
                        1 5 9 13 17
                        2 6 10 14 18
                        3 7 11 15 19
                        4 8 12 16 20
                        $ print -raC5 -- $(f)"$(<file)"
                        1 2 3 4 5
                        6 7 8 9 10
                        11 12 13 14 15
                        16 17 18 19 20





                        share|improve this answer

























                          2












                          2








                          2







                          With zsh:



                          $ seq 20 > file
                          $ print -rC5 -- $(f)"$(<file)"
                          1 5 9 13 17
                          2 6 10 14 18
                          3 7 11 15 19
                          4 8 12 16 20
                          $ print -raC5 -- $(f)"$(<file)"
                          1 2 3 4 5
                          6 7 8 9 10
                          11 12 13 14 15
                          16 17 18 19 20





                          share|improve this answer













                          With zsh:



                          $ seq 20 > file
                          $ print -rC5 -- $(f)"$(<file)"
                          1 5 9 13 17
                          2 6 10 14 18
                          3 7 11 15 19
                          4 8 12 16 20
                          $ print -raC5 -- $(f)"$(<file)"
                          1 2 3 4 5
                          6 7 8 9 10
                          11 12 13 14 15
                          16 17 18 19 20






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 12 at 8:51









                          Stéphane ChazelasStéphane Chazelas

                          315k57597955




                          315k57597955













                              Popular posts from this blog

                              Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                              Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                              What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company