2

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

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

but it seemed not working.

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407

2 Answers2

3

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.

Avinash Raj
  • 80,446
2

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.

Zuko
  • 1,277