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 <>?

2 Answers 2


You can use quotes on your source file

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

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

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

Should work.

  • 1
    You can probably also let the bash shell do a lot of the escaping and competion for you. Press \< and then TAB key and you'll probably have the entire file name escaped and all ready to go. Aug 31, 2016 at 23:19
  • @rman if this solved it for you, you should consider accepting the answer (clicking the check mark next to it) so everyone will know both what worked for you and that this question has been answered (and you and the answerer will both get some extra reputation too). Sep 2, 2016 at 11:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .