FUNDAMENTALS A Complete Guide for Beginners
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]...
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.
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.
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.
Similar Readings
- The “grep” Command in Linux [10+ Practical Examples]
- The “wc” Command in Linux [15 Practical Examples]
- The “sort” Command in Linux [16 Practical Examples]
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.
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.
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.
Similar Readings
- The “nano” Command in Linux [13 Practical Examples]
- The “cut” Command in Linux [8 Practical Examples]
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.
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.
Similar Readings
- The “vi” Command in Linux [6 Practical Examples]
- The “vim” Command in Linux [8 Practical Examples]
- The “egrep” Command in Linux [10+ Practical Examples]
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.
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.
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
- The “paste” Command in Linux [6 Practical Examples]
- The “split” Command in Linux [6 Practical Examples]
- The “sed” Command in Linux [7 Practical Examples]
- The “tr” Command in Linux [6 Practical Examples]
- The “uniq” Command in Linux [6 Practical Examples]
- The “printf” Command in Linux [8 Practical Examples]