How Do I rename a unix file contianing spacing?

How can I rename a unix file that has a spacing in in the charactyers? For example, I want to rename or move a file called "My OldFile.txt" to "MyNewFile.txt" or "My_New_file.txt"

Please help

mv "My OldFile.txt" MyNewFile.txt

If I understand your question correctly it would be:
mv My\ File\ .txt My_File.txt

jiin

Now tell me how to create a file with spacing..

If i give

touch my old.txt or
vi my old.txt

then, the shell interprets it as two seperate files.. one as my and the other as old.txt....

How can one succeed in creating a file with spaces????

Thanks,
Nisha

Exactly the same

vi "my file"

Working fine Peter....

Thanks,
Nisha

Nisha,

U can also do

vi my\ old.txt

:slight_smile:

try "... \ ... " (backslash and space) if u write the filename... Surround the names with `...` or "..."

or just use zsh with autoexpand and autolist features if you have trouble with spec. chars in names of files etc.