Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-12-2007, 10:10 PM   #1
Registered: Oct 2004
Location: Texas, USA
Distribution: MDV 2008.1, PCLinuxOS,
Posts: 315

Rep: Reputation: 30
copy directory names to new user

OK, looking in cp command I don't see an option for what I'm trying to do.
Am teaching a new user how to use xsane and to file each scan into the proper folder(directory). Hope this makes sense.

There are 40-50 folders in user1 desktop and I want to copy them onto user2 desktop but I DON'T want the contents....just the named folder. This way I can set up some dummy folders they can practice filing the scanned docs into, without screwing up data in my real (user1) folders.

I could just create and name a bunch of folders identical to the ones I'm trying to copy but it would be time consuming. After they learn I'm going to let them work on the real folders (user1) and delete all the copied dummy folders on user2 desktop.

Any help appreciated

Last edited by Trio3b; 12-12-2007 at 10:14 PM.
Old 12-12-2007, 10:50 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Will something like this do what you want?
for i in $(find /home/user1/Desktop -maxdepth 1 -type d); do mkdir "/home/user2/Desktop/$(basename $i)"; done
Old 12-13-2007, 02:44 AM   #3
Registered: Oct 2004
Location: Texas, USA
Distribution: MDV 2008.1, PCLinuxOS,
Posts: 315

Original Poster
Rep: Reputation: 30
copy folders

Thanks, will give it a go and let you know.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy command cp -R does not recurse directories ankuryu DamnSmallLinux 1 05-15-2007 06:35 AM
Copy files from different directories fiomba Linux - Software 3 02-11-2005 03:01 AM
Copy one file to multiple directories cmfarley19 Linux - General 9 11-10-2004 12:57 PM
How do I copy home directories back? G-wizz Linux - Newbie 5 06-11-2004 06:20 AM
copy directories and subdirectories Red Squirrel Linux - Newbie 2 03-06-2004 09:18 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:13 PM.

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