v
No standard Linux command is named 'v'
TLDR
Compile a file and output its executable
Compile the current project or directory
Compile a file and run it
Compile a file and run it, output its executable
Re-compile on every modification to a file
Re-run on every modification to a file
Open the v repl
Format a file and [w]rite to it
SYNOPSIS
v [options] [file ...]
PARAMETERS
-R
Opens the file in read-only mode, preventing accidental modifications. (Inherited from vi/vim)
+N
Starts the editor with the cursor positioned at line number N in the first file. (Inherited from vi/vim)
-c command
Executes the specified command after the first file has been read. This is useful for automating actions upon startup. (Inherited from vi/vim)
-b
Opens the file in binary mode. (Inherited from vi/vim)
file ...
Specifies one or more files to be opened for editing. If multiple files are provided, you can navigate between them within the editor. (Inherited from vi/vim)
DESCRIPTION
The command v is not a standard, standalone utility found in typical Linux distributions. Instead, it is most commonly encountered as a user-defined or system-defined alias for the vi (Visual editor) or vim (Vi IMproved) text editor. This alias is created for convenience, allowing users to type a shorter command to launch the editor. Without such an alias configured in the shell environment (e.g., in `~/.bashrc` or `/etc/profile`), executing `v` directly will typically result in a "command not found" error.
When aliased to `vi` or `vim`, `v` inherits all the functionality of that powerful, modal text editor, widely used for programming, system administration, and general text manipulation.
CAVEATS
The functionality of v is entirely dependent on how it is aliased on a specific system. It is not a native Linux command. If no alias is set, executing v will result in a 'command not found' error. Its behavior can vary significantly between different user setups or system configurations.
CHECKING `V`'S DEFINITION
To determine what v executes on your system, use the type command:
type v
This will typically show something like `v is aliased to 'vi'` or `v is aliased to 'vim'`, or if not aliased, it will state 'v not found'.
SETTING UP THE `V` ALIAS
Users can set up the v alias themselves by adding a line like
alias v='vi'
or
alias v='vim'
to their shell's configuration file (e.g., `~/.bashrc`, `~/.zshrc`). After saving the file, you'll need to source it (e.g., `source ~/.bashrc`) or restart your terminal for the changes to take effect.
HISTORY
The command v's widespread use as an alias stems directly from the prominence and ubiquity of the vi editor. vi was one of the earliest full-screen visual editors created for Unix systems in the late 1970s. Its successor, vim (Vi IMproved), developed in 1991, significantly extended vi's capabilities. Due to the high frequency of using these editors, system administrators and users often created the shorter alias 'v' for convenience, making it a de facto shorthand for launching the editor quickly.