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.

I was a unix and redhat user, just started to use ubuntu. Is there a vi command to edit files? Is there a change mode command to change a file status to executable?

share|improve this question
    
It would be better to ask two different questions. –  Richard Sep 16 '13 at 20:56
    
Why did you think to come ask such a question instead of simply trying it? –  psusi Sep 17 '13 at 1:24

2 Answers 2

You can use vi in Ubuntu as well:

vi file.txt

To make a file excecutable use

sudo chmod u+x file.foo
share|improve this answer
2  
Most of the time it would be better to chmod u+x file.foo without invoking sudo. In fact, I think you'd only need sudo if you don't own the file. It's also possible to call chmod within vi -- while in normal mode, type :!chmod u+x % and then press enter to change the permissions on the current file. –  evilsoup Sep 16 '13 at 21:56
    
Thanks for the useful comment :) –  Joren Sep 16 '13 at 22:06

Yes, the commands are identical vi (or vim = vi iMproved) is invoked by entering vi in the command line and chmod changes can be used to change a file's executable flag exactly as in Redhat...

share|improve this answer
    
Where is the command line? How do I open a window that prompts me to enter a command like vi or chmod? –  Jing Wang Sep 16 '13 at 20:56
1  
From a unity desktop, do ctrl, alt t to open up a new shell, then you can vi to your hearts content. –  FreudianSlip Sep 16 '13 at 21:02
1  
@JingWang be warned that vi/vim has a bit of a learning curve. If you're new to using the command-line, I'd recommend using nano (if you want a CLI-based editor) or even gedit (the default Ubuntu GUI text-editor). –  evilsoup Sep 16 '13 at 21:57

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.