How to open a file in ssh

I know how to open file using gedit on desktop. How do you open a file in ssh when using Linux?

You need to use a text editor such as nano (easy for new users) or vim. The steps are follows to open a file:

  1. Log in using ssh:
    ssh user@server-name
  2. To show just file run:
    cat /path/to/file
  3. To edit or open a file named demo.py in the current directory, execute:
    nano demo.py
    vi demo.py
  4. Other options are:
    more filename
    less filename

See my FAQ:
https://www.cyberciti.biz/faq/unix-linux-command-to-view-file/