• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

sensible-editor: command not found

by Deepika

The sensible-editor command is a Linux command that opens the default editor set in the system. It is a part of the Debian/Ubuntu Linux distribution and is used to open the default text editor for the user.

When you run the sensible-editor command, it will automatically open the default text editor set in the system. This editor can be different for different users or systems. For example, on Ubuntu, the default text editor is set to nano while on Debian, it is set to vim.

The sensible-editor command is often used in scripts or configuration files where a text editor is needed. Instead of hardcoding the name of the editor, the sensible-editor command can be used to open the default editor, regardless of what it is.

For example, if you have a script that needs to open a configuration file for editing, you can use the sensible-editor command to open the file in the default editor:

# sensible-editor /path/to/config/file.conf

This will open the file /path/to/config/file.conf in the default editor set in the system.

You can also set the default editor by setting the VISUAL or EDITOR environment variable. For example, if you want to set the default editor to nano, you can add the following line to your .bashrc file:

# export VISUAL=nano

Then, running sensible-editor will open the nano editor.

If you encounter the below error while running the command sensible-editor:

sensible-editor: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install sensible-utils
Ubuntu apt-get install sensible-utils
Kali Linux apt-get install sensible-utils
Fedora dnf install sensible-utils
Raspbian apt-get install sensible-utils

sensible-editor Command Examples

1. Open a file in the default editor:

# sensible-editor file

2. Open a file in the default editor, with the cursor at the end of the file:

# sensible-editor + file

3. Open a file in the default editor, with the cursor at the beginning of line 10:

# sensible-editor +10 file

4. Open 3 files in vertically split editor windows at the same time:

# sensible-editor -O3 file_1 file_2 file_3

Filed Under: Linux

Some more articles you might also be interested in …

  1. aws-google-auth: Command-line tool to acquire AWS temporary (STS) credentials using Google Apps as a federated (Single Sign-On) provider
  2. corepack: Zero-runtime-dependency package acting as bridge between Node projects and their package managers
  3. “az storage queue” Command Examples
  4. How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7
  5. mktemp Command Examples in Linux
  6. “docker image” Command Examples
  7. How to install and Configure VNC (TigerVNC) server in CentOS / RHEL 7
  8. cgcreate: command not found
  9. clj: Clojure tool to start a REPL or invoke a specific function with data
  10. git hash-object: Computes the unique hash key of content and optionally creates an object with specified type

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright