Excuse me for my Bad english.I want to copy only images(.png) present inside a specific directory(serenity) ignoring the sub-directories(datatables, images..etc,) in that, to another directory.
find /home/user/Selenium_new/Staf/target/site/serenity/ -iname "*.png"
I used the above command to get all the images present inside the serenity directory, but it is also fetching images for sub-directories as well.The result of the command is:
/home/user/Selenium_new/Staf/target/site/serenity/images/success.png
/home/user/Selenium_new/Staf/target/site/serenity/images/menu_h.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-chrome.png
/home/user/Selenium_new/Staf/target/site/serenity/images/ico-q.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-appium.png
/home/user/Selenium_new/Staf/target/site/serenity/images/cross.png
/home/user/Selenium_new/Staf/target/site/serenity/images/small-middle.png
/home/user/Selenium_new/Staf/target/site/serenity/images/fail.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-iexplorer.png
/home/user/Selenium_new/Staf/target/site/serenity/images/screen.png
/home/user/Selenium_new/Staf/target/site/serenity/images/ignor.png
/home/user/Selenium_new/Staf/target/site/serenity/images/menu_s.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-remote.png
/home/user/Selenium_new/Staf/target/site/serenity/images/worker.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-phantomjs.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-safari.png
/home/user/Selenium_new/Staf/target/site/serenity/images/serenity-bdd-logo.png
/home/user/Selenium_new/Staf/target/site/serenity/images/video.png
/home/user/Selenium_new/Staf/target/site/serenity/images/small-middle-right.png
/home/user/Selenium_new/Staf/target/site/serenity/images/tick.png
/home/user/Selenium_new/Staf/target/site/serenity/images/plus.png
/home/user/Selenium_new/Staf/target/site/serenity/images/pending.png
/home/user/Selenium_new/Staf/target/site/serenity/images/menu_f.png
/home/user/Selenium_new/Staf/target/site/serenity/images/skip.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-provided.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-htmlunit.png
/home/user/Selenium_new/Staf/target/site/serenity/images/links_menu.png
/home/user/Selenium_new/Staf/target/site/serenity/images/minus.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-opera.png
/home/user/Selenium_new/Staf/target/site/serenity/images/driver-firefox.png
/home/user/Selenium_new/Staf/target/site/serenity/9f5dedcc05678478e7511bb10f9fe15d_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/4a6c5da6264596f2e28453381a0958a2_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/d08552dd3fc9a718eda02eb432d35db1_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/2e756d0187d17ff7ede129c0cd26d5ed_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/3781a9f41cb06adbf2bcab99315e5016_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/jqtree/0.22/jqtree-circle.png
/home/user/Selenium_new/Staf/target/site/serenity/e4a22a00e04d0f54c7306e49a88e3a2c_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/0683540c982a0550834aaea79d71942a_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/76007c6a74590dce97d26dedf8344926_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/ab38399ff5f8b5222e8106c805b97e14_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/fb0cb5df5880626b23643f399bfc5b62_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/sort_asc.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/sort_desc.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/forward_enabled_hover.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/sort_desc_disabled.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/forward_enabled.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/back_enabled_hover.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/sort_asc_disabled.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/forward_disabled.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/back_enabled.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/sort_both.png
/home/user/Selenium_new/Staf/target/site/serenity/datatables/1.10.4/media/images/back_disabled.png
/home/user/Selenium_new/Staf/target/site/serenity/9f364046fc0272688aa06a3fb71b8ded_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/644d968b7f1b2979841ae07223d1f860_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/85fcef5aa335c83a53d5d31da56b9fe3_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/29e3a91e22d17dc12be045deae496d93_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_glass_45_0078ae_1x400.p
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_056b93_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_gloss-wave_75_2191c0_50
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_d8e7f3_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_glass_55_f8da4e_1x400.p
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_flat_55_999999_40x100.p
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_0078ae_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_glass_75_79c9ec_1x400.p
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_e0fdff_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_inset-hard_100_fcfdfd_1
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_f5e175_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_fcd113_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_gloss-wave_45_e14f1c_50
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-icons_f7a50d_256x240.png
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_gloss-wave_50_6eac2c_50
/home/user/Selenium_new/Staf/target/site/serenity/jqueryui/1.11.2-start/images/ui-bg_flat_75_aaaaaa_40x100.p
/home/user/Selenium_new/Staf/target/site/serenity/1dff59ff9f9aeacc1158f993154c5780_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/jit/css/col2.png
/home/user/Selenium_new/Staf/target/site/serenity/jit/css/col1.png
/home/user/Selenium_new/Staf/target/site/serenity/jit/css/gradient.png
/home/user/Selenium_new/Staf/target/site/serenity/acca1aa0392b5b4061b7010cbdf78d25_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/c47b46d36817b6d09b332d03237f41c1_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/8b059de51307d713150b9bff578302ef_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/demo/images/dev7logo.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/light/arrows.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/light/bullets.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/default/arrows.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/default/bullets.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/bar/arrows.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/bar/bullets.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/dark/arrows.png
/home/user/Selenium_new/Staf/target/site/serenity/nivo-slider/3.2/themes/dark/bullets.png
/home/user/Selenium_new/Staf/target/site/serenity/97e00cdb9c0e090e8f012cca67fc38e2_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/23d7196aa4430b6e75bd6c7106693cc1_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/6cc23a7c739909acd59a723e16e56c9c_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/92052104972408175031d00e90a48543_NONE.png
Question1: How to get all the images present only in the directory(serenity), not images from sub-directories (images,datatables,.....etc)?
/home/user/Selenium_new/Staf/target/site/serenity/97e00cdb9c0e090e8f012cca67fc38e2_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/23d7196aa4430b6e75bd6c7106693cc1_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/6cc23a7c739909acd59a723e16e56c9c_NONE.png
/home/user/Selenium_new/Staf/target/site/serenity/92052104972408175031d00e90a48543_NONE.png
Question2: How to copy only those above images(directory Images) to another directory (/home/user/temp)?
Why even use
find
?Copies all png images from the first to the second dir.
If you want to use
find
for whatever reason and not thecp
then you have to use-maxdepth
option with1
:It only look to the directory specified and not the sub directories.
To copy: