Mov directory ubuntu

July 15, 2021 . 1 MIN READ

How do you move all files (including hidden) in a directory to another?

up vote 7 down vote favorite

2

How do I move all files in a directory (including the hidden ones) to another directory?

For example, if I have a folder “Foo” with the files “.hidden” and “notHidden” inside, how do I move both files to a directory named “Bar”? The following does not work, as the “.hidden” file stays in “Foo”.

mv Foo/* Bar/

Note: Try it yourself.

mkdir Foo
mkdir Bar
touch Foo/.hidden
touch Foo/notHidden
mv Foo/* Bar/

shell rename wildcards dot-files

 

Leave a Reply

Your email address will not be published. Required fields are marked *