Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to copy all my .png file to particular directory by using:

cp ...../*.png $pwd   

but it seemed not working.

share|improve this question
up vote 3 down vote accepted

Try this command,

for i in /path/*.png; do sudo cp $i /path/to/destination/directory; done

It will copy all the .png files and paste them to the destination directory.

share|improve this answer
It worked, thanks Dude :) – taymindis Woon Apr 6 '14 at 7:17
You're welcome :-) – Avinash Raj Apr 6 '14 at 7:20

Just as an alternative, try this

 cp <path>/*.png <destination-dir>

Notice the space between the *.png and destination-dir. Try to only use/append sudo as a prefix if the files your trying to access are restricted to root or other users inaccessible to you directly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.