copying all (hidden) files in linux with cp

0 minute read (97 words)

One of my old pet hates in Windoze is the default explorer setting to hide system files, which means you don't get everything when copying stuff.

In linux, a hidden a file or directory is anything that starts with a dot.
So, I want to take a copy of my ~/ (home, like windoze profile), hidden files and all.

cd /home/tim
cp -r ./* /mnt/otherhdd/stuff/timshome/

Look with ls -l, no hidden files. hrmm.

Only thing I could find was this:

cp -r .??* /mnt/otherhdd/stuff/timshome/

Seems a bit clunky to me.
Anyone know a better way? Like cp -rh or summat.

Tweet This || Post to LinkedIn || Page Source

Subscribe for updates on software development, contracting, side projects, blog posts and who knows what else. Read the archives for an idea of content.

Mailing list powered by the excellent