I have the script files script1.ksh ...script10.ksh in the directory star2

PATH : home/aaa/star2

I need to move all the files under star2 to the home directory (home/aaa)

NOTE : I do not want the folder star2 but I need all files in this folder to come under home/aaa

current issue : home/aaa/star2/script1.ksh..rest of script files

what I needed : home/aaa/script1.ksh..rest of script files

command I used : cp -r /home/aaa/star2 ~

but I get error in console saying

"cannot copy /home/aaa/star2 to /home/aaa/star2"

What do I need to do?

  • @Rui F Ribeiro woud be helpful if u can share the answer . – star Mar 9 '16 at 18:47


mv /home/aaa/star2/* ~/
rmdir /home/aaa/star2
  • * is used to recursively move ? wont it throw the same error cannot move /home/aaa/star2 to /home/aaa/star2 – star Mar 9 '16 at 18:51
  • You should learn more about 'mv'.it would throw error if it had /home/aaa/star2/star2 – pranav Mar 9 '16 at 18:57
  • there is only one star2 file and under this file many script files are present .issue is how to remove this star2 files alone and not the script files inside it and bring these script files to home directory . – star Mar 9 '16 at 19:02
  • 1
    @star: Users on this site are encouraged to try to figure things out for themselves.  You've been given an answer; now you should read the documentation to figure out how it works.  If there's something in the documentation that you don't understand, then come back here and ask for more help. – G-Man Mar 9 '16 at 21:04
  • @Fiximan : thank you so much that works ... – star Mar 12 '16 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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