• About Us
  • Announce
  • Privacy Policy
  • Contact us
MasterTrend News
  • HOME
    • BLOG
    • STORE
  • Tutorials
  • Hardware
  • Gaming
  • Mobiles
  • Security
  • Windows
  • AI
  • Software
  • Networks
  • News
  • English English
    • Spanish Spanish
    • Portuguese Portuguese
    • French French
    • Italian Italian
    • German German
    • Korean Korean
    • Japanese Japanese
    • Chinese Chinese
    • Russian Russian
    • Thai Thai
    • Polish Polish
    • Turkish Turkish
    • Indonesian Indonesian
    • Hindi Hindi
    • Arabic Arabic
    • Swedish Swedish
    • Dutch Dutch
No result
See all results
  • HOME
    • BLOG
    • STORE
  • Tutorials
  • Hardware
  • Gaming
  • Mobiles
  • Security
  • Windows
  • AI
  • Software
  • Networks
  • News
  • English English
    • Spanish Spanish
    • Portuguese Portuguese
    • French French
    • Italian Italian
    • German German
    • Korean Korean
    • Japanese Japanese
    • Chinese Chinese
    • Russian Russian
    • Thai Thai
    • Polish Polish
    • Turkish Turkish
    • Indonesian Indonesian
    • Hindi Hindi
    • Arabic Arabic
    • Swedish Swedish
    • Dutch Dutch
No result
See all results
MasterTrend News
No result
See all results
Start Tutorials

Vi Editor: The Linux Trick Few Know About! Discover It! 🔥

MasterTrend Insights by MasterTrend Insights
May 12, 2025
in Tutorials
Reading time:Lectura de 7 minutos
TO TO
0
11 Vim Tips That Will Save You Hours of Editing Time
6
SHARED
18
Views
Share on FacebookShare on Twitter

Contents

  1. Vi Editor: Master it in 3 easy, stress-free steps! 🚀
  2. Getting Started with Vi
  3. Command Mode
  4. Insertion Mode
  5. Save and Exit
    1. Related Posts

Vi Editor: Master it in 3 easy, stress-free steps! 🚀

Vi is a powerful text editor that comes included with most Linux systems, even embedded ones. Sometimes, you'll need to edit a text file on a system that doesn't have a more user-friendly text editor, so knowing Vi is key. ✍️

Unlike Nano, a simpler terminal-based text editor, Vi doesn't hand you a list of on-screen keyboard shortcuts. It's a modal text editor, meaning it has both an insert mode and a command mode.

Getting Started with Vi

Vi is a terminal application, so you'll need to launch it from a terminal window. Use the command I saw /path/to/file to open an existing file with Vi. The command I saw /path/to/file also works if the file doesn't exist yet; Vi will create a new file and save it to the specified location when you're done. 💾

Ubuntu terminal with the vi command being used to open a new file.

Remember use sudo if you want to edit a file of the system. So, for example, you would have to write sudo vi /etc/fstab if you want to edit your fstab file.

Command Mode

This is what you'll see when you open a file in vi. It looks like you can only start typing, but that's not the case. Vi is a modal text editor, and it opens in command mode. Trying to type in this screen will give you unexpected behavior. ⚠️

A file opened in the vi text editor in an Ubuntu terminal window.

While in command mode, you can move the cursor with the arrow keys. Press the key x to delete the character under the cursor. There are several other commands for deleting; for example, typing dd (press the d key twice) deletes an entire line of text. 🗑️

You can select, copy, cut, and paste text in command mode. Place the cursor to the left or right of the text you want to select. you want to copy and press the key v. Move the cursor to select the text, and then press and to copy the selected text or x to cut it. Place the cursor in the desired location and press the key p to paste the text you copied or cut.

Selected text at the end of a file opened in the vi text editor.

Insertion Mode

Aside from command mode, the other mode you need to know about is insert mode, which allows you to insert text in Vi. Entering insert mode is easy once you know it exists: just press the key Yo once after you've positioned the cursor in command mode. Start typing and Vi will insert the characters you type into the file instead of trying to interpret them as commands. 📝

Vi text editor with text indicating that text was added by pressing the "i" key first.

Once you're done in insert mode, press the escape key to return to command mode.

Save and Exit

You can save and exit vi from command mode. First, make sure you're in command mode by pressing the Escape key. (Pressing the Escape key again doesn't do anything if you're already in command mode.)

Writes :wq and press Enter to save the file to disk and exit vi. You can also split this command; for example, type :w and press enter to save the file to disk without exiting, or type :q to exit vi without saving the file.

Vi text editor with the "wq" command written at the bottom of the window.


Vi text editor with error stating "Cannot write since last change" at the bottom of the window.


If you're looking for a more user-friendly terminal text editor, check out Nano. Most Linux distributions come with Elder brother preinstalled, but embedded systems and other small environments often only include Vi. 🖥️

Share this:
56FacebookLinkedInPinterestXRedditTumblrBlueskyThreadsShare
56
SHARES

Related Articles:

  • 🎮💻 25 Great Games for PC with Low Requirements and Top Graphics.
    💻 25 Great Games for PC with Low Requirements and Top Graphics.
    🎮💻 25 Great Games for PC with Low Requirements and Top Graphics.
  • Best Notebooks of 2023 - MSI Titan GT77
    Best Notebooks of 2023
    Find the ideal laptop for you among our list of the Best Notebooks of 2023.
  • GPU-accelerated terminals: maximum fluidity and speed!
    GPU-Accelerated Terminals: Boost Your Linux Experience…
    GPU-accelerated terminals deliver faster text and smoother scrolling on Linux, freeing up CPU power and improving your productivity 💻⚡✨
  • Keyboard shortcuts in Windows 11
    Keyboard shortcuts in Windows 11 are still very useful
    Useful Windows 11 Keyboard Shortcuts. Learn More Now!
  • Core i9-12900KS the new Alder Lake
    Core i9-12900KS Alder Lake
    Core i9-12900KS Alder Lake Technical Data Sheet. Learn more now!
  • How to Install Linux in 3 Easy Steps (Without Erasing Windows)
    How to Install and Try Linux Risk-Free! Get started today! 🔥🐧
    How to Install Linux Easily and Securely: Try It Without Erasing Windows! Make the switch today! 💻🐧⚡

Related Posts

  • Caller ID for WhatsApp
  • How to fix the error Something went wrong on Twitter
  • AMD Radeon RX 6500 XT news
  • PS5 Pro Leaks
  • Avoid Old Files in Notepad Windows 11 🛡️ Find out how!
  • Wi-Fi 6 Version 2
  • Running an AI model on Xbox 360: Amazing 👾
  • How to Disable Hyper-V in Windows 11: 5 Easy Steps! 🚀
Tags: Evergreen ContentProductivityTechTips
Previous Post

Lucky Patcher Alternatives: 12 Better and Easy Apps! 🎮⚡

Next publication

Scientist in Atomfall: Save Him or Kill Him? 😱🎮

MasterTrend Insights

MasterTrend Insights

Our editorial team shares in-depth reviews, tutorials, and recommendations to help you get the most out of your digital devices and tools.

Next publication
Should you help the Scientist in Atomfall?

Scientist in Atomfall: Save Him or Kill Him? 😱🎮

5 2 votes
Article Rating
Subscribe
Access
Notify of
guest
guest
0 Comments
Oldest
Newest Most voted
Online Comments
See all comments

Stay Connected

  • 976 Fans
  • 118 Followers
  • 1.4k Followers
  • 1.8k Subscribers

Don't miss the latest in technology and gaming.
Exclusive tips, how-to guides, and analysis every day.

Subscription Form
  • Tendencies
  • Comments
  • Last
How to save game in REPO

How to save your game in REPO 🔥 Discover the secret to not losing progress

July 7, 2025
How to add a clock to the Windows 11 desktop: 3 surefire tricks!

How to add a clock to your Windows 11 desktop: Get more done in minutes! ⏱️

May 1, 2025
12 Best Alternatives to Lucky Patcher for Android

Lucky Patcher Alternatives: 12 Better and Easy Apps! 🎮⚡

May 12, 2025
🖥️ How to open 'Devices and Printers' in Windows 11: 4 easy steps

🌟 How to Open 'Devices and Printers' in Windows 11: Amazing Trick!

February 27, 2025
Gmail Features on Android: Save Time with 5 Tips

Gmail Features on Android: 5 Tricks You Didn't Know About! 📱✨

12
Motherboard repair - Repair Motherboards

Notebook Motherboard Repair

10
Install Windows 11 Home without Internet

Install Windows 11 Home without Internet

10
How to Back Up Drivers in Windows 11/10 in 4 Steps!

How to Back Up Drivers in Windows 11/10: Avoid Errors! 🚨💾

10
Steam Corrupted Update Files - How to Fix the Steam "Corrupted Update Files" Error; Steam Logo on a Dark Background, Step-by-Step Guide and Solution

Steam Corrupted Update Files: 2-Minute Fix ⏳

October 13, 2025
Windows 11 Preview on Laptop: File Explorer in Dark Mode with a folder and magnifying glass; a woman using her PC at a home desk.

Windows 11 Preview: Mac-Style QuickLook with Space ⏱️

October 13, 2025
Lockdown Mode on iOS - Illustration of Lockdown Mode on iOS: Password field with asterisks and lock, fingerprint, and shield symbols, highlighting security and privacy on iPhone.

Lockdown Mode on iOS: Activate it NOW and secure your iPhone

October 8, 2025
Battlefield 6 Ultra++ PC requirements: Tanks, helicopters, and soldiers in mountainous desert combat, with a focus on performance and graphics.

Battlefield 6 Ultra++ PC Requirements: How to Get Them ⚡

October 8, 2025

Recent News

Steam Corrupted Update Files - How to Fix the Steam "Corrupted Update Files" Error; Steam Logo on a Dark Background, Step-by-Step Guide and Solution

Steam Corrupted Update Files: 2-Minute Fix ⏳

October 13, 2025
8
Windows 11 Preview on Laptop: File Explorer in Dark Mode with a folder and magnifying glass; a woman using her PC at a home desk.

Windows 11 Preview: Mac-Style QuickLook with Space ⏱️

October 13, 2025
7
Lockdown Mode on iOS - Illustration of Lockdown Mode on iOS: Password field with asterisks and lock, fingerprint, and shield symbols, highlighting security and privacy on iPhone.

Lockdown Mode on iOS: Activate it NOW and secure your iPhone

October 8, 2025
11
Battlefield 6 Ultra++ PC requirements: Tanks, helicopters, and soldiers in mountainous desert combat, with a focus on performance and graphics.

Battlefield 6 Ultra++ PC Requirements: How to Get Them ⚡

October 8, 2025
8
MasterTrend News logo

MasterTrend Info is your go-to source for technology: discover news, tutorials, and analysis on hardware, software, gaming, mobile devices, and artificial intelligence. Subscribe to our newsletter and don't miss any trends.

Follow us

Browse by Category

  • Gaming
  • Hardware
  • AI
  • Mobiles
  • News
  • Networks
  • Security
  • Software
  • Tutorials
  • Windows

Recent News

Steam Corrupted Update Files - How to Fix the Steam "Corrupted Update Files" Error; Steam Logo on a Dark Background, Step-by-Step Guide and Solution

Steam Corrupted Update Files: 2-Minute Fix ⏳

October 13, 2025
Windows 11 Preview on Laptop: File Explorer in Dark Mode with a folder and magnifying glass; a woman using her PC at a home desk.

Windows 11 Preview: Mac-Style QuickLook with Space ⏱️

October 13, 2025
  • About Us
  • Announce
  • Privacy Policy
  • Contact us

Copyright © 2025 https://mastertrend.info/ - All rights reserved. All trademarks are property of their respective owners.

Spanish Spanish
Spanish Spanish
English English
Portuguese Portuguese
French French
Italian Italian
Russian Russian
German German
Chinese Chinese
Korean Korean
Japanese Japanese
Thai Thai
Hindi Hindi
Arabic Arabic
Turkish Turkish
Polish Polish
Indonesian Indonesian
Dutch Dutch
Swedish Swedish
No result
See all results
  • English English
    • Spanish Spanish
    • Portuguese Portuguese
    • French French
    • Italian Italian
    • German German
    • Korean Korean
    • Japanese Japanese
    • Chinese Chinese
    • Russian Russian
    • Polish Polish
    • Indonesian Indonesian
    • Turkish Turkish
    • Hindi Hindi
    • Thai Thai
    • Arabic Arabic
    • Swedish Swedish
    • Dutch Dutch
  • Gaming
  • Hardware
  • AI
  • Mobiles
  • News
  • Networks
  • Security
  • Software
  • Tutorials
  • Windows

Copyright © 2025 https://mastertrend.info/ - All rights reserved. All trademarks are property of their respective owners.

Comment Author Info
:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
wpDiscuz
RedditBlueskyXMastodonHacker News
Share this:
MastodonVKWhatsAppTelegramSMSHacker NewsLineMessenger
Your Mastodon Instance