由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - compare which file is newer
相关主题
[转载] compareHelp please: 2GB limit on file size
怎么把一个文件的每一行合并到另外一个文件的对应行?请问unix/Linux中设置共享目录
请教怎样使用tar压文件diff -y: how to suppress the same lines?
Help! How to replace string in a variable?question about appending file
怎样将一个大文件分成两个文件?shell script for column operation
怎么样循环执行一个命令?请教一个文件处理的问题
Remove core.xxxx files?请诊断:
a question about shell quotehow to check other machines in NET
相关话题的讨论汇总
话题: newer话题: machine话题: file2话题: file1话题: file
进入Unix版参与讨论
1 (共1页)
i***e
发帖数: 3219
1
how to compare, with a command or script, which file is newer:
one is in the local machine, another is in a remote machine.
e***s
发帖数: 1397
2
how do you define "newer"? based on created time?
modified time? file size? etc.

【在 i***e 的大作中提到】
: how to compare, with a command or script, which file is newer:
: one is in the local machine, another is in a remote machine.

i***e
发帖数: 3219
3
last modified time.

【在 e***s 的大作中提到】
: how do you define "newer"? based on created time?
: modified time? file size? etc.

j***y
发帖数: 87
4
ls -t file1 file2
output:
the first file is newer
or ls -rt file1 file2
output:
the first file is older

【在 i***e 的大作中提到】
: how to compare, with a command or script, which file is newer:
: one is in the local machine, another is in a remote machine.

i***e
发帖数: 3219
5
i mean file1 and file2 are in different machines.

【在 j***y 的大作中提到】
: ls -t file1 file2
: output:
: the first file is newer
: or ls -rt file1 file2
: output:
: the first file is older

b*********l
发帖数: 30
6
ls -t -l file1; rsh ls -t -l file2

【在 i***e 的大作中提到】
: how to compare, with a command or script, which file is newer:
: one is in the local machine, another is in a remote machine.

i***e
发帖数: 3219
7
well, what i want to do is this:
if ["file1 in local machine" newer than "file2 in remote machine"]; then
scp -p file1 me@remote_machine:file2
else
scp -p me@remote_machine:file2 file1
fi
so, how to implement the test of condition? thanks!

【在 b*********l 的大作中提到】
: ls -t -l file1; rsh ls -t -l file2
1 (共1页)
进入Unix版参与讨论
相关主题
how to check other machines in NET怎样将一个大文件分成两个文件?
请教一个问题怎么样循环执行一个命令?
help: how to copy files simultaneously to several foldersRemove core.xxxx files?
Re: help: how to copy files simultaneously to several foldersa question about shell quote
[转载] compareHelp please: 2GB limit on file size
怎么把一个文件的每一行合并到另外一个文件的对应行?请问unix/Linux中设置共享目录
请教怎样使用tar压文件diff -y: how to suppress the same lines?
Help! How to replace string in a variable?question about appending file
相关话题的讨论汇总
话题: newer话题: machine话题: file2话题: file1话题: file