The “jed” Command in Linux [8 Practical Examples]

jed command in Linux is used to open up a text editor called “jed”. It is a friendly editor with a drop-down menu that can be used by programmers in Linux. In this section, you will get to know the ins and outs of the jed command in Linux.

A. Description

Jed” is a customizable text editor that is available in a wide range of platforms including Linux, Windows, macOS and so on. But it is mostly used in Unix-like systems. This text editor supports multiple programming languages. To use this text editor in Linux, you need to use the jed command.

B. Syntax

The jed command has a simple syntax in Linux. And the syntax is indicated below:

jed [OPTION]... [FILE]...

Note: In the syntax above, OPTION is enclosed by a square bracket and followed by 3 dots representing that more than one option can be used together. Besides, 3 dots after FILE suggest that you can specify multiple files.

C. Options

Very few options are available for the jed command in Linux. I have listed here some of the useful options of this command. Yet, you can look into the man page for the jed command to know more about its options.

man jed

Useful Options

  • -2, Splits window of the text-editor.
  • +line_number, Opens the text-editor in the specified line.

Note: The options in Linux CLI (Command Line Interface) are case-sensitive, so be alert while using them.

How to Install Jed in Linux

It is really easy to install jed in Linux. To install the jed follow the procedure below:

Steps to Follow >

➊ Just like the image below, first open up the Ubuntu Terminal.

➋ Type the following command in the command prompt:

Sudo apt install jed

➌ Now, press the ENTER button.

➍ As you can see in the image, you need to type the password of your user account in the command prompt.

➎ Then, hit the ENTER button.

➏ After processing a little bit, the terminal screen will ask the question “Do you want to continue?[Y/n]”. Type “Y” in the command prompt to continue the installation.

➐ After that, press the ENTER key.

And your jed command is ready to use in Linux.jed installation

Practical Examples of the “jed” Command in Linux

The jed command in Linux is a pretty straightforward command which is used to open up a text editor called “Jed“. Here you will get to know some useful examples of the jed command in Linux. In this article, I have worked with the files below.

Example 1: Open New & Blank File in Jed Text-editor Using the “jed” command in Linux

To open up a new text file in the Jed text editor I am using the jed command in Linux. You can also do this by following the steps below:

Steps to Follow >

➊ At first open the Ubuntu Terminal.

➋ Type the next command in the command prompt:

jed

➌ Then, press the ENTER button.

Output >

As you can see in the image, a new & blank text file is opened in the jed text-editor.Open New & Blank File in Jed Text-editor Using “jed” command in Linux


Similar Readings


Example 2: Edit a Text File in Jed Text-editor Using the “jed” Command in Linux

To edit a text file in the Jed text editor you can use the jed command in Linux.

Steps to Follow >

➊ First open up the Ubuntu Terminal.

➋ Type the following command in the command prompt:

jed File1.txt

➌ Now, press the ENTER button.

Output >

As you can see, the text file named File1.txt is opened in the jed text-editor.Edit a Text File in Jed Text-editor Using “jed” Command in Linux

Edit a Text File in Jed Text-editor Using “jed” Command in Linux

Example 3: Save & Exit the Current File in Jed Text-editor

To save & exit a text file in the Jed text editor you can use the keyboard shortcuts in Linux.

Steps to Follow >

➊ First open up the Ubuntu Terminal.

➋ Type the following command in the command prompt:

jed File1.txt

➌ To save the text file, use the following keyboard shortcuts.

CTRL +X CTRL +S

➍ And to exit the text editor, use the following keyboard shortcuts.

CTRL + X CTRL + C

Output >

In the image below, the display is showing the  CTRL + X  as I used this keyboard shortcut.Save & Exit the Current File in Jed Text-editor

Example 4: Search a Specific String in the Text File

To search a specific string in the text file in the Jed text editor I am using the jed command. To do the same you can use the following steps:

Steps to Follow >

➊ First open up the Ubuntu Terminal.

➋ Type the following command in the command prompt:

jed File1.txt

➌ To search a string in the text file, use the keyboard shortcuts below.

CTRL + S

➍ Now type the string you want to search.

Output >

In the image below, the highlighted string is the one I searched here.Search a Specific String in the Text File


Similar Readings


Example 5: Open Jed Text-editor and Start at a Specific Line Number

To open the Jed text editor at a specific line number you can use the following syntax of the jed command:

jed +line_number filename.

To do the same you can use the process below:

Steps to Follow >

➊ Firstly launch the  Terminal in Ubuntu.

➋ Type the following command in the command prompt:

jed +3 File2.txt

➌ Now, press the ENTER button.

Output >

In the images below, you can see the File2.txt is opened in Jed text editor at line number 3 as mentioned in the command.Open Jed Text-editor and Start at a Specific Line Number

Open Jed Text-editor and Start at a Specific Line Number

Example 6: Split Window of the Jed Text-editor Using the “jed” command in Linux

To split the Jed text editor you can use the jed command with option -2.

Steps to Follow >

➊ Firstly open up the terminal window in Ubuntu.

➋ Type the following command in the command prompt:

jed -2 File2.txt

➌ Now, hit the ENTER key.

Output >

In the following images, you can see the File2.txt  is opened in Jed text editor and the text editor’s window is split.Split Window of the Jed Text-editor Using “jed” command in Linux

Split Window of the Jed Text-editor Using “jed” command in Linux


Similar Readings


Example 7: Use the Drop-down Menu of the Jed Text-editor

To use the drop-down menu of the Jed text editor in Linux follow the steps below:

Steps to Follow >

➊ First open up the Ubuntu Terminal.

➋ Type the following command in the command prompt:

jed File1.txt

➌ At first press the ESC then the M button.

OR,

press the F10 key.

➍ Now, hit the ENTER key.

Output >

In the image below, you can see the drop-down menu in the Jed text editor.Use the Drop-down Menu of the Jed Text-editor

Example 8: Open Multiple Files At a Time in the Jed Text-editor Using the “jed” command in Linux

To open multiple files together in the Jed text editor you can use the jed command along with the filenames in Linux.

Steps to Follow >

➊ At first open Ubuntu Terminal.

➋ Type the following command in the command prompt:

jed File1.txt File2.txt File3.txt

➌ then, press the ENTER key.

Output >

In the images below, you can see the File1.txt, File2.txt and File3.txt text files are opened in Jed text editor at the same time.Open Multiple Files At a Time in the Jed Text-editor

Open Multiple Files At a Time in the Jed Text-editor

Conclusion

As exemplified in this section, the jed command has some significant uses in Linux. You’ve also learned the syntax, some functional options, and the practical application of this command. Dive into the command and its practical applications thoroughly to become a power user.


Similar Readings

5/5 - (1 vote)
LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now
icon linux
Jannatul Ferdousi Sylvie

Hi there! This is Jannatul Ferdousi Sylvie. I am one of the Linux Content Developer Executives at Softeko. I live in Dhaka, Bangladesh. I have completed my BSc. in Software Engineering from American International University-Bangladesh. You can see my projects in the GitHub account. I love traveling, shopping, cooking, and gardening. Read Full Bio

Leave a Comment