moving /home [Solved - Corrected HowTo]

James Wilkinson fedora at
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 .


Hope this helps,


E-mail address: james | "Does exactly what it says on the tin." ...  | 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 fedora-list mailing list