首页 \ 问答 \ 使用unix比较两台服务器上两个目录中的文件(compare files in two directory on two servers using unix)

使用unix比较两台服务器上两个目录中的文件(compare files in two directory on two servers using unix)

还有一个类似的问题: 使用unix比较远程服务器上两个目录中的文件

但我的情况是我无法登录远程服务器,它是客户机,所以不能使用rsync,但我可以请求客户导出目录结构,告诉我dir / file的名称,大小,md5值等。

我只想显示不同内容的文件名。

怎么做? 最好使用ksh ...

提前致谢。


There is a similar question: compare files in two directory on remote server using unix

But my situation is I can not login the remote server, it's customer machine, so can not use rsync, but I can request customer to export the directory structure, tell me the dir/file's name, size, md5 value etc.

I only want to display the file name that in different content.

How to do it? best using ksh...

Thanks in advance.


原文:https://stackoverflow.com/questions/22228326
更新时间:2022-12-01 17:12

最满意答案

最有可能发生这种情况是因为全局gemset包含all宝石,请尝试:

rvm 1.9.2@global gem list

你可以将它与宝石列表进行比较,看看你的宝石:

rvm use 1.9.2
diff --normal <(gem list) <( rvm 1.9.2@global gem list ) | sed '/^[^<]/ d ; s/^< //'

或仅使用GEM_HOME作为GEM_PATH

GEM_PATH=$GEM_HOME gem list

most likely this happens because the global gemset contains all the gems, try:

rvm 1.9.2@global gem list

you can compare this with gem list to see only your gems:

rvm use 1.9.2
diff --normal <(gem list) <( rvm 1.9.2@global gem list ) | sed '/^[^<]/ d ; s/^< //'

or using only GEM_HOME as GEM_PATH:

GEM_PATH=$GEM_HOME gem list

相关问答

更多
  • 根据http://redmine.ruby-lang.org/issues/4651,它是Ruby中的一个问题,并在1.9.3中修复。 或者,您可以使用gcc重建ruby 1.9.2, 而不是 Apple的llvm-gcc,这是XCode 4.x上的默认gcc。 如果你在构建Ruby之前犯了一个不幸的错误(像我一样)升级到XCode 4.2,你需要降级到XCode 4.1或安装GCC 如果您是Apple开发人员, 这个要点有一个指向XCode 4.1安装程序的链接。 否则,您可以使用此安装程序安装GCC并将 ...
  • 它可能有所帮助: brew uninstall xz gem install nokogiri -v 1.6.8或gem install rails (命令你正在运行) It might help: brew uninstall xz gem install nokogiri -v 1.6.8 or gem install rails (command you are running)
  • 跟踪运行gem install -V --backtrace --debug haml (谢谢zzzhc)并仔细查看/home/mark/.gem目录后,我发现没有安装gems,只有gemspec文件和宝石源文件。 本着实验的精神,我删除了/home/mark/.gem并重新运行了gem install命令,并突然它正在工作。 而且它已经为我刚刚安装的宝石重新创建了包含gemspecs的/home/mark/.gem 。 现在很明显,我错误地解释了原始问题中的错误信息; 在尝试将gem安装到/home/ma ...
  • 这里的问题是我第一次安装hpricot gem时没有使用@global gemset。 解释器的默认gemset与该解释器的@global gemset之间存在差异。 所以你可以达到预期的效果 $ rvm use ruby-1.9.2@global Using /home/bshaver/.rvm/gems/ruby-1.9.2-p180 with gemset global $ gem install validation_refelection Fetching: validation_reflect ...
  • 在红宝石1.8中,你需要在需要其他宝石之前需要rubygems。 例如 require 'rubygems' require 'nokogiri' In ruby 1.8 you need to require rubygems before you require other gems. e.g. require 'rubygems' require 'nokogiri'
  • 最有可能发生这种情况是因为全局gemset包含all宝石,请尝试: rvm 1.9.2@global gem list 你可以将它与宝石列表进行比较,看看你的宝石: rvm use 1.9.2 diff --normal <(gem list) <( rvm 1.9.2@global gem list ) | sed '/^[^<]/ d ; s/^< //' 或仅使用GEM_HOME作为GEM_PATH : GEM_PATH=$GEM_HOME gem list most likely this h ...
  • 当您使用Debian时我的猜测是你使用gnome-terminal,默认情况下它没有启用登录shell: https : //rvm.io/integration/gnome-terminal/ 有关shell登录的更多详细信息: https://rvm.io/support/faq/#shell_login 该文档描述了shell登录的当前状态,这并不总是这样,并且长时间被混淆和误用/误解(仍然是少数工具和少数开发人员) As you are using Debian my guess is you us ...
  • 好吧,我明白了! 有一个只与rails 3兼容的authlogic的新版本。由于新的rvm gemset需要安装authlogic,它只是抓住了最新的版本。 为了解决这个问题,我只需要在我的environment.rb文件中包含正确的rails 2版本: config.gem "authlogic", :version => '2.1.6' 这种错误信息在这种情况下是有误导性的。 Gem只安装了不是由rails 2支持的版本。 Ok I figured it out! There is a new ver ...
  • 确保你的rvm是最新的: rvm get stable 然后你需要运行: rvm use ruby 这将确保您的环境设置正确,如果出现问题,它会显示警告,您需要始终阅读警告 - 并按照说明操作 使用ruby持久化下一个shell会话使用: rvm use --default ruby 它将创建在启动rvm时加载的default别名 make sure your rvm is up to date: rvm get stable then you need to run: rvm use ruby ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)