Results 1 to 7 of 7

Thread: nano editor

  1. #1
    Join Date
    May 2013
    Beans
    28
    Distro
    Ubuntu 12.04 Precise Pangolin

    nano editor

    Hello'
    How do you save and close nano?

    Thank You

  2. #2
    Join Date
    Dec 2007
    Location
    /home
    Beans
    483

    Re: nano editor

    ctrl + o to save
    ctrl + x to close
    Don't eff with The Cult...

  3. #3
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    986
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: nano editor

    The commands are listed on the nano interface itself. Look at the lower part of the screen.
    The Philippine Team
    The best Ubuntu derivative: Linux Mint
    Relax. Head to the Community Cafe.

  4. #4
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    4,395
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: nano editor

    If you just want to save on close ctrl + x is all you'll need.
    when you do that, it's first ask to save the modified file, click y and enter and then it'll ask for a filename.
    If you've opened an existing file, then the name should be listed, if so, just click enter, and you'll exit nano.
    Last edited by deadflowr; August 23rd, 2013 at 04:54 AM.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  5. #5
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: nano editor

    Do not forget to save the original and unmodified file with another name if you are editing config files.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests by PM, thanks |

  6. #6
    Join Date
    Dec 2007
    Location
    Bombay
    Beans
    5,928
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: nano editor

    Quote Originally Posted by bapoumba View Post
    Do not forget to save the original and unmodified file with another name if you are editing config files.
    That is excellent advice. Also, If you look at /etc/nanorc, you'll see that there's a provision to keep a backup file
    Code:
    ## Backup files to filename~.
    set backup
    This file uses "#" at the start of a line to comment out options. So, if, in your version of /etc/nanorc, the second line is commented out, open the file (after making a copy of the original with a useful alternate name) using
    Code:
    sudo nano /etc/nanorc
    While saving the original is obviously essential, the backup procedure described above will keep just a single backup of subsequent edits.

    That's why I prefer to use gedit as my text editor with the doublesave plugin. This way, each and every version of files I modify is saved with a unique timestamp in case I want to go back a few or more versions.

    I should mention that most of the files I edit are in my home folder and are not system files.
    de gustibus et coloribus non est disputandum -- Wiktionary

  7. #7
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: nano editor

    Or open nano with the -B switch
    Code:
    -B (--backup)
    When saving a file, back up the previous version of it to the current filename suffixed with a ~.
    If you are doing several edits on the same file, vasa1's method works best (thanks, I did not know that).

    If editing config files out of /home, nano should be opened with sudo. You can save the original file to your /home for backup or within the system files. In the later case, files may get written over.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests by PM, thanks |

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
  •