LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-26-2012, 05:58 AM   #1
kopele-mopele
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Saving the network config file...


Dear friends,

I'm completely new to using Linux and I'll probably ask the most stupid question ever, but I didn't manage to find the answer on the network, so here it is:

I'm modifying the network config file on a Ubuntu server system using the command line. I altered the file but I don't know how to save it. When I press the ctrl + x keyboard combination I get this message at the bottom of the screen:

-- X^ mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)

... and I'm kind of stuck at that screen. Please help!
 
Old 04-26-2012, 10:22 AM   #2
BertM
LQ Newbie
 
Registered: Jan 2010
Location: Belgium
Distribution: Debian
Posts: 17

Rep: Reputation: 0
It seems you are using the vi editor instead of nano.

In nano you can save using Ctrl+x, but this shortcut does something else in vi.

To save a file in vi, first press the Escape button to leave insert mode.

Then type the following to, respectively, enter Command-line mode and save and exit the file:
Code:
:wq
If the file has read-only permissions, you will have to add an exclamation mark to force the file to be saved and exit:
Code:
:wq!
Vi might come off as a bit of a strange editor, and takes some time to get used to, but once you start to get the hang of it, it's really nice.

You can find a lot of beginner tutorials on the internet.

PS. If it's a system file you are trying to edit, you will probably also require superuser permissions to edit it.
 
Old 04-26-2012, 02:37 PM   #3
kopele-mopele
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you so much, Man! You made my evening
 
Old 04-26-2012, 09:36 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Actually, that's a bit cargo cult. To exit & save in vi/vim, its just
Code:
:x

# or 
:x!
w = write
q = quit no save
x = exit with save
! = do it, even if its a read only file
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network config not saving... XtremeGamer99 Linux - Networking 3 06-16-2008 06:38 PM
Suse 9.3 yast2 hangs saving boot config or edit config deh6 SUSE / openSUSE 0 07-16-2006 04:43 PM
warnings after saving .config file under xconfig kushalkoolwal Debian 12 02-23-2006 07:28 PM
network config file arunsri Slackware 6 05-15-2005 01:57 AM
saving network config in 9.2 petkov Mandriva 1 03-22-2004 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration