I would like to change a file name with extension of csv into
You can use globbing to target a file without knowing its whole name.
Considering you know the file's directory, its extension, and that it is the only one with this extension in this directory, you can simply use this
mv /Users/xx/xx/*.csv /Users/xx/xx/test.txt
This will rename every
.csv file in
/Users/xx/xx/ (in your case, your single CSV file) into
That would obviously be a problem if there was multiple
.csv files since each would overwrite the previous one. If it could become a problem, you should either check the number of files which are matched by this glob and exit with error if it's greater than 1 or use a command that will only ever act on a single file such as the one suggested by RomanPerekhrest.