Software :: Copy A Directory Without Contents

Apr 28, 2009

Is there a way to copy a directory without copying the contents, but preserving ownership, timestamp etc of that directory?

I've looked at the cp man page, but I don't think it supports it. I'm thinking one would have to write a script to gather the info, and then mkdir, chown and touch. Does this seam right?

View 2 Replies


ADVERTISEMENT

General :: Copy Contents Of One Directory Into Another

Jul 7, 2011

I would like to copy the contents of a directory into another. I don't want to copy the directory and all files and directories under it, but just the contents of the directory just as if it were a regular file. Doing cp -r target dest copies the directory and the entire hierarchy rooted in it. I get error if I do not include the -r option. (I am calling cp from within a C program.)

View 3 Replies View Related

General :: Copy A Directory Without It's Contents?

Nov 5, 2009

Is there a way to copy a directory (retaining the permissions and owners) without copying the contents of the directory?

If there is no such thing... then I need a way to determine if a target path is a file or a directory, and if it is a directory I need to make a new directory elsewhere that has the same name, owner and permissions.

Basically, I'm trying write a script to copy 200 GB of files over a network to a new server, and I'd like to do it by generating a list with the find command. That way, I can migrate large chunks of the files over the course of a week, and on the day of the migration generate a new list of files that changed in the last week and then copy just the chagned files over minimizing the down time. However, the list will contain directories that I can't just use the 'cp' command on because it will copy all the contents of the directory.

View 5 Replies View Related

Software :: Copy The Contents Of One Directory To Another?

Mar 10, 2010

I am trying to copy the contents of one directory to another

rsync -av /old /new

when I do this /old is being copied into new

/new/old/files from old

but what I want is the files from old to be moved to new

/new/files from old

how can I do this?

View 2 Replies View Related

General :: Copy Contents Of Home Directory To Other Users?

May 3, 2011

I've created other users in my machine. now I want to add all my home directory contents and settings to the home directory of other users. how can i do that? Can I do it from /etc/skel directory?

View 1 Replies View Related

Server :: Possible To Copy Directory Contents For Data Transfer

May 2, 2010

I have a server that I wanted to transfer it to a newer one both of them have CentOS but the newer one kernel is more up to date I wanted to know is it possible just to copy some directory contents exactly to another for transferring the server data (for example /var /usr /bin /home /etc). I have one website on my server with its mysql database

View 4 Replies View Related

Applications :: Scp Copy A Directory And Its Contents From A Remote Machine To Local Host

Oct 8, 2010

For the life of me I can not figure out what I am doing wrong with scp to copy a directory and its contents from a remote machine to my local host. I have no issues with getting a single file but would like to just save time and get the whole folder in one command.

Here is what I have tried:

scp user AT remoteMachine:/home/username/folderIwant user AT localMachine:/folderIwant this gives me a permission denied error and try again and received disconnect from localHost to many authentication failures

scp user AT remoteMachine:home/username/folderIwant . says can not find file or folder

I am sure this is something easy that I cant remember, and searches gives me local to remote not remote to local and trying to make the local to remote suggestions I read to work remote to local have not worked.

View 2 Replies View Related

General :: BASH Script To Copy Contents Of Directory So Long As Average System Load Low?

May 26, 2010

For reasons I won't get into, I need to copy directories so long as the average system load is low. Can someone help me write a BASH script that will copy the contents of a directory, but check to make sure the average system load is below X before copying each file, and if not, wait Y seconds and try again?

View 3 Replies View Related

General :: Copy Folder Hierarchy / Recreate All Folders From One Directory Without Copying Over Contents Of Folder?

Jul 2, 2010

Is there a way to recreate all the folders from one directory to another without copying over the contents of the folder? I've been trying to do something like this,

Code:for i in `ls $X`; do mkdir $PATH/$i; doneUnfortunately $i is deliminated by whitespaces in the filenames and not the actual folders.

$X contains only other folders so I dont have to worry about regular files but any kind of more "advanced" solution would work.

View 1 Replies View Related

Software :: List Files/directory Names Without Directory Contents?

May 3, 2011

When I run "ls -al somedir*" (I use the "ll" shortcut, actually), Linux not only list files that match, but also the contents of directories whose name also happens to match.Is there a way to limit "ls" so that it will only show names (files and directories) and ignore the contents of the directories?

View 2 Replies View Related

General :: Copy 3 Dir's Contents To 1 Dir By Crontab?

Jun 7, 2010

how to copy 3 dir's content to 1 dir by crontab?suppose i want to copy /home/ftp1/* /home/ftp2/* /home/ftp3/* to /ftpdatathree ftp user data to one folder after every one minute by crontab methodso it goes like*/1 * * * * /bin/cp -rf ??? /ftpdata

View 14 Replies View Related

CentOS 5 :: Using Mouse & Vim To Copy Contents Of One File Onto Another

Aug 4, 2010

I am using CentOS 5.5 and openSUSE 11.0. I use vim editor but do not know more than 1 - 2% of its functionality. In openSUSE if i open 2 text files in 2 separate terminals, i can copy the contents of one file onto another by just left-clicking and dragging the mouse over the required text. But i am unable to do this in CentOS.

View 6 Replies View Related

Fedora :: Input/output Error When Trying To Copy DVD Contents With DD

Mar 3, 2010

I even threw some video DVDs at it to make sure it wasn't the disc.

Code:

[pickens@acer1 Videos]$ dd if=/dev/sr0 of=POTC.iso
dd: reading `/dev/sr0': Input/output error
5088+0 records in

[code]....

I am getting the same thing on my laptop running Mandriva, oddly enough. Two different drives, two different computers, two different distros and multiple DVDs.

View 9 Replies View Related

General :: Copy Entire Folder Contents To Another Using PUTTY?

May 2, 2011

How to Copy the entire folder contents (including sub-folders and their contents) to another folder using PUTTY? Is there any command for that?

View 3 Replies View Related

Ubuntu :: Partition The New Drive & Just Copy The Contents Using Rsync?

Jan 26, 2011

I just installed a new HD on my system with multiple HD's already. I have a drive with two versions of Ubuntu & would like to copy the complete drive to the new drive along with all the contents & partitions of the Ubuntu drive.

1 - Could I partition the new drive & just copy the contents using rsync?

2 -If I copy all the contents over could I just reinstall Grub & edit fstab & be good to go?

View 3 Replies View Related

Ubuntu Installation :: Does Grub Make Copy Of Contents Of MBR?

Feb 26, 2011

My system is an Acer Aspire One Happy netbook. It runs Windows 7 OEM. I installed Ubuntu Netbook Remix, which works fine. Unfortunately, I put GRUB in the MBR (I wanted it on Ubuntu partition in order to use Win 7 bootloader). Acer netbooks seem to have a particular MBR (in order to run e-Recovery Management), which is different to the standard Windows 7 MBR.

Moreover, in the internet there are instruction to restore Acer MBR, but they do not seem useful, since I do not find the MBRWRWIN.EXE and RTMBR.BIN files on the hidden partition. Is there a way to tell GRUB to remove itself and restore the previous content of the MBR (something like the old "lilo -u")? Does GRUB make a copy of the content of the MBR before installing itself? Where is it, if it is so?

View 2 Replies View Related

Ubuntu :: Create Shell Script To Copy Contents Of A Shared Folder On A XP PC?

Apr 8, 2011

I was wondering if there would be a way for me to copy the contents of a shared folder that's running on an XP system using shell script. Actually, there are two shared folders that I want to do this with. I want to be able to launch the script and automatically copy all the contents of each folder into two separate folders on my ubuntu desktop. For example;

Lets say that I have Shared Folders A1 and A2 on my networked XP system and I have Folders B1 and B2 on my Ubuntu desktop. I want the script to automatically copy the contents of A1 into B1 and likewise for A2 and B2. During the copying, I want the script set up such that any pre-existing files in the B1 & B2 folders will automatically get overwritten by the ones copied from A1 & A2.Is there any possibilities of me achieving this?

View 7 Replies View Related

General :: Copy The Contents Of A Txt File To Other Txt Files (with Similar Names) By Cp Command?

Jul 2, 2010

Code:
cp -r aa123.h aa*.h
results in
Code:
cp: target `aa456.h' is not a directory

Yes I read man page cp (1p). There is something written there about it, I couldn't understand though.

View 7 Replies View Related

Software :: Good Hex Editor - Allow To View Contents Directly And Copy And Paste Stuff

Dec 17, 2010

I'm trying to view directly a partition with a damaged filesystem on it (NTFS) and so far the hex editors I tried do not do that. I tried GHex for example and it complained that /dev/sda is not a file. The partition is unmountable as NTFS however since it is damaged so I couldn't mount it first. Are there any hex editors out there that would allow me to view the contents directly and copy and paste stuff in there?

View 14 Replies View Related

Programming :: Get The Contents Of A Directory In C++?

Dec 27, 2010

How to get the contents of a directory in C++?I know about opendir(), but I wonder if there is a C++ way (that uses classes and exceptions).

View 1 Replies View Related

Ubuntu :: When Drag The File To Install It Again It Says Something Along The Lines Of It Cannot Copy A Directory Over A Directory?

Feb 19, 2010

I downloaded a mouse theme form gnome look and installed it in the themes. But it has not appeared in the pointer themes section in custimation even though it said that it is installed correctly.When I drag the file to install it again it says something along the lines of it cannot copy a directory over a directory.Where can I find where the mouse/pointer theme is located and delete it. I have searched filesystem, google and these forums and not had any luck yet.

View 1 Replies View Related

Fedora :: Copy A Few Files From Windows Directory Into The Wine Directory

Aug 1, 2009

i want to copy a few files from my windows directory into the wine directory - its no big deal, just a few preference files so i dont have to set something up all over again. trouble is, i had the files copied, but i cant find the wine/ c: drive directory anywhere, anyone know where this can be found??

View 8 Replies View Related

Programming :: Copy Files After Search In Array From This Directory To Another Directory?

Jan 3, 2009

After i try to find logfiles follow date/month/year. i want copy this files to another directory with name's directory is time you find(date/month/year).

View 4 Replies View Related

General :: List The Contents Of Directory?

Mar 12, 2010

1 List the contents of directory, /dev using a detail listing format and page by page.

2Mount the CDROM to the directory, /media/cdrom.

3 Delete the file "/home/student/myfile" without any confirmation (Assume you have the required file permission to delete this file).

View 1 Replies View Related

General :: Using Cp Properly - Copy A Directory Somewhere Else Into This Current Directory ?

May 13, 2011

I am in my current directory. I want to copy a directory somewhere else into this current directory. Lets say I want to take it from direc1/direc2 and the directory I want to take is called demo.

Code:

That is what it shows in the man pages, but when I do that, it says cp: no match

View 5 Replies View Related

General :: Listing TAR Contents Inside Directory

Jun 16, 2011

This is the script I'm running
tar tf some.tar somefolder_insidetar
And output it's a list with all folders, files, and SUBDIRECTORY Files, the only thing I need it's just show the contents (folder and files) of the current directory choosed, not listing subdirectory files, or subdirectories inside subdirectories.

View 3 Replies View Related

Debian :: Contents Of Directory Gone After Accidentally Copying Symlin / Fix It?

Jan 17, 2011

While doing some tidying up, in the process of moving some directories off my temporary mint kde desktop, I lost the contents of an important data directory on my data partition. Just to try to explain a bit of background, I have been using mint kde4 as a stopgap measure until I got squeeze working again ( i have been having graphics problems) and had a symlink on the desktop to a /data directory on my data partition. As I just got squeeze working again, I was moving stuff that had accumulated on the mint desktop to a directory named /2010 in the /data directory on the data partition, but accidently copied/pasted the /data symlink along with the 3 other directories I had highlighted. So effectively, I was accidentally copying the /data symlink to /data/2010. For reasons I don't understand, the whole of the contents of the /data directory disappeared, and it is now totally empty. I thought, that cannot happen can it? So I opened gparted and sure enough, that partition, which previously had about 70 gb of data in the /data directory was empty apart from /lost+found and an odd text file I had stored there. The /data directory is still there, but empty. I shut down Mint and booted into squeeze, thinking it must be a mistake, but gparted shows it has all gone. How on earth can this happen? I have some of the data backed up but a fair bit of the recent stuff isn't, so I need to recover it. I hoped the file system check that happened when I booted back into squeeze would maybe repair anything that got broke, but it showed as clean during boot.

View 5 Replies View Related

General :: How To Prevent Other Users From Seeing Contents Of Home Directory

Jul 8, 2010

I have a box with multiple users on it and I want everyone to be able to have full access to their home folders, but not be able to see the contents of /home/ or another user's home folder (I.E. bob has full access to /home/bob but cannot access or even see the contents of /home/john)Right now users can see other user's home folders but can't modify what's inside. How do I prevent them from seeing the contents at all?

View 1 Replies View Related

Ubuntu :: How To Have Desktop Display Contents Of HOME Directory

May 24, 2010

I am just coming to GNOME from KDE where I used the folder view desktop widget to display the contents of ~ directory (/home/<user>) rather than the "Desktop" directory itself, as that's where all the stuff I wanted to access from the desktop was. Is there any way I can do this in GNOME with the actual desktop (as opposed to a widget)?

View 4 Replies View Related

Programming :: How To List Contents Of Directory And Exclude Any Subdirectories

Aug 2, 2010

I'm having trouble figuring out how to list the contents of a directory and exclude any subdirectories.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved