I tried something like mv . .. but it doesn't work.
|
The command you are looking for is
or (see below for more info):
Explanation: the See the manpage which I linked for more information on Why
|
|
Using .* might cause mv to produce warnings/errors about not being able to move . and ... You might try mv * .[^.]* .. instead. – Chris Johnsen Oct 28 '09 at 19:21 |
||
|
|||
Very complete answer thanks. – asksuperuser Oct 28 '09 at 19:34 |
|||
|
@alain: you're welcome, and welcome to the site! (If (and only if) one of the posts here sufficiently answered your question, then you can mark it as such. That will get the poster 15 extra reputation points, and also give you 2 rep extra.) – Stephan202 Oct 28 '09 at 19:41 |
||
|
There is no harm in the * .* syntax -- including .. is only hazardous when used with chmod and chown and the "recurse" flag, ie chmod -R or chown -R. And in those cases, don't ever ever type chown .* or chmod .* -- chown the top directory in the path you're looking for and use -h (don't follow symbolic links). But, mv .. simply doesn't do anything so don't worry about it. – chris Nov 6 '09 at 4:16 |
|
Short answer: use
Long answer: The command
will not work since
will also not work, since
which will match everything except Better yet, you can use
which avoids the ugly glob hacks in |
|||||||||||||
|
|
Just for the sake of completeness, one can also tell the Bash shell to include hidden files, using
|
||||
|
|
Ultimately trying |
|||
|
The |
|||||||
|
|
The mv lacks the functionality of moving hidden files when using
No need to get into complex solutions of dotglobbing and using find commands. |
||||
|
|
|
You can use the following:
|
|||||
|
|
This minimized command works on most modern shells:
Otherwise mentioned is a portable solution:
Features:
Naive Implementations:
|
|||
|
|
With the above command, we are telling The switch The switch |
||||


[linux] [mv] [cwd] [files], or something similar? – Stephan202 Oct 28 '09 at 19:33