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
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
3 楼
last modified time.
【在 e***s 的大作中提到】 : how do you define "newer"? based on created time? : modified time? file size? etc.
j*y
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
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
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
7 楼
well, what i want to do is this: if ["file1 in local machine" newer than "file2 in remote machine"]; then scp -p file1 [email protected]_machine:file2 else scp -p [email protected]_machine:file2 file1 fi so, how to implement the test of condition? thanks!
【在 b*********l 的大作中提到】 : ls -t -l file1; rsh ls -t -l file2