You are not logged in.

#1 2009-09-01 07:26:55

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Copying files with difficult names

Hi,

I've got a bunch of files with names containing 'not recommended' characters like [?']. Curiously, colon also presents a problem, though it isn't mentioned among difficult characters. I just want to copy them; Dolphin and Krusader won't oblige. Is there an easy answer to the problem?

Offline

#2 2009-09-01 08:55:24

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Copying files with difficult names

mc will copy them just fine...


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#3 2009-09-01 08:58:33

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Copying files with difficult names

You can copy them in the console. Just escape the : and ? like:

cp weird\:filename\? better_filename

Offline

#4 2009-09-01 11:07:47

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: Copying files with difficult names

You can also use the rename command to remove or change the bad characters to something else. For instance:
rename \? '' * will remove all ? characters.
rename \: - * will replace all colons with hyphens.

Offline

#5 2009-09-01 11:15:29

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Copying files with difficult names

mikesd wrote:

You can copy them in the console. Just escape the : and ? like:

cp weird\:filename\? better_filename

Sometimes its also easier to just wrap it up in " and tab complete it


neutral

Offline

#6 2009-09-01 11:22:36

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: Copying files with difficult names

Then Dolphin and Krusader both suck.

pcmanfm will do it for you. Any character is fine.

In addition to what mikesd said, if your file name starts with "-" you can put "--" before them to avoid error, like this

$ cp  --  '--weirdfonkyname'  somewhereelse


This silver ladybug at line 28...

Offline

Board footer

Powered by FluxBB