LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-16-2012, 12:48 PM   #16
sys64738
Member
 
Registered: May 2008
Location: NRW/Germany
Posts: 105

Rep: Reputation: 30

OK IC
thats not a problem of insufficient rights but about missing directories in the receiving directory. Sorry for missing out that problem.
If you have enough disk space, you could use cp instead of mv, which is even a more safe way.
Code:
find /home/ununun/music/ -type f -print | grep [^[:print:]] | while read file; do N=$(echo $file | tr -cd '[:print:]'); cp -rv "$file" "$N" ; done
"cp -rv" copies the files and directories (-r) and the -v makes it be verbose.

You said
Quote:
yes manish == ununun ; just avoiding extra information.
If there is a problem too much information can not be a problem. The lack of information can be a problem. Don't take offense

Is "/home/manish == /home/ununun"?
I just want to understand your configuration right.
 
Old 02-16-2012, 01:14 PM   #17
ununun
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sys64738 View Post
OK IC
thats not a problem of insufficient rights but about missing directories in the receiving directory. Sorry for missing out that problem.
If you have enough disk space, you could use cp instead of mv, which is even a more safe way.
Code:
find /home/ununun/music/ -type f -print | grep [^[:print:]] | while read file; do N=$(echo $file | tr -cd '[:print:]'); cp -rv "$file" "$N" ; done
"cp -rv" copies the files and directories (-r) and the -v makes it be verbose.
the problem is not safety. the problem bash cannot find the path. for example
Code:
# find /home/manish/music/ -print | grep '[^[:print:]]'
/home/manish/music/2/6/1/M2D.Jessie J �������� Who You Are.2011.By.AL-SHIMAA
/home/manish/music/2/6/QUANTIC  _'_'AN ANNOUNCEMENT TO ANSWER_'/QUANTIC  ''AN ANNOUNCEMENT TO ANSWER''  (UK,2006)@/���� Copyright
/home/manish/music/2/6/QUANTIC  _'_'AN ANNOUNCEMENT TO ANSWER_'/QUANTIC  ''AN ANNOUNCEMENT TO ANSWER''  (UK,2006)@/���� Copyright.txt
/home/manish/music/4/2/2/jigga jazzist/Jaga Jazzist - J�vla Jazzist Grete Stitz
/home/manish/music/3/2/bjork/Bj���rk - (1997) - Telegram
/home/manish/music/3/2/bjork/Bj���rk - (2004) - Vespertine Live
/home/manish/music/3/2/bjork/Bj���rk - (2005) - Drawing Restraint #9
/home/manish/music/3/2/bjork/Bj���rk - (1997) - Homogenic
/home/manish/music/3/2/bjork/Bj���rk - (2004) - Medulla
/home/manish/music/3/2/bjork/Bj���rk - (2004) - Homogenic Live
/home/manish/music/3/2/bjork/Bj���rk - (2009) - Voltaic
/home/manish/music/3/2/bjork/Bj���rk - (2001) - Vespertine
/home/manish/music/3/2/bjork/Bj���rk - (2000) - Selmasongs Dancer In The Dark
/home/manish/music/3/2/bjork/Bj���rk - (2007) - Volta
/home/manish/music/3/2/bjork/Bj���rk - (1990) - Gling-Glo
/home/manish/music/3/2/bjork/Bj���rk - (2004) - Post Live
/home/manish/music/3/2/bjork/Bj���rk - (1993) - Debut
/home/manish/music/3/2/bjork/Bj���rk - (1995) - Post
/home/manish/music/3/4/sigur ros/(2007) Hjl��malind [Single]
/home/manish/music/3/4/sigur ros/(2008) Inni�� Me��r Syngur Vitleysingur [Single]
/home/manish/music/3/4/cocteau twins/1993 - Four Calendar Caf�����
/home/manish/music/3/5 - mos,etc/1/musicpack/VA - DJ Top 100 Vol.3 (TME  Open Gate Records [������ CD03598]) WEB - 2011
/home/manish/music/3/5 - mos,etc/1/musicpack/VA - DJ Top 100 Vol.3 (TME  Open Gate Records [������ CD03598]) WEB - 2011/CD3
/home/manish/music/3/5 - mos,etc/1/musicpack/VA - DJ Top 100 Vol.3 (TME  Open Gate Records [������ CD03598]) WEB - 2011/CD2
/home/manish/music/3/5 - mos,etc/1/musicpack/VA - DJ Top 100 Vol.3 (TME  Open Gate Records [������ CD03598]) WEB - 2011/CD1
/home/manish/music/1/11/Karpe_Diem-Aldri_solgt_en_l��������gn-2010
/home/manish/music/1/28/8/delerium/Deler   Chimera2k3/Delerium - Chimera (Limited) [2003]/������������������������������������������������������������������������������������������ �����������������������������������������������������������������������������.txt
/home/manish/music/1/28/9/09_-_OST.Le_Fabuleux_Destin_D_Am__lie_Poulain__2001/OST.����������������������������������������������� (Le Fabuleux Destin D'Am��������lie Poulain, 2001)
/home/manish/music/1/28/9/09_-_OST.Le_Fabuleux_Destin_D_Am__lie_Poulain__2001/OST.����������������������������������������������� (Le Fabuleux Destin D'Am��������lie Poulain, 2001)/covers
/home/manish/music/1/32/3/R yksopp   Junior (2009)/R����yksopp - Junior (2009)
/home/manish/music/1/32/3/Röyksopp   The Understanding (2005)/R����yksopp - The Understanding (2005)
#  find /home/manish/music/ -type f -print | grep [^[:print:]] | while read file; do N=$(echo $file | tr -cd '[:print:]'); cp -iv  "$file" "$N" ; done
`/home/manish/music/2/6/QUANTIC  _\'_\'AN ANNOUNCEMENT TO ANSWER_\'/QUANTIC  \'\'AN ANNOUNCEMENT TO ANSWER\'\'  (UK,2006)@/\326\262\302\251 Copyright.txt' -> `/home/manish/music/2/6/QUANTIC _\'_\'AN ANNOUNCEMENT TO ANSWER_\'/QUANTIC \'\'AN ANNOUNCEMENT TO ANSWER\'\' (UK,2006)@/ Copyright.txt'
cp: cannot create regular file `/home/manish/music/2/6/QUANTIC _\'_\'AN ANNOUNCEMENT TO ANSWER_\'/QUANTIC \'\'AN ANNOUNCEMENT TO ANSWER\'\' (UK,2006)@/ Copyright.txt': No such file or directory
`/home/manish/music/1/28/8/delerium/Deler   Chimera2k3/Delerium - Chimera (Limited) [2003]/\327\263\342\202\254\326\262\302\242\327\263\342\202\254\326\262\302\265\327\263\342\202\254\326\263\302\267\327\263\357\277\275\327\237\302\277\302\275\327\263\357\277\275\327\222\342\202\254\357\277\275\327\263\342\202\254\326\262\302\276\327\263\342\202\254\326\262\302\262\327\263\357\277\275\327\222\342\202\254\302\271\327\263\342\202\254\326\262\302\271 \327\263\342\202\254\326\262\302\264\327\263\342\202\254\326\262\302\276\327\263\342\202\254\326\263\302\267\327\263\357\277\275\326\266\342\200\231\327\263\342\202\254\326\262\302\274\327\263\342\202\254\326\262\302\265\327\263\342\202\254\326\262\302\275\327\263\357\277\275\327\222\342\202\254\357\277\275.txt' -> `/home/manish/music/1/28/8/delerium/Deler Chimera2k3/Delerium - Chimera (Limited) [2003]/ .txt'
cp: cannot create regular file `/home/manish/music/1/28/8/delerium/Deler Chimera2k3/Delerium - Chimera (Limited) [2003]/ .txt': No such file or directory
the problem is cp (or mv in previous case) is converting these forign characters in escape sequece.

thanks
 
Old 02-16-2012, 04:30 PM   #18
sys64738
Member
 
Registered: May 2008
Location: NRW/Germany
Posts: 105

Rep: Reputation: 30
you have used
Quote:
....cp -iv "$file" "$N"....
try
Code:
....cp -irv  "$file" "$N"....
I think the problem is not
Quote:
converting these forign characters in escape sequece
but creating the destination directories.
To check that see if you got any directories of the source "/home/manish/music/..." in "/home/ununun/music/..."
or whatever your destination is.
What is your current directory when starting the command?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recommendations for English songs, with touching/jolly lyrics TheIndependentAquarius General 52 09-13-2011 10:22 AM
rename a directory filename with " \ " character d4v3 Linux - Newbie 8 06-07-2011 06:45 PM
LXer: Bash massive rename to solve feh problem LXer Syndicated Linux News 0 02-13-2010 01:12 AM
Convert static library (Filename.a) to dynamic shared object (filename.so) afx2029 Linux - Software 4 08-17-2007 06:07 AM
linux shell - extract filename from and song info from text database d003 Programming 1 07-23-2003 04:06 AM


All times are GMT -5. The time now is 12:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration