Compare a remote file with a local file

ssh user@host cat /path/to/remotefile | diff /path/to/localfile -
Useful for checking if there are differences between local and remote files.

By: root
2009-02-04 11:33:19

6 Alternatives + Submit Alt

What Others Think

These commands all require transferring the entire file to the local computer, if the file is large or you are on a slow link this command is very slow. I have posted an alternative that computes the md5sum instead but it has yet to be approved.
gnif · 351 weeks and 5 days ago
kitchen remodeling grand rapids you are soo inspiring! thanks for this!
yeoyeo · 61 weeks and 5 days ago
great site! glad i found this. any recent updates? painters huntsville
looneyhans · 48 weeks ago
This article is an engaging abundance of enlightening information that is intriguing and elegantly composed. I praise your diligent work on this and thank you for this data. You have what it takes to get consideration. ??
KayGasaway · 44 weeks and 6 days ago
Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers! ??
KayGasaway · 44 weeks and 1 day ago
This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: ????
KayGasaway · 43 weeks and 4 days ago
Thats just great solution of the problem! Very helpful I am new to coding try to learn something new Now I am just an editor with but I am working hard
PatrickHenderson · 42 weeks and 6 days ago
Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. Onewheel
KayGasaway · 42 weeks and 1 day ago
I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge. Onewheel
KayGasaway · 41 weeks and 4 days ago
You've completed in excellent work. t suggest to my frtends ind personilly wtll certitnly dtgtt. t'm conftdent they'll be gitned from thts webstte. Managed IT Support near me Rancho Park Los Angeles
KayGasaway · 41 weeks and 2 days ago
This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform!
KayGasaway · 41 weeks and 1 day ago
Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return.">kanata winter tires
KayGasaway · 37 weeks and 3 days ago
Find the Maldives Holidays Package & right Luxury hotel for your honeymoon or Holidays Rawnaq Tourism recommends the Best MaldivesM Hotels depending on your individual needs
KayGasaway · 37 weeks and 3 days ago
I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, eye doctor Collinsville
KayGasaway · 36 weeks ago
No Deposit Casino Sites 2021 are quite a popular choice for players online, casino with no deposit is a very effective way to play online games without spending any capital start. No Deposit Casino Sites 2021
KayGasaway · 25 weeks and 4 days ago
Glad I came across this website. thanks. santa rosa commercial handyman
mark21 · 9 weeks and 5 days ago
seofox · 8 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: