当前位置:网站首页>Multipass Chinese document - use instance command alias
Multipass Chinese document - use instance command alias
2022-06-26 04:40:00 【But the teacher】
General catalogue ( To be translated and perfected )
1. overview
2. course
3. Directions for use
3.1 install Multipass
3.1.1 be based on Linux
3.1.2 be based on macOS
3.1.3 be based on Windows
3.2 Manage instances
3.2.1 Create examples
3.2.2 Modify instance
3.2.3 Using examples
3.2.4 Use the instance command alias
3.2.5 Share data with instances
3.2.6 Remove instance
3.3 management Multipass
3.3.1 Set the drive
3.3.2 Use Multipass Service authorization agent
3.3.3 Remote use Multipass
3.3.4 Improve mount performance
3.3.5 Use Packer pack Multipass Mirror image
3.3.6 Set image interface
3.3.7 Use different macOS terminal
3.4 Troubleshoot problems
3.4.1 Connection log
3.4.2 Network troubleshooting
Use the instance command alias
[ edition 1.8.0 And after ]
This document teaches how to create... In an instance , list , Execute and remove command aliases .
Content :
Create an alias
See also : alias
Use command alias Create an alias for an executable command on a specific instance . The following code uses this command to create an alias lscc, This alias will appear in the instance crazy-cat Middle execution command ls:
$ multipass alias crazy-cat:ls lscc
After executing this command , Alias lscc Will be defined in the instance crazy-cat On , And bind the execution command ls. If lscc Be deleted , The alias of the command is the default command ( This situation is ls).
Translation notes : I understand the meaning of this sentence is : lscc After the alias is deleted , ls The default alias for is ls, That is, you are your own command alias
Enumerate defined aliases
See also : aliases
Look at the list of aliases defined so far , Use aliases command :
$ multipass aliases
Alias Instance Command
lscc crazy-cat ls
Execute alias
There are two ways to execute aliases .
multipass <alias>
The first way to execute an alias is
$ multipass lscc
This will enter crazy-cat Example of shell, And implement ls, Then return to the host command line , Be similar to exec command
Parameters are also supported , use -- separation :
$ multipass lscc -- -l
<alias>
The second way to perform aliasing is a two-step process :
add to Multipass Alias script folder to system path
First , Add alias script folder to system path . The first time you create an alias , The guidance will be displayed automatically , Each platform displays differently . for example :
$ multipass alias crazy-cat:ls lscc
You'll need to add this to your shell configuration(.bashrc, .zshrc or so) for alias to work withour prefixing with `multipass`
PATH="$PATH:/home/user/snap/multipass/common/bin"
Linux
Linux Upper shell The configuration needs to be modified . In most Linux In the version , default shell yes bash, It can be in the user's home Directory through file .bashrc To configure . Any text editor can modify the file , for example :
$ nano ~/.bashrc
When editing a file , Add a new line at the end of the text as follows :
export PATH="$PATH:/home/user/snap/multipass/common/bin"
( Remember to change the folder to the correct folder in the above case command , And restart shell)/
In the use of zsh As shell In the scene , The files to be modified are .zshrc instead of .bashrc; The steps are the same .
macOS
stay MacOS On , Most commonly used shell yes zsh. Steps and... To add a folder to the system path Linux It's the same , As mentioned above
Windows
However , stay Windows On , A little complicated . To make the changes permanent , Need to use PowerShell Store old system paths , Add alias folder , And store the new path of the trace .
$old_path = (Get - ItemProperty - Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$new_path = "$old_path;C:\Users\<user>\AppData\Local\Multipass\bin"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $new_path
Don't forget to restart the terminal . The folder has now been permanently added to your path , Multipass You can now reference aliases to perform .
Execute alias
Once you add the alias folder to the system path , You can just ( No need to write multipass) The implementation is as follows :
$ lsccat alias definition time,
This command ( Path based has been added to the system path ) Equivalent to multipass lscc. And support parameters , And there's no need to --:
$lscc -l
Remove alias
See also :unalias
Last , Remove alias lscc, Issue commands :
multipass unalias lscc
️ When the instance is cleared (purged) When , Aliases will also be removed . That means ,
multipass delete crazy-cat --purgeThe alias will also be removedlscc.
Link to the original text
边栏推荐
- What is the best way to store chat messages in a database? [Close] - best way to store chat messages in a database? [closed]
- Laravel pay payment access process
- 202.2.9
- Install cenos in the virtual machine
- Gateway can not connect to tcp://127.0.0.1: Connection refused
- Laravel uses phpword to generate word documents
- A new paradigm for large model application: unified feature representation optimization (UFO)
- Condition query
- 记录一次循环引用的问题
- 微信小程序保存图片的方法
猜你喜欢

CDN with OSS acceleration

2022 talent strategic transformation under the development trend of digital economy

Text horizontal alignment attribute text align and element vertical alignment attribute vertical align

How to carry out word-of-mouth marketing for enterprises' products and services? Can word of mouth marketing be done on behalf of others?

Gateway can not connect to tcp://127.0.0.1: Connection refused
![[H5 development] 02 take you to develop H5 list page ~ including query, reset and submission functions](/img/39/64df931d5ec54d7d19ae444fa372ba.jpg)
[H5 development] 02 take you to develop H5 list page ~ including query, reset and submission functions

A new paradigm for large model application: unified feature representation optimization (UFO)

Advanced learning of MySQL (learning from Shang Silicon Valley teacher Zhou Yang)

1.20 learning summary

Modify the number of Oracle connections
随机推荐
Compiling and installing phpredis extension on MAC
Tp6 controller does not exist: app\index\controller\index
PHP syntax summary
22.2.8
条件查询
Is education important or ability important in software testing
CDN with OSS acceleration
Introduction to markdown grammar
2021/11/6-burpsuit packet capturing and web page source code modification
2020-12-18
LeetCode 94. Middle order traversal of binary tree
1.14 learning summary
Rdkit chemical formula molecular formula search
Numpy data input / output
Laravel framework Alipay payment fails to receive asynchronous callback request [original]
A troubleshooting of website crash due to high CPU
JWT token authentication verification
防撤回测试记录
Simple application of KMP
2022.2.11