Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
  1. How would I list only the files modified today?

  2. How would I 'scp' the files updated today to another server?

  3. How would I list files with modified date?

share|improve this question
    
To handle your ultimate goal quicker and easier you might want to try rsync. It was made for that. –  Keith Dec 30 '10 at 10:30
add comment

migrated from stackoverflow.com Dec 30 '10 at 9:15

This question came from our site for professional and enthusiast programmers.

2 Answers

first question:

find YOUR_DIR -type -f -mtime 0

second question:

for file in $(find DIR -type -f -mtime 0); do scp $file server:$file; done

third question:

ls -al YOUR_FILE
stat -c %y YOUR_FILE
share|improve this answer
add comment

$(...) is prone to expansion issues. Use find -exec or xargs instead. scp also fails to preserve attributes.

Thus, second question's answer:

find DIR -type f -mtime 0 -exec rsync -Sav '{}' server: \; ; done

(And it's also independent of ubuntu.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.