Open full text files in terminal

Discussion in 'macOS' started by karohan, Dec 10, 2010.

  1. karohan macrumors 6502

    Jun 25, 2010
    How do you open/edit text files in the terminal such that I don't need to navigate through pages of the text file, I just want to see the whole file there so I can scroll up and down it (similar to the output with "cat").
  2. MisterMe macrumors G4


    Jul 17, 2002
    At the command prompt, type pico {complete path of file} [return]

    Easier alternative:
    1. At the command prompt, type pico
    2. Drag the file from its folder window to the Terminal window.
    3. Press [return]

    If you have an editor that you prefer over pico, substitute its name wherever you see pico above.
  3. karohan thread starter macrumors 6502

    Jun 25, 2010
    I tried Pico, but the view forces me to navigate through large text files by changing the "page". I can't simply scroll through the content, which is easier for me. Are there any alternative editors that have such a view in terminal?
  4. angelwatt Moderator emeritus


    Aug 16, 2005
    That's simply not how Terminal works so you won't find anything most likely. Just use a different editor like MacVim, TextWrangler, Emacs, or whatever.
  5. miles01110 macrumors Core


    Jul 24, 2006
    The Ivory Tower (I'm not coming down)
    No. Even the editors that allow you to move the cursor will "jump" to the next page upon reaching the bottom of the previous one. You are looking for a GUI text editor, apparently.
  6. fwhh macrumors regular

    Aug 11, 2004
    Berlin, Germany
    I guess, you didn't understand the concept of the terminal. The scrollbar on the terminal window just shows you a kind of terminal-output history. Only the last part of this windows is the actual terminal. For an editor you may want to try the old-school "vi" (or actually vim):type
    vi textfile
    Use "i" to enter the edit mode, ESC to switch to command mode.
    ":q!" quits without saving, "ZZ" saves the file to disk. Refer to "man vi" for more infos.
    But if you want to open a file for editing, you can also use
    open textfile
    (default app) or
    open textfile -a smultron
    (e.g. open file with smultron)
    and, most handy:
    open .
    view current folder in finder.

Share This Page