Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:55:36+00:00 2026-05-28T19:55:36+00:00

Here’s an example of the command I’m using: rsync –list-only –include *2012*.xml -exclude *.xml

  • 0

Here’s an example of the command I’m using:

rsync --list-only --include "*2012*.xml" -exclude "*.xml" serveripaddress::pt/dir/files/ --port=111 > output.txt

How can I get a listing of just the file names without the extra information like permissions, timestamp, etc.?

Edit: And is it possible to output each file name on a new line?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:55:37+00:00Added an answer on May 28, 2026 at 7:55 pm

    Hoping the question will be moved to the appropriate site, I’ll answer here nevertheless.

    You could append a pipe with awk:

    rsync ... | awk '{ $1=$2=$3=$4=""; print substr($0,5); }' >output.txt
    

    This eliminates all the unwanted information by outputting everything from the 5th field, but works only if none of the first four fields in the output format gets an additional whitespace somewhere (which is unlikely).

    This awk solution won’t work if there are file names starting with whitespace.

    An even more robust way to solve could be a rather complex program which as well makes assumptions.

    It works this way: For each line,

    • Cut off the first 10 bytes. Verify that they are followed by a number of spaces. Cut them off as well.
    • Cut off all following digits. Verify that they are followed by one space. Cut that off as well.
    • Cut off the next 19 bytes. Verify that they contain a date and a time stamp in the appropriate format. (I don’t know why the date’s components are separated with / instead of - – it is not compliant with ISO 8601.)
    • Verify that now one space follows. Cut that off as well. Leave any following whitespace characters intact, as they belong to the file name.
    • If the test has passed all these verifications, it is likely that the remainder of that line will contain the file name.

    It gets even worse: for very esoteric corner cases, there are even more things to watch: File names can be escaped. Certain unprintable bytes are replaced by an escape sequence (#ooo with ooo being their octal code), a process which must be reversed.

    Thus, neither awk nor a simple sed script will do here if we want to do it properly.

    Instead, the following Python script can be used:

    def rsync_list(fileobj):
        import re
        # Regex to identify a line
        line_re = re.compile(r'.{10} +\d+ ..../../.. ..:..:.. (.*)\n')
        # Regex for escaping
        quoted_re = re.compile(r'\\#(\d\d\d)')
        for line in fileobj:
            match = line_re.match(line)
            assert match, repr(line) # error if not found...
            quoted_fname = match.group(1) # the filename part ...
            # ... must be unquoted:
            fname = quoted_re.sub( # Substitute the matching part...
                lambda m: chr(int(m.group(1), 8)), # ... with the result of this function ...
                quoted_fname)                      # ... while looking at this string.
            yield fname
    
    if __name__ == '__main__':
        import sys
        for fname in rsync_list(sys.stdin):
            #import os
            #print repr(fname), os.access(fname, os.F_OK)
            #print repr(fname)
            sys.stdout.write(fname + '\0')
    

    This outputs the list of file names separated by NUL characters, similiar to the way find -print0 and many other tools work so that even a file name containing a newline character (which is valid!) is retained correctly:

    rsync . | python rsf.py | xan -0 stat -c '%i'
    

    correctly shows the inode number of every given file.

    Certainly I may have missed the one or other corner case I didn’t think of, but I think that the script correctly handles the very most cases (I tested with all 255 thinkable one-byte-filenames as well as a file name starting with a space).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here an example of my checkbox list http://jsfiddle.net/YnM2f/ Let's say I check on G
Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here is an example: I write html code inside of textarea, then I swap
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here's my Manifest: <?xml version=1.0 encoding=utf-8?> <manifest xmlns:android=http://schemas.android.com/apk/res/android package=com.mappp.mobile android:versionCode=1 android:versionName=1.0 > <supports-screens android:largeScreens=true
Here's an example query: DECLARE @table table (loc varchar(10)) INSERT INTO @table VALUES ('134a'),
Here is an example: I have the generic type called Account. I wish to
Here's my test function (c#, visual studio 2010): [TestMethod()] public void TestGetRelevantWeeks() { List<sbyte>
Here is my problem...I have a page that loads a list of clients and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.