Get permissions and concatenate them in one line2019 Community Moderator Electionfind numbers in parentheses and round themhow to concatenate a file with multiple header into oneRead two text files, concatenate each linesed command and formatting one line helpConcatenate multiple fields separately based on one (key) columnGet lines matching a pattern in one file and put them into a second file matching the same patternconcatenate lines based on first char of next linecompare several text files and summarize them to one fileHow to reformat named.conf's zone blocks into single lines?Get one thing from a line and concatenate it with one thing from another line

Is camera lens focus an exact point or a range?

Proof of Lemma: Every nonzero integer can be written as a product of primes

Could the E-bike drivetrain wear down till needing replacement after 400 km?

What is this type of notehead called?

Should I stop contributing to retirement accounts?

How do ground effect vehicles perform turns?

What does this horizontal bar at the first measure mean?

Global amount of publications over time

How can "mimic phobia" be cured or prevented?

On a tidally locked planet, would time be quantized?

Does having a TSA Pre-Check member in your flight reservation increase the chances that everyone gets Pre-Check?

When quoting, must I also copy hyphens used to divide words that continue on the next line?

Why do IPv6 unique local addresses have to have a /48 prefix?

Proving a function is onto where f(x)=|x|.

A Permanent Norse Presence in America

Structured binding on const

Is there a word to describe the feeling of being transfixed out of horror?

Customize circled numbers

Can I use my Chinese passport to enter China after I acquired another citizenship?

Is possible to search in vim history?

Open a doc from terminal, but not by its name

How to color a curve

How much character growth crosses the line into breaking the character

What does the Rambam mean when he says that the planets have souls?



Get permissions and concatenate them in one line



2019 Community Moderator Electionfind numbers in parentheses and round themhow to concatenate a file with multiple header into oneRead two text files, concatenate each linesed command and formatting one line helpConcatenate multiple fields separately based on one (key) columnGet lines matching a pattern in one file and put them into a second file matching the same patternconcatenate lines based on first char of next linecompare several text files and summarize them to one fileHow to reformat named.conf's zone blocks into single lines?Get one thing from a line and concatenate it with one thing from another line










0















Here is the result of listing the files in a directory.



total 4
-rw-r--r-x 1 y_wc y_wc 6828641 dez 24 18:21 file1
-rw-rw-rw- 1 y_wc y_wc 2051577 dez 24 18:13 file2
-rw-rwxr-x 1 y_wc y_wc 1874334 dez 24 18:14 file3
-rw-rwxrwx 1 y_wc y_wc 2902856 dez 24 18:14 file4


I'd like to concatenate the permissions in one line by the same order by which they appear. Here permissions exclude the file type. The output should be
rw-r--r-xrw-rw-rw-rw-rwxr-xrw-rwxrwx



I'd like solutions using coreutils and, separately, awk.



I'm close with the coreutils solution, but I'm unable to get rid of the file type character. Here's what I got



ls -l | tail -n+2 | cut -d" " -f1 | tr -d 'n'









share|improve this question







New contributor




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
























    0















    Here is the result of listing the files in a directory.



    total 4
    -rw-r--r-x 1 y_wc y_wc 6828641 dez 24 18:21 file1
    -rw-rw-rw- 1 y_wc y_wc 2051577 dez 24 18:13 file2
    -rw-rwxr-x 1 y_wc y_wc 1874334 dez 24 18:14 file3
    -rw-rwxrwx 1 y_wc y_wc 2902856 dez 24 18:14 file4


    I'd like to concatenate the permissions in one line by the same order by which they appear. Here permissions exclude the file type. The output should be
    rw-r--r-xrw-rw-rw-rw-rwxr-xrw-rwxrwx



    I'd like solutions using coreutils and, separately, awk.



    I'm close with the coreutils solution, but I'm unable to get rid of the file type character. Here's what I got



    ls -l | tail -n+2 | cut -d" " -f1 | tr -d 'n'









    share|improve this question







    New contributor




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






















      0












      0








      0








      Here is the result of listing the files in a directory.



      total 4
      -rw-r--r-x 1 y_wc y_wc 6828641 dez 24 18:21 file1
      -rw-rw-rw- 1 y_wc y_wc 2051577 dez 24 18:13 file2
      -rw-rwxr-x 1 y_wc y_wc 1874334 dez 24 18:14 file3
      -rw-rwxrwx 1 y_wc y_wc 2902856 dez 24 18:14 file4


      I'd like to concatenate the permissions in one line by the same order by which they appear. Here permissions exclude the file type. The output should be
      rw-r--r-xrw-rw-rw-rw-rwxr-xrw-rwxrwx



      I'd like solutions using coreutils and, separately, awk.



      I'm close with the coreutils solution, but I'm unable to get rid of the file type character. Here's what I got



      ls -l | tail -n+2 | cut -d" " -f1 | tr -d 'n'









      share|improve this question







      New contributor




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












      Here is the result of listing the files in a directory.



      total 4
      -rw-r--r-x 1 y_wc y_wc 6828641 dez 24 18:21 file1
      -rw-rw-rw- 1 y_wc y_wc 2051577 dez 24 18:13 file2
      -rw-rwxr-x 1 y_wc y_wc 1874334 dez 24 18:14 file3
      -rw-rwxrwx 1 y_wc y_wc 2902856 dez 24 18:14 file4


      I'd like to concatenate the permissions in one line by the same order by which they appear. Here permissions exclude the file type. The output should be
      rw-r--r-xrw-rw-rw-rw-rwxr-xrw-rwxrwx



      I'd like solutions using coreutils and, separately, awk.



      I'm close with the coreutils solution, but I'm unable to get rid of the file type character. Here's what I got



      ls -l | tail -n+2 | cut -d" " -f1 | tr -d 'n'






      text-processing






      share|improve this question







      New contributor




      y_wc 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




      y_wc 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






      New contributor




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









      asked yesterday









      y_wcy_wc

      1196




      1196




      New contributor




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





      New contributor





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






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




















          2 Answers
          2






          active

          oldest

          votes


















          2














          ls has very poor options for formatting . stat has --printf option , to format has you want information about files .



          a example :



          root@linux:~# stat --printf '%An' /etc/passwd /etc
          -rw-r--r--
          drwxr-xr-x


          in tour case because you don't the first character



          root@linux:~# stat --printf '%An' file* | cut -c2-11 | tr -d 'n'





          share|improve this answer

























          • Thanks. But this is printing the file type.

            – y_wc
            yesterday











          • The cut could be just cut -c 2-.

            – Kusalananda
            yesterday


















          1














          The first character can be removed with cut -c 2-



          ls -l | tail -n+2 | cut -d" " -f1 | cut -c 2- | tr -d 'n'





          share|improve this answer






















            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
            );



            );






            y_wc 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%2f508216%2fget-permissions-and-concatenate-them-in-one-line%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









            2














            ls has very poor options for formatting . stat has --printf option , to format has you want information about files .



            a example :



            root@linux:~# stat --printf '%An' /etc/passwd /etc
            -rw-r--r--
            drwxr-xr-x


            in tour case because you don't the first character



            root@linux:~# stat --printf '%An' file* | cut -c2-11 | tr -d 'n'





            share|improve this answer

























            • Thanks. But this is printing the file type.

              – y_wc
              yesterday











            • The cut could be just cut -c 2-.

              – Kusalananda
              yesterday















            2














            ls has very poor options for formatting . stat has --printf option , to format has you want information about files .



            a example :



            root@linux:~# stat --printf '%An' /etc/passwd /etc
            -rw-r--r--
            drwxr-xr-x


            in tour case because you don't the first character



            root@linux:~# stat --printf '%An' file* | cut -c2-11 | tr -d 'n'





            share|improve this answer

























            • Thanks. But this is printing the file type.

              – y_wc
              yesterday











            • The cut could be just cut -c 2-.

              – Kusalananda
              yesterday













            2












            2








            2







            ls has very poor options for formatting . stat has --printf option , to format has you want information about files .



            a example :



            root@linux:~# stat --printf '%An' /etc/passwd /etc
            -rw-r--r--
            drwxr-xr-x


            in tour case because you don't the first character



            root@linux:~# stat --printf '%An' file* | cut -c2-11 | tr -d 'n'





            share|improve this answer















            ls has very poor options for formatting . stat has --printf option , to format has you want information about files .



            a example :



            root@linux:~# stat --printf '%An' /etc/passwd /etc
            -rw-r--r--
            drwxr-xr-x


            in tour case because you don't the first character



            root@linux:~# stat --printf '%An' file* | cut -c2-11 | tr -d 'n'






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered yesterday









            EchoMike444EchoMike444

            1,0306




            1,0306












            • Thanks. But this is printing the file type.

              – y_wc
              yesterday











            • The cut could be just cut -c 2-.

              – Kusalananda
              yesterday

















            • Thanks. But this is printing the file type.

              – y_wc
              yesterday











            • The cut could be just cut -c 2-.

              – Kusalananda
              yesterday
















            Thanks. But this is printing the file type.

            – y_wc
            yesterday





            Thanks. But this is printing the file type.

            – y_wc
            yesterday













            The cut could be just cut -c 2-.

            – Kusalananda
            yesterday





            The cut could be just cut -c 2-.

            – Kusalananda
            yesterday













            1














            The first character can be removed with cut -c 2-



            ls -l | tail -n+2 | cut -d" " -f1 | cut -c 2- | tr -d 'n'





            share|improve this answer



























              1














              The first character can be removed with cut -c 2-



              ls -l | tail -n+2 | cut -d" " -f1 | cut -c 2- | tr -d 'n'





              share|improve this answer

























                1












                1








                1







                The first character can be removed with cut -c 2-



                ls -l | tail -n+2 | cut -d" " -f1 | cut -c 2- | tr -d 'n'





                share|improve this answer













                The first character can be removed with cut -c 2-



                ls -l | tail -n+2 | cut -d" " -f1 | cut -c 2- | tr -d 'n'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                MarvinMarvin

                17616




                17616




















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









                    draft saved

                    draft discarded


















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












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











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














                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508216%2fget-permissions-and-concatenate-them-in-one-line%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

                    getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                    Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In 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 ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                    Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.