2017-10-24 21:41:53 +05:30
|
|
|
# code
|
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
> Cross platform and extensible code editor.
|
2025-05-11 15:08:12 +01:00
|
|
|
> More information: <https://code.visualstudio.com/docs/configure/command-line>.
|
2017-10-24 21:41:53 +05:30
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
- Start Visual Studio Code:
|
2017-10-24 21:41:53 +05:30
|
|
|
|
|
|
|
`code`
|
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
- Open specific files/directories:
|
2017-10-24 21:41:53 +05:30
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
`code {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
2017-10-24 21:41:53 +05:30
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
- Compare two specific files:
|
2017-10-24 21:41:53 +05:30
|
|
|
|
2025-05-11 15:08:12 +01:00
|
|
|
`code {{[-d|--diff]}} {{path/to/file1}} {{path/to/file2}}`
|
2017-12-18 11:26:49 +01:00
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
- Open specific files/directories in a new window:
|
2017-12-18 11:26:49 +01:00
|
|
|
|
2025-05-11 15:08:12 +01:00
|
|
|
`code {{[-n|--new-window]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
2018-12-03 23:18:25 +08:00
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
- Install/uninstall a specific extension:
|
2022-01-27 18:12:15 +01:00
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
`code --{{install|uninstall}}-extension {{publisher.extension}}`
|
2022-01-27 18:12:15 +01:00
|
|
|
|
2025-05-11 15:08:12 +01:00
|
|
|
- Display diagnostic and process information about the running code window:
|
2018-12-03 23:18:25 +08:00
|
|
|
|
2025-05-11 15:08:12 +01:00
|
|
|
`code {{[-s|--status]}}`
|
2020-06-20 17:27:01 +02:00
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
- Print installed extensions with their versions:
|
2020-06-20 17:27:01 +02:00
|
|
|
|
2022-04-16 12:42:11 +10:00
|
|
|
`code --list-extensions --show-versions`
|
|
|
|
|
|
|
|
- Start the editor as a superuser (root) while storing user data in a specific directory:
|
|
|
|
|
2022-07-13 14:55:50 -05:00
|
|
|
`sudo code --user-data-dir {{path/to/directory}}`
|