I edited a file in /etc/ that I want to save, but forgot to open it using sudo. I remember there was a command to save such a file in vi, and want to know if there is any such way to do it in nano?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Yes you could save it temporarily to your home directory. Press Ctrl+O to change the path to your home directory or in /tmp and then press Enter to save it. Then you can
sudo mv it.
Press CTRL+O will show you the path. Change that to your home directory or /tmp. For example File Name to Write: /tmp/filename and press Enter.