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 06-14-2011, 02:40 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
cp --parents /d1/.d2/d3/foo.txt /e1/ breaks the path at 1st '.', even with -a.


kernel 2.6.21.5
cp (GNU coreutils) 6.9.

Hi:

Code:
bash-3.1$ mkdir e1
bash-3.1$ cp --parents d1/.d2/foo.txt e1
bash-3.1$ ls -R e1
e1:
d1

e1/d1:
bash-3.1$
What I would like the result to be is
Code:
bash-3.1$ ls -R e1
e1:
d1

e1/d1:
.d2

e1/d1/.d2:
foo.txt
bash-3.1$
Any other cp options to remedy the situation? Thanks.
 
Old 06-14-2011, 04:38 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You need the -a option of ls to see hidden files and directories:
Code:
bash-3.1$ ls -aR e1
e1:
. .. d1

e1/d1:
. .. .d2

e1/d1/.d2:
. .. foo.txt
The file has been copied together with its parent directories, but you cannot see it without ls -a.
 
Old 06-14-2011, 04:54 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
You must excuse my clumsyness. I think it's bedtime for me already. Thanks a lot.
 
  


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
tgz, txt, asc, 1st, etc ??? Ace Blackwell Linux - Newbie 3 05-24-2011 10:18 PM
Killing foo, which I started as foo &. stf92 Linux - Newbie 9 11-08-2010 10:54 PM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
Which config file should I use... foo or foo.new? davidguygc Slackware 6 08-01-2007 05:21 PM
using commands to output path, filename and info to a txt file bob_man_uk Linux - General 3 05-11-2006 02:31 PM

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

All times are GMT -5. The time now is 11:57 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