当前位置:网站首页>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
边栏推荐
- Sort query
- JWT token authentication verification
- SixTool-多功能多合一代挂助手源码
- 08_SpingBoot 集成Redis
- Compiling and installing phpredis extension on MAC
- Your requirements could not be resolved
- LISP programming language
- Simple application of KMP
- Is education important or ability important in software testing
- 企业的产品服务怎么进行口碑营销?口碑营销可以找人代做吗?
猜你喜欢

How to use the configured slave data source for the scheduled task configuration class scheduleconfig
![Laravel framework Alipay payment fails to receive asynchronous callback request [original]](/img/a7/139604ec3a977f2a4e96f392e56602.jpg)
Laravel framework Alipay payment fails to receive asynchronous callback request [original]
![PHP design function getmaxstr to find the longest symmetric string in a string - [original]](/img/45/d8dae9e605a2f411683db7a2d40d0b.jpg)
PHP design function getmaxstr to find the longest symmetric string in a string - [original]

Install Damon database

Sixtool- source code of multi-functional and all in one generation hanging assistant

OSS CDN alicloud configuration method

Navicat connects the pit of shardingsphere sub table and sub library plug-ins

2021-01-31

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

Your requirements could not be resolved
随机推荐
digital image processing
mysql高级学习(跟着尚硅谷老师周阳学习)
做软件测试学历重要还是能力重要
2022.1.23
2021-01-31
[H5 development] 02 take you to develop H5 list page ~ including query, reset and submission functions
LeetCode 94. Middle order traversal of binary tree
Motivational skills for achieving goals
Physical design of database design (2)
2022.2.17
Install cenos in the virtual machine
22.2.8
PHP installation SSH2 extension
基础查询
Problem follow up - PIP source change
Nabicat connection: local MySQL & cloud service MySQL and error reporting
An unexpected attempt (Imperial CMS list template filters spaces and newlines in smalltext introduction)
Numpy data input / output
LISP programming language
NVM installation and use and NPM package installation failure record