Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Shell Command 2New to Visual Studio Code? Get it now.
Shell Command 2

Shell Command 2

Smart DEV

|
145 installs
| (0) | Free
Execute a shell command on the editor selected text
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

shell-command README

A VSCode extension that allow user to run shell commands on selected text in the editor.

Features

  • You can call any command that is available in your shell.
  • You can run a command when selecting nothing, the command output will be print at the pointer (side effect).
  • The previously ran command is remembered, so that you don't have to enter again.
  • If you execute some commands frequetnly, you can create a shortcut for it, pass the command line to be executed as "command" argument.
    • Ctrl-Shift-P > Keyboard shortcut JSON
    • Add a new entry like below, replace "key" with the key you want and "command" with command you want to execute.
    {
      "key": "alt+t",         // whatever you want for a keybinding
      "command": "shell-command.execute",
      "args": {
        "command": "gawk -F' ' '{print $9 \"\t\t\t\" $5}'"
      }
    }
  • Some examples of how to use the tool is shown below:

Sed command example (filter line)

example sed filter

Sort command example

sort command example

Gawk command example

gawk command example

Requirements

The command you want to run must be available in your shell.

Release Notes

1.0.0

Initial release.

Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

  • Extension Guidelines
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft