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
  • 166,822
  • 48
  • 327
  • 400
taymindis Woon
  • 1,433
  • 5
  • 15
  • 18

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
  • 77,204
  • 56
  • 214
  • 254
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,247
  • 11
  • 12