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

You can use vi in Ubuntu as well:

vi file.txt

To make a file excecutable use

sudo chmod u+x
share|improve this answer
Most of the time it would be better to chmod u+x 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
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
@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


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.