Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

gedit foo
ctrl+a ctrl+c
alt+f4

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

COMMAND foo

Thanks in advance ! :)

share|improve this question

2 Answers 2

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 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

 
discard

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.