Command: move all files inside a directory to another directory (including hidden files)?
I tried to move all files inside a directory to another directory like this:
$ mv /directory_one/* /directory
However, the hidden files (such as .htaccess) in /directory_one won’t be moved.
What is the right command to do so?
This should do it:
mv /directory_one/* /directory_one/.* /directory
It will move regular files and dotfiles.
Check more discussion of this question.
Related posts:
- chmod all files (including hidden files) in a directory in Linux (not recursively)
- Bash snippet to move all files in a directory into that directory
- Copying a directory from one UNC share to another using ‘move’ command fails with an access denied error but works in Windows Explorer
- How to view hidden files using Linux `find` command
- Huge directory, not files inside, but directory itself
Leave a comment
Recent Posts
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





