How-to edit server.properties file on Linux

From Got Opinion Wiki
Revision as of 16:01, 3 May 2020 by Paul (talk | contribs) (initial page creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basic steps

  1. Connect to Linux server
  2. Navigate to directory where server.properties file is located
  3. Use a text edit to open, modify, and save server.properties file

How-to edit server.properties using vi

  • The scope of this how-to is step 3 from basic steps.
  • This how-to will cover changing maximum clients from 8 to 16.

Step 1 - open server.properties file with vi

$ vi server.properties

vi is a model editor that supports insert or command mode. insert mode is where typed text could become part of the file. command mode is where keystrokes are interpreted as commands that control the edit session.

Basic cursor movement in vi:

  • ESC to enter command mode when in insert mode
  • i to enter insert mode when in command mode
  • k or up arrow to move up one line
  • j or down arrow to move down one line
  • h to left arrow move left one character
  • l to right arrow move right one character
  • $ to move to end of line
  • r replace single character under cursor (no <Esc> needed)
  • R replace characters, starting with current cursor position, until <Esc> hit
  • u undo last change
  • :x save and exit file

Step 2 - move cursor to max-players=8 line

Move cursor down to line that starts with max-players= using j or down arrow. Your cursor should be over m in max-players.

Step 3 - move cursor over 8

Move cursor to right using l or right arrow until over the 8.

Step 4 - change 8 to 16

Press R then type 16 and press ESC.

Step 5 - save file and exit vi

Press :x then press Enter.

Step 6 - verify file was changed

$ grep players server.properties

You should see max-players=16 as part of output.

To Minecraft