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 23, 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

Why is it faster to reheat something than it is to cook it?

How fail-safe is nr as stop bytes?

preposition before coffee

What is the home of the drow in Flanaess?

In musical terms, what properties are varied by the human voice to produce different words / syllables?

Movie where a circus ringmaster turns people into animals

Misunderstanding of Sylow theory

Why are vacuum tubes still used in amateur radios?

How to unroll a parameter pack from right to left

How does a spellshard spellbook work?

Put R under double integral

Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?

Why are my pictures showing a dark band on one edge?

Is CEO the "profession" with the most psychopaths?

How much damage would a cupful of neutron star matter do to the Earth?

How to draw/optimize this graph with tikz

Antipodal Land Area Calculation

Is it possible to give , in economics, an example of a relation ( set of ordered pairs) that is not a function?

File name problem(?)

Is there hard evidence that the grant peer review system performs significantly better than random?

What is the difference between globalisation and imperialism?

What order were files/directories output in dir?

Why do early math courses focus on the cross sections of a cone and not on other 3D objects?

Interpretation of R output from Cohen's Kappa



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 23, 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















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















    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

















      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















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 12 at 8:23







      user2740

















      asked Apr 11 at 11:40









      user2740user2740

      23118




      23118




      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

























          • @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

























              • @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

























              • @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















              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














              share|improve this answer



              share|improve this answer








              edited Apr 11 at 13:40

























              answered Apr 11 at 11:48









              user2740user2740

              23118




              23118












              • @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

                              Romeo and Juliet ContentsCharactersSynopsisSourcesDate and textThemes and motifsCriticism and interpretationLegacyScene by sceneSee alsoNotes and referencesSourcesExternal linksNavigation menu"Consumer Price Index (estimate) 1800–"10.2307/28710160037-3222287101610.1093/res/II.5.31910.2307/45967845967810.2307/2869925286992510.1525/jams.1982.35.3.03a00050"Dada Masilo: South African dancer who breaks the rules"10.1093/res/os-XV.57.1610.2307/28680942868094"Sweet Sorrow: Mann-Korman's Romeo and Juliet Closes Sept. 5 at MN's Ordway"the original10.2307/45957745957710.1017/CCOL0521570476.009"Ram Leela box office collections hit massive Rs 100 crore, pulverises prediction"Archived"Broadway Revival of Romeo and Juliet, Starring Orlando Bloom and Condola Rashad, Will Close Dec. 8"Archived10.1075/jhp.7.1.04hon"Wherefore art thou, Romeo? To make us laugh at Navy Pier"the original10.1093/gmo/9781561592630.article.O006772"Ram-leela Review Roundup: Critics Hail Film as Best Adaptation of Romeo and Juliet"Archived10.2307/31946310047-77293194631"Romeo and Juliet get Twitter treatment""Juliet's Nurse by Lois Leveen""Romeo and Juliet: Orlando Bloom's Broadway Debut Released in Theaters for Valentine's Day"Archived"Romeo and Juliet Has No Balcony"10.1093/gmo/9781561592630.article.O00778110.2307/2867423286742310.1076/enst.82.2.115.959510.1080/00138380601042675"A plague o' both your houses: error in GCSE exam paper forces apology""Juliet of the Five O'Clock Shadow, and Other Wonders"10.2307/33912430027-4321339124310.2307/28487440038-7134284874410.2307/29123140149-661129123144728341M"Weekender Guide: Shakespeare on The Drive""balcony"UK public library membership"romeo"UK public library membership10.1017/CCOL9780521844291"Post-Zionist Critique on Israel and the Palestinians Part III: Popular Culture"10.2307/25379071533-86140377-919X2537907"Capulets and Montagues: UK exam board admit mixing names up in Romeo and Juliet paper"Istoria Novellamente Ritrovata di Due Nobili Amanti2027/mdp.390150822329610820-750X"GCSE exam error: Board accidentally rewrites Shakespeare"10.2307/29176390149-66112917639"Exam board apologises after error in English GCSE paper which confused characters in Shakespeare's Romeo and Juliet""From Mariotto and Ganozza to Romeo and Guilietta: Metamorphoses of a Renaissance Tale"10.2307/37323537323510.2307/2867455286745510.2307/28678912867891"10 Questions for Taylor Swift"10.2307/28680922868092"Haymarket Theatre""The Zeffirelli Way: Revealing Talk by Florentine Director""Michael Smuin: 1938-2007 / Prolific dance director had showy career"The Life and Art of Edwin BoothRomeo and JulietRomeo and JulietRomeo and JulietRomeo and JulietEasy Read Romeo and JulietRomeo and Julieteeecb12003684p(data)4099369-3n8211610759dbe00d-a9e2-41a3-b2c1-977dd692899302814385X313670221313670221

                              Creating closest line along the point''s azimuth using PostgreSQL Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Drawing line between points at specific distance in PostGIS?How to efficiently find the closest point over the dateline?How to find the nearest point by using PostGIS function?PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+Creating a table and inserting selected streets using plpgsql functionsCreating a table that stores Distances and other columnSaving select query results (year wise) from PostgreSQL/PostGIS to text filesWhat is the information behind this geometry?How to give start and end vertex ids dynamically in pgr_dijkstra?Point to Polygon nearest distance DS_distance is not using geography index & knn <-> or <#> does not give result in orderLine to point conversion with start point and end point detection?

                              Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given