[Centos] How to cp a file to every subdirectory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Kercher wrote:
| I need to copy a file (or actually a symlink) to every subdirectory on a
| path.
|
| I know that cp -s will do the copy I want, but how can I get it to go into
| every subdirectory?  I've tried different iterations of ls to get a
listing
| of directories only (recursively) without success.

find . -type d -exec ln -s /path/to/orignal/file "{}"/. \;

this includes the current directory
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCIkUqCRFXD+VcGBkRAuJbAJ9qqoSajbL6zh+1kzoneUBo2fAGhQCfUBlq
KSugmxe43LrDSXgGuRjZF0Q=
=1JbK
-----END PGP SIGNATURE-----

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux