how do i copy files in unix. i want to keep the originals and add a prefix to the originals.
i have the following:
file1.csv
file2.csv
file3.csv
file4.csv
...
fileX.csv
what I will end up with after giving the command(with "H_" being the prefix in this example):
file1.csv
file2.csv
file3.csv
file4.csv
...
fileX.csv
H_file1.csv
H_file2.csv
H_file3.csv
H_file4.csv
...
H_fileX.csv
I was looking at the cp or mv command, but have no luck yet
for file in *.csv; do
cp "$file" "H_$file"
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With