Results 1 to 4 of 4

Thread: How to open a file with an application from the terminal?

  1. #1
    Join Date
    Jan 2019
    Beans
    25

    How to open a file with an application from the terminal?

    I'm trying to add a line of code
    source /home/...
    to the end of a file. I think I need to open this file in an editor (using Atom), edit the file, save the file, and then I'll re-run the command that told me to do all of this. So how do I open a file (.bashrc, if it matters) with atom and then how do I save it so I overwrite the old file? Thanks a bunch!!

  2. #2
    Join Date
    Jan 2019
    Beans
    25

    Re: How to open a file with an application from the terminal?

    OK I figured it out. In other words, I was told from elsewhere.
    nano [file name]
    edit the document
    control + X
    Y
    Then I opened a new terminal and ran it. Not sure if you have to close the old terminal and then run the new one, but it works.

  3. #3
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,703

    Re: How to open a file with an application from the terminal?

    If atom (never heard of it) is your favourite editor, then atom <filename> would probably have worked.

  4. #4
    Join Date
    Apr 2008
    Location
    Norwich CT
    Beans
    2,659
    Distro
    Ubuntu Mate

    Re: How to open a file with an application from the terminal?

    Quote Originally Posted by redus View Post
    OK I figured it out. In other words, I was told from elsewhere.
    nano [file name]
    edit the document
    control + X
    Y
    Then I opened a new terminal and ran it. Not sure if you have to close the old terminal and then run the new one, but it works.
    Nano has been my go-to text editor since Ubuntu 8.04, when I found that Linux is a far, far better OS than the malware magnet known as Windows.
    Last edited by oldrocker99; January 16th, 2019 at 11:18 PM.

    I drink my Ubuntu black, no sugar.
    Ubuntu user 28819

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •