moving /home [Solved - Corrected HowTo]

James Wilkinson fedora at westexe.demon.co.uk
Thu Dec 8 08:02:27 UTC 2005


Jeff Vian wrote:
> # cp -a /home/* /home/.[!.]* <dest/directory>
> In this command it explicitly asks for anything beginning with a '.',
> but since both '.' and '..' match they need to be excluded, thus the
> [!.] (not dot) part. For clarity read up on regexps.

Um. This isn't technically a regexp but a shell glob expression. They
work differently ("." means any character in a regexp, and "*" means any
number of the previous character).

Getting a glob expression to mean *everything* by . and .. is a Known
Tricky Problem. One that bash has sorted with shopt -s dotglob .

See
https://www.redhat.com/archives/fedora-list/2004-July/msg05222.html

Hope this helps,

James.

-- 
E-mail address: james | "Does exactly what it says on the tin." ...
@westexe.demon.co.uk  | I've got a tin at home: it says "Open other end".
                      | It never is.
                      | -- Humphrey Lyttelton, "I'm Sorry, I Haven't A Clue"




More information about the users mailing list