A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/linux-unix/emacs-command-in-linux-with-examples/ below:

emacs command in Linux with examples

emacs command in Linux with examples

Last Updated : 02 Nov, 2022

Introduction to Emacs Editor in Linux/Unix Systems: The Emacs is referred to a family of editors, which means it has many versions or flavors or iterations. The most commonly used version of Emacs editor is GNU Emacs and was created by Richard Stallman. The main difference between text editors like vi, vim, nano, and the Emacs is that is faster, powerful, and simple in terms of usage because of its simple user interface. Unlike the vi editor, the Emacs editor does not use an insert mode, and it is by default in editing mode, i.e., whatever you type will directly be written to the buffer, unless you manually enter command mode by using keyboard shortcuts. Installing the Emacs Editor: 

 sudo apt-get install emacs 
 yum install emacs 

If the above method doesn't work for you or you want to manually compile emacs, follow these steps:

curl https://ftp.gnu.org/pub/gnu/emacs/emacs-26.1.tar.gz /emacs/emacs-26.1.tar.gz
tar -zxvf emacs-26.1.tar.gz
sudo apt-get update
sudo apt-get install build-essential libgnutls28-dev libncurses-dev
cd /emacs/emacs-26.1/
./configure          #Configure Emacs
make                 #build components using makefile
sudo make install    #Install Emacs

The above steps will install Emacs into your system. To confirm the install, you can check using terminal using the following command:

emacs --version 

Using Emacs Editor

To use emacs editor, use command - "emacs [-option] [file name]" (without quotation marks) : Example:

emacs new.txt

Explanation: This command creates a file called new.txt if it doesn't already exist. If the file with that name already exists, it's content is copied to the memory buffer and shown at the editing buffer area. Note: Using the emacs command with no filename opens the default interface of the emacs editor, as shown in the below image. This screen is user-friendly and you can navigate using the link options highlighted in the screen, like the option visit new file creates a new file buffer for you to start writing. Emacs Common Options: 

  1. --file file_name, --find-file file_name, --visit file_name This option is used to provide file name to edit. However, in most cases, this is not required and directly file name can be mentioned.
  2. +number The number here specifies the line number in the file which is followed in the command, and the cursor is moved to that line. There should be no space between the number and the + sign.
  3. +line:column Here line represents the line number or row and the column represents the number of characters. The cursor is automatically placed to this position in the file that is followed.
  4. -q, --no-init-file This option prevents Emacs from loading an initialization or init file.
  5. --no-splash This option prevents Emacs from showing splash screen at startup.
  6. -u user, --user user Load user's init file.
  7. --version To display version and license information.
  8. --help Display help.

Note: For more options, you can type "man emacs" or "emacs --help" without the quotation marks. Emacs - Common Keyboard Shortcuts

  1. General Shortcuts: 
  2. Copy, cut and paste shortcuts: 
  3. Search and Replace: 
  4. Moving cursor: 
  5. Miscellaneous: 

Help page inside emacs:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4