nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to copy . files from current directory

This is a discussion on How to copy . files from current directory within the Linux software forums, part of the Linux Getting Started category; Just stuck with a small trivial problem. I have a directory called dir1 and inside there are a few .hidden ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-10-2006, 07:28 PM
Member
User
 
Join Date: Jul 2005
Posts: 85
Rep Power: 0
ricc
Default How to copy . files from current directory

Just stuck with a small trivial problem. I have a directory called dir1 and inside there are a few .hidden files, normal files and directory files.

If I try to copy using " cp -rp dir1/.* /testdir/ ", then it copies the parent directory above the dir1 also... i.e, even ..

My question is....what is the syntax to copy .hidden files and .hiddendirs below the current directory to another directory?.

ricc
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-10-2006, 10:23 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,034
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I see, use -a option

Code:
cp -av dir1/ testdir/
To copy file:
Code:
cp dir1/.file testdir
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Linux Copy an audio cd / track to hard disk Peterrodg Getting started tutorials 2 01-12-2008 11:50 PM
UNIX Display or list number of files in a current directory raj Getting started tutorials 1 12-07-2007 11:55 AM
Need help writing simple copy script z3cka Shell scripting 4 08-27-2006 03:29 PM
Linux use ghost or copy a partition to another drive raj Linux software 2 07-17-2006 02:56 AM
DVD copy howto tom Getting started tutorials 1 01-11-2006 11:43 PM


All times are GMT +5.5. The time now is 03:13 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36