Re: Is there a way to copy weird named files form Konqueror?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 14 August 2018 02:05:47 pm Pisini, John wrote:
> On Tue, Aug 14, 2018 at 2:49 PM, Thierry de Coulon <tcoulon@xxxxxxxxxxx>

> > However, the amazement was short-lived. All these files have names as:
> >
> > Albinoni, Tomaso - 01 - Concerto No. 1 for Violin in B flat major, Op.
> > 9%2F1:
> > 1. Allegro.ogg
> >
> > And konqueror does not manage to copy them.

> Linux use a \ as an escape character what that means is when you are trying
> to copy a character that Linux doesn't understand you precede it by the \
> like \? this is best described by others like the description by the
> following site
> https://unix.stackexchange.com/questions/299667/how-to-deal-with-characters
>-like-or-that-make-invalid-filenames
>
> The ? is a special character that has significance in bash, You can work
> with it by escaping it with \
>
> ie:
>
> touch test\?
>
> will make the file:
>
> test?
>
> and you can move it with
>
> mv test\? /new/loction/test\?
>
> Edit: The same for any special character, such as .
>
> You also need it for file names that contain spaces
>
> this is a file
>
> would have to be moved with:
>
> mv this\ is\ a\ file <location>

Hi Thierry,

Use either the command line to individually copy the files or a script to copy 
all of them.

Command line:

cd {to wherever one is stored}
cp Alb{Tab}

Hitting Tab will fill in as much as possible including escaping with \.  Play 
with it until you get the whole file name after the cp.  Then add your 
destination directory, or destination directory and new file name.

Bash script (Single quotes and double quotes)

#!/bin/bash

DestDir="/home/user/destdir"
mkdir "$DestDir"
cd {to top level directory where they are stored}

find -type f -name '*.ogg' | {
  while read filename ; do
    cp "$filename" "$DestDir"
  done
}

=====

Here’s some other stuff to play with if you want cleanup the name etc while 
copying it. (Back tics and double quotes)

  while read filename ; do
    echo "File $filename"
    NameofFile=`basename "$filename"`
    echo $NameofFile
    FnLen=${#filename}
    StartSFV=$FnLen-13
    echo "${filename:2} ${filename:$StartSFV:8}"
    echo "${NameofFile:0:2}"
  done


---------------------------------------------------------------------
To unsubscribe, e-mail: trinity-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: trinity-users-help@xxxxxxxxxxxxxxxxxxxxxxxxxx
Read list messages on the web archive: http://trinity-users.pearsoncomputing.net/
Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting





[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux