Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Lets suppose that I have a file named "foo". For example, I can copy its contend doing:

gedit foo
ctrl+a ctrl+c

But, I wonder if I can do the same thing with something like:


Thanks in advance ! :)

share|improve this question
up vote 3 down vote accepted

May be you can try to copy ( append) the contents of file foo using command redirection.

#cat foo > new.txt  --> this will copy the contents of file foo to new.txt
#cat foo >> new1.txt --> this will append the contents of file foo to new1.txt

If your intention is not copying to other file and is just copying in to buffer/clipboard then try "xclip"

share|improve this answer
Thats it, thank you :) – Vlad Tarniceru Jul 26 '13 at 23:06

If you just want to copy the file:

cp /path/to/file/filename.extension /path/to/other/file/(new)filename.extention(2)

Don't change the extension if you want to keep the file type.

share|improve this answer

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.