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 126231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:17:06+00:00 2026-05-11T05:17:06+00:00

File foo.txt exists on the remote machine at: /home/user/foo.txt It doesn’t exist on the

  • 0

File foo.txt exists on the remote machine at: /home/user/foo.txt

It doesn’t exist on the local machine.

I want to delete foo.txt using rsync.

I do not know (and assume for the purposes of this question that I cannot find out) what other files are in /home/user on either the local or remote machines, so I can’t just sync the whole directory.

What rsync command can I use to delete foo.txt on the remote machine?

  • 1 1 Answer
  • 3 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. 2026-05-11T05:17:06+00:00Added an answer on May 11, 2026 at 5:17 am

    Try this:

    rsync -rv --delete --include=foo.txt '--exclude=*' /home/user/ user@remote:/home/user/ 

    (highly recommend running with --dry-run first to test it) Although it seems like it would be easier to use ssh…

    ssh user@remote 'rm /home/user/foo.txt' 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file foo.txt which I want to delete, and another, bar.txt ,
I want to copy the file c:\a1\b2\c3\foo.txt to d:\a1\b2\c3\foo.txt. The subdirectories don't exist on
Imagine I wish to create (or overwrite) the following file :- C:\Temp\Bar\Foo\Test.txt Using the
If you have a path to a file (for example, /home/bob/test/foo.txt) where each subdirectory
I need to check whether a file in a user's home directory exists so
When using os.system to open a file, eg: os.system(r'C:/foo.txt') , the current Python process,
I'm trying to append, via bash, one text file to another using foo.txt >>
Let's say the source file name is Foo.txt . I want the name of
How can I search if a file named foo.txt was ever committed to my
Given file names like these: /the/path/foo.txt bar.txt I hope to get: foo bar Why

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.