Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 transfer the folder from a CD to Documents in Ubuntu. How should i code it in shell? the folder name in the cd is CompFiles.

share|improve this question

marked as duplicate by bodhi.zazen, mikewhatever, Raja, Eliah Kagan, Nathan Osman Mar 13 '13 at 5:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted

Your CD should be mounted in /media/$USER/ directory, so the source directory becomes /media/$USER/label_on_CD/CompFiles/ and your destination directory is /home/$USER/Documents/. To copy the files, either execute the command:

cp /media/$USER/label_on_CD/CompFiles/ /home/$USER/Documents/ -r

or write this command to a file and execute the command bash file_name where file_name is the name of the script.

share|improve this answer
how should i save this script? – Kayla Mar 13 '13 at 3:05
You can save it without .sh too. Bash interprets the file as a shell script even without it. – i08in Mar 13 '13 at 3:15

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