How can I write on my computer screen or open an application like notes and write on it from Terminal??

I can open up notes or any other app/document.

  • 1
    Are you perhaps looking for nvAlt or is the handwriting tag to indicate that you want character recognition from a pen device? – bmike Mar 6 '14 at 21:20

Terminal is a CLI, or Command Line Interface, and notes and other text editor apps that you are familiar with are part of the GUI family, Graphical User Interface. The GUI is most likely the type of interface you interact with every day.

That being said, you cannot open and run a GUI app in a CLI. If you open up myapp.app from Terminal, it will open it up as a GUI. For example, you can't open up Safari in terminal, do a google search from the command line, and then watch a video. However, there are a few CLI text editors that would be similar to notes already installed on your computer. My favorite is vi.

Open your terminal, and type vi after the prompt. A new interface should appear with a description of vi. I'll post a link to all the commands in vi at the end of my post, but I'll go over a few of the essential ideas.

  • No mouse. It's 100% a CLI, meaning you can't use the mouse for anything. Instead, use the arrow keys.

  • With that in mind, when you enter vi you are in command mode. We'll talk more about that in a second. To add text, you have to enter insert mode, which is done by typing i+return. Now you are in insert mode and you can type whatever you want.

  • Command mode: When you are done typing, you're going to want to save your file most likely. To do this, you must enter command mode. Press the escape key. Then type: :wq filename+return. This saves a new file called filename. Keep in mind it saves to the current directory you are in. To fully exit and save, type :wq

You can even change the standard output to make it viewable in the GUI:

filename > filename.txt

Then, you can open filename.txt in textedit, or any other GUI text editor.

One last cool feature of vi, is it lets you edit current ASCII files anywhere on your computer. Just type vi filename in the prompt.

Here is a link to a basic list of vi commands

| improve this answer | |
  • vim is an extremely useful tool and, though it may take time to learn, is in my opinion one of the fastest ways to develop if you know your stuff. I also think it is better to start with than an IDE because you have to do all the typing yourself. @dwightk – samrap Mar 7 '14 at 1:16
  • Did I misunderstand the question? It sounded like he was looking for a way to edit text files from the command line? As far as I know vi/vim is the default text editor for UNIX command line. If he was simply asking how to open textedit from the command line than I agree this was overkill – samrap Mar 7 '14 at 2:50
  • sounds good @dwightk your answer is good – samrap Mar 7 '14 at 20:56

An extremely easy way to edit text in the command line that doesn't require a significant investment of time to learn is nano.

nano foo opens foo if it exists in the directory or a blank file if it doesn't.

You navigate the cursor using your arrow keys, and use control+o to save(enter to confirm filename)

and control+x to close.

The best news is that you don't have to memorize these commands because they are all displayed at the bottom of the terminal window while you are using nano.

| improve this answer | |
  • 1
    +1. While the command pico works, it is actually an alias for nano. Pico was text editor for the Pine email client. Nano is a Pico work-alike that has been extended and released under GPL. – AllInOne Mar 6 '14 at 21:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .