login
Header Space

 
 

[GNU+Linux] Moving The Whole Content Of A Directory Including The Hidden Files

September 20, 2008 - 11:01am
Submitted by Eus on September 20, 2008 - 11:01am.
Applications and Utilities

Hi Ho!

$ pwd
/home/eus/shared/

$ ls
./
../
inside/

$ ls inside
./
../
.a/
.b/
x/
y/

If I want to move the whole content of /home/eus/shared/inside/ into /home/eus/shared/ including the hidden files, what command should I issue?

I cannot do the following ones:
$ mv -i -- inside/. ./ (ERROR: cannot overwrite ./.)
$ mv -i -- inside/* ./ (ERROR: the hidden files are left out)

Well, I can do:
$ cd inside
$ find -maxdepth 1 -mindepth 1 -exec mv -i -- '{}' ../ ';'

But, is there a better way?

Thank you.

Best regards,
Eus

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <b> <quote> <pre> <hr> <br> <p> <img> <blockquote> <font> <tt> <table> <tr> <i>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

speck-geostationary