How to change a file name containing <> characters

command linefilenamesquoting

I ran a script that creates an oracle tablespace but I forgot to change the path in the script. The alter tablespace script contained data2. Normally if you want to rename a datafile, you put the tablespace offline and rename that file. I get the error:

mv <oracle path>data2.dbf data2.dbf
-bash: syntax error near unexpected token `newline'

So, how do I rename a file with characters containing <>?

Best Answer

You need to escape the space, less than and greater than characters using a backslash:

mv \<oracle\ path\>data2.dbf data2.dbf

Should work.