Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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 at 7:17
    
You're welcome :-) –  Avinash Raj Apr 6 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

 
discard

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.