Under ksh, bash or zsh:
svn mv !(2010) 2010
Under bash, you need to run shopt -s extglob first (put it in your ~/.bashrc). Under zsh, you need to run setopt -o ksh_glob first (put it in your ~/.zshrc).
This doesn't move dot files (files whose name begins with .). If you have some, move them separately. Take care to exclude the .svn directory if you have one. In ksh or zsh:
svn mv !(2010) .!(svn) 2010
In bash, this is more complicated because you also need to explicitly exclude . and ...
svn mv !(2010) .!(svn|.|) 2010
Zsh also has a different, shorter syntax, which requires running setopt -o extended_glob first (again, put this in ~/.zshrc):
svn mv {^,}2010
First brace expansion comes into play, resulting in svn mv ^2010 2010. Then the pattern ^2010 (a shortcut for “files matching * but not 2010”) is expanded.
If you have a .svn directory, you'll need to exclude it from the move. This is ok by default, as .svn is not matched by * (it's a dot file). However, there are complications:
If you've set the glob_dots option, you'll need to exclude .svn as well:
svn mv !(2010|.svn) 2010 # requires setopt ksh_glob
svn mv *~(.svn|2010) 2010 # requires setopt extended_glob
If you have dot files and you haven't set glob_dots, you'll need to move them separately:
svn mv {^,}2010
svn mv .*~.svn 2010
To do it in one go:
svn mv *~(.svn|2010)(D) 2010
Another way that would work in zsh in this case (if you have no subdirectories) is svn mv *(.D) 2010, to match only regular files (.) including dot files (D).
mvas well. However, withmv,mv * newdirworks for me, albeit with an error. – crazy2be May 28 '11 at 1:38