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

Copy two files from the /etc directory. They are cust_orders and cust_names. Copy both files from the /etc directory to your home directory using ONE shell command with your home directory as the default directory that uses the FEWEST keystrokes possible.

share|improve this question
@Kamran: What is the purpose of tagging vi in your question? – i08in Mar 29 '13 at 17:30
Another lab assignment / homework? – user68186 Mar 29 '13 at 17:32

I think the "best" single command would be

cp -i /etc/cust_{order,name}s $HOME
share|improve this answer
+1 from me. I totally forgot about that way. – Aaron Mar 29 '13 at 18:22

with your home directory as the default directory

So I'm assuming that means you are already in your home directory. If not:

$ cd ~

To do this in the fewest keystrokes, I would try this:

$ cp /etc/cust_*s .

Or if you wanted to copy only those two files exactly, you could list them both in a text file:


Save that as "f.txt" and then you could copy only those two files like this:

cp `cat f.txt` .
share|improve this answer
cust_orders and cust_names may not be the only folders beginning with cust_ and ending with s, this will copy all of them, if not. – i08in Mar 29 '13 at 17:23
@Jobin Very true. I was trying to find a happy medium of A) getting what he wanted and B) in the "FEWEST keystrokes possible." – Aaron Mar 29 '13 at 17:25
The command should not introduce new problems(that of copying/moving others back) while solving old ones, @BryceAtNetwork23. – i08in Mar 29 '13 at 17:32
Well, if you want the fewest key strokes without adding additional errors ... cp -i /etc/cust_{order,name}s . The -i option prevents you from inadvertently overwriting existing copies. – bodhi.zazen Mar 29 '13 at 17:42

Your Answer


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.