Trouble Renaming directories/files

3 respostas [Última entrada]
sradms0
Desconectado
Joined: 08/24/2015

When I try to rename in the GUI (nautilus) the name of the dir or file is highlighted as though i should be able to edit the name but nothing happens when I type...

When trying to rename from the command line, I get the following message:
(this is an example of a directory labeled 'dir1')

"Bareword "dir1" not allowed while "strict subs" in use at (eval 1) line 1."

Thanks for any help.

antiesnob
Desconectado
Joined: 08/22/2013

I don0t know exactly the error message bu could you post the exact command you'r trying to use?

moxalt
Desconectado
Joined: 06/19/2015

To edit the name of the file in Nautilus, select the file, right-click on the
file, and select 'rename'. You should now be able to type the new
file/directory name.

To rename files through the terminal under UNIX, there is no dedicated 'rename'
command as in, say, DOS. Instead you should use the 'mv' (move) command, which
is normally used to move files around. However, if you use mv with the
following syntax:

mv

the file will be 'moved' to the same location, but with a new name. This is
UNIX' equivalent of a rename command. You were trying to use the 'rename'
command- that's actually a Python script designed to batch-process file names
(and other things). This is quite misleading. The command to use is not rename,
but mv.

Good luck.

Magic Banana

I am a member!

I am a translator!

Desconectado
Joined: 07/24/2010

To edit the name of the file in Nautilus, select the file, right-click on the file, and select 'rename'.

Or F2.