Results 1 to 7 of 7
pretty new to linux, just wondering if there's a command to overwrite a directory....
- 01-18-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 3
can i overwrite a directory
pretty new to linux, just wondering if there's a command to overwrite a directory.
- 01-18-2010 #2
Hi and Welcome !
I am not getting it. What do you want to do exactly? Do want to change directory name, location or files in it?
I would suggest you check linuxcommand.org for basic commands.It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 01-18-2010 #3Just Joined!
- Join Date
- Jan 2010
- Posts
- 3
im trying to copy an updated directory over and have it replace the current one...
and thanks for the link, im sure this site is going to come in handy!
- 01-18-2010 #4
There are some switches to `cp` that would be useful.
you can see all of the switches with
`man cp`
but there is a switch to recursively copy files in a directory
`cp -r from_directory to_location`
and to copy only files that have been updated.
`cp -ru from_directory to_location`
again, see the man page for a better lookNew to the internet, technical forums, or the hacker / open source community??
Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html
RHCE for RHEL version 5
RHCT for RHEL version 4
- 01-18-2010 #5Just Joined!
- Join Date
- Jan 2010
- Posts
- 3
im not sure why, but the cp command isnt working. i get no error, but it just doesn't overwrite the old directory.
little background...
im in Android, if that matters, and have busybox on here as well.
im attempting to copy a new, updated app folder onto the device. all i did was optipng the files from my app folder and im trying to replace the old ones with the updated optipng'd ones
- 01-18-2010 #6
So we have a directory and want to replace it with a new one?
I don't necessarily know of a single command to do this (particularly if cp -u isn't working), but it's fairly simple in two commands:
The first command deletes a directory, and the second one copies the new directory to the old one.Code:rm -R olddir/ cp -R newdir/ olddir/
DISTRO=Arch
Registered Linux User #388732
- 01-18-2010 #7
I would replace the first command with an mv - just in case
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.


Reply With Quote