LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2016, 08:17 AM   #1
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 177

Rep: Reputation: Disabled
cp doesn't want ":" in file names?


I notice that cp does not want the characters like ":" in file name.

See in this list, cp says "No such file or directory" for some files which are actually exist there.
Code:
firefox-48.0.2-1-x86_64.pkg.tar.xz
[msh@mshC720 ~]$ sudo cp -vn /home/msh/tmp/mshpkg/*.pkg.tar.xz /var/cache/pacman/pkg/
'/home/msh/tmp/mshpkg/awesome-3.5.9-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/awesome-3.5.9-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/dbus-1.10.10-3-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/dbus-1.10.10-3-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/dialog-1:1.3_20160424-1-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/diffutils-3.5-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/diffutils-3.5-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/dosfstools-4.0-3-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/dosfstools-4.0-3-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/ffmpeg-1:3.1.2-1-x86_64.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/ffmpeg-1:3.1.3-1-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/firefox-48.0.2-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/firefox-48.0.2-1-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/foomatic-db-3:20160826-1-any.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/foomatic-db-engine-4:4.0.12-2-x86_64.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/foomatic-db-nonfree-3:20160826-1-any.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/ghostscript-9.19-3-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/ghostscript-9.19-3-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/glib2-2.48.2-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/glib2-2.48.2-1-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/gnome-desktop-1:3.20.2-1-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/gnome-screenshot-3.20.1-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/gnome-screenshot-3.20.1-1-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/graphite-1:1.3.8-1-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/libcanberra-0.30-7-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/libcanberra-0.30-7-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/libcddb-1.3.2-4-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/libcddb-1.3.2-4-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/libcdio-0.93-4-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/libcdio-0.93-4-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/libdvbpsi-1:1.3.0-1-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/libevdev-1.5.4-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/libevdev-1.5.4-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/libmariadbclient-10.1.16-2-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/libmariadbclient-10.1.16-2-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/libmpcdec-1:0.1+r475-1-x86_64.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/librsvg-2:2.40.16-1-x86_64.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/libshout-1:2.4.1-2-x86_64.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/libx264-2:148.20160613-2-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/libxdg-basedir-1.2.0-3-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/libxdg-basedir-1.2.0-3-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/linux-4.7.2-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/linux-4.7.2-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/lua-lgi-0.9.1-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/lua-lgi-0.9.1-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/man-db-2.7.5-4-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/man-db-2.7.5-4-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/mariadb-10.1.16-2-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/mariadb-10.1.16-2-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/mariadb-clients-10.1.16-2-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/mariadb-clients-10.1.16-2-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/menumaker-0.99.9-1-any.pkg.tar.xz' -> '/var/cache/pacman/pkg/menumaker-0.99.9-1-any.pkg.tar.xz'
'/home/msh/tmp/mshpkg/notification-daemon-3.20.0-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/notification-daemon-3.20.0-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/python2-xdg-0.25-3-any.pkg.tar.xz' -> '/var/cache/pacman/pkg/python2-xdg-0.25-3-any.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/rasqal-1:0.9.33-1-x86_64.pkg.tar.xz': No such file or directory
cp: cannot stat '/home/msh/tmp/mshpkg/redland-1:1.0.17-3-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/sound-theme-freedesktop-0.8-2-any.pkg.tar.xz' -> '/var/cache/pacman/pkg/sound-theme-freedesktop-0.8-2-any.pkg.tar.xz'
'/home/msh/tmp/mshpkg/tdb-1.3.10-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/tdb-1.3.10-1-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/vi-1:070224-2-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/wmctrl-1.07-4-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/wmctrl-1.07-4-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/wpa_supplicant-1:2.5-3-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/xcb-util-cursor-0.1.3-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/xcb-util-cursor-0.1.3-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/xcb-util-image-0.4.0-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/xcb-util-image-0.4.0-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/xcb-util-renderutil-0.3.9-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/xcb-util-renderutil-0.3.9-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/xcb-util-wm-0.4.1-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/xcb-util-wm-0.4.1-1-x86_64.pkg.tar.xz'
'/home/msh/tmp/mshpkg/xcompmgr-1.1.7-1-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/xcompmgr-1.1.7-1-x86_64.pkg.tar.xz'
cp: cannot stat '/home/msh/tmp/mshpkg/xf86-video-intel-1:2.99.917+697+g12c14de-1-x86_64.pkg.tar.xz': No such file or directory
'/home/msh/tmp/mshpkg/xorg-xmessage-1.0.4-2-x86_64.pkg.tar.xz' -> '/var/cache/pacman/pkg/xorg-xmessage-1.0.4-2-x86_64.pkg.tar.xz'
How can I workround that?
 
Old 08-29-2016, 08:22 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
my cp works with : without any problems, you may need to check if those files are really there and really readable.
 
Old 08-29-2016, 08:46 AM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
In the hope that it may shed some light on the problem, can you please paste the output from:

ls -la /home/msh/tmp/mshpkg/*.pkg.tar.xz
 
Old 08-29-2016, 11:54 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
cannot reproduce:
Code:
~ $ touch a:b:c
~ $ cp a:b:c a:b:c:d
~ $ ls *:*
a:b:c  a:b:c:d
~ $ touch dialog-1:1.3_20160424-1-x86_64.pkg.tar.xz
~ $ cp dialog-1:1.3_20160424-1-x86_64.pkg.tar.xz dialog-1:1.3_20160424-1-x86_64.pkg.tar.xyz
~ $ ls *:*
a:b:c    dialog-1:1.3_20160424-1-x86_64.pkg.tar.xyz
a:b:c:d  dialog-1:1.3_20160424-1-x86_64.pkg.tar.xz
~ $ pacwhich cp
/usr/bin/cp is owned by coreutils 8.25-2
 
Old 08-29-2016, 09:54 PM   #5
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 177

Original Poster
Rep: Reputation: Disabled
Actually I am trying to copy package files over local network using samba.
~/tmp is mountpoint of another machine's samba share folder.

I think it is the reason.

when I try it on the same machine like this:
Code:
$ cp /var/cache/pacman/pkg/*.pkg.tar.xz ~/pkg/
it works perfect.
 
Old 08-30-2016, 08:35 AM   #6
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
That makes sense, since samba is an implementation of a Windows protocol, and Windows file systems don't like ':' in file/folder names.
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax to concatenate multiple file names in a "tar -xvf " command? dtindallsr Linux - Newbie 5 05-12-2016 09:21 PM
[SOLVED] Bash script: Search folder names in file and cp text after "," into new file _furrycat_ Programming 5 08-03-2013 01:42 AM
[SOLVED] "ifconfig eth0 up" doesn't work, cause of "no such file or directory" Sebi94 Linux - Networking 6 08-21-2012 10:39 PM
[SOLVED] Bash, find : How to avoid [...] pattern matching in file names expanded from "$var"? Telengard Programming 19 04-23-2011 02:36 AM
File and folder names containing "Ğ ğ – Ü ü – İ – ı – Ö ö – Ş ş" ? sertmusluman Slackware 38 12-22-2008 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:08 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration