[SOLVED] recursively cp all directories, files and hidden files
Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Wow, I can see how that could have caught lots of people off guard, thinking they'd copied all files but hadn't, and not noticing for quite some time. Good thing you noticed. In fact, thanks for reminding me to watch out for that.
If you specify a directory that you want to copy, then it includes everything below the directory that you're copying. For example:
cp -a from-directory/ to-directory/
would copy the entire from-directory/ and everything below it. If you just want the stuff below from-directory/ and not from-directory/ itself, then you could cd to from-directory/ and use the . to refer to the directory you're in:
shopt is a shell builtin, you can get documentation in bash's man page, in the "SHELL BUILTIN COMMANDS" section.
Options controlled by shopt are local to the shell where it is set (and inherited to subshells, if not told not to do so).
If you want to unset the option after using it, use
antegallya summed it all up nicely. It's a bash builtin, so it's the bash man page which you should be looking at. -s sets an option, -u unsets it, shopt alone will list the current state of things. If you want you can use the bash initialization files (also described in the man page) to set or unset some of these options automatically each time you open a new shell.
A given option is only valid on the shell you set it on and it is so until you either close that given shell or you unset the option explicitly using shopt -u.