Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  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

migrated from Dec 30 '10 at 9:15

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

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

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

$(...) 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

You must log in to answer this question.