SSH How to move all files up one directory – including hidden files
This is one command that comes up every now and then and I always forget it! So to save some time Googling the answer I thought I’d post it here as a quick reminder.
The command will move all files in the current directory – including hidden files – up one directory.
mv * .[^.]* ..
Here’s what’s going on. The
mv command moves files and directories. The last argument to
mv is the target (in this case the directory one step “up” in the tree,
..). The arguments before that are the source files and directories. The asterisk (
*) is a wildcard which matches all files which do not start with a dot. Files that start with a dot (dotfiles) are “hidden”. They are matched using the pattern