The "-p" flag of "cp" preserves the timestamps. Omit it if you want to create the new files using the current time.
SWB-Consulting
ASKER
Thanks, I would like a command that doesn't have to hardcode the filenames through. Basically take any file hat ends in csv and doesn't already have a prefix and copy it into filename with specified prefix.
In reality I have many more filenames sitting in there and I just wanted to simplify for this example.
woolmilkporc
That's what I'd like to call over-simplifying.
Here you go, for always "xyz" (I don't assume that's what you're after, but anyway):
for file in $(ls *.csv); do if [[ "${file#xyz.}" == "$file" ]]; then echo cp -p $file xyz.$file; fi; done
echo is for testing, remove it to actually run the displayed commands.
for file in popups.csv search.csv; do cp -p $file xyz.$file; done
Two commands?
cp -p popups.csv xyz.popups.csv
cp -p search.csv xyz.search.csv
The "-p" flag of "cp" preserves the timestamps. Omit it if you want to create the new files using the current time.