简体   繁体   中英

output filenames when using mv command linux

I was wondering if there is a way to output the list of files moved when using the mv command in a shell script?

I am moving files from one directory to another on the same server I'm using a shell script with the following: find path/to/source/ -type -f -name "CC*.txt -mmin+1 -exec mv {} /path/to/destination \\;

This is also called via a crontab

Hope this will help:

mv source/* destination/ | ll destination/ > /tmp/list.txt

You can use ll OR ls according to your need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM