1. Use Powershell
Based on the difference between Windows and Mac system command line, you can use Powershell, Win10 system comes with Powershell, other systems can also be installed.
2. Open the command window
(1) Open the default mode: open the “Run” dialog box (Win+R), enter CMD to open the system default console command window, or enter Powershell to open the Powershell window.
② Open in target location: Hold down Shift in the blank area of the folder you want to open and right click the shortcut menu to see “Open command line window here” or “Open Powershell Window here”.
Enter the target folder
To change the drive letter, run the CD command, that is, change directory. If you want to access drive E, use CD E: or CD E:, which are case-insensitive and separated by Spaces.
② Change the folder: after CD, follow the folder path to enter, such as CD Notes /markdown, will enter the notes folder under the current location of the Markdown folder; Go back to the parent directory and use CD.. That is, go back to the Notes folder.
(3) You can also open the Powershell window and drag the target folder into the window to directly enter the target folder. This effect is the same as opening the Powershell window in the target location.
Create and delete
1 Create a folder: mkdir, that is, make directory. For example, use mkdir learn to create a folder named learn in the current location.
Remove directory. For example, use rmdir learn to delete the “learn” folder.
Create file: ni, that is, new item. For example, if you use ni command. Md, you can create a markdown file named Command in the current location.
4 Run the following command to delete a file: rm, that is, remove. For example, run the rm command.
Five, some common skills
(1) You can use the up and down arrow keys to view the used command, and press Enter to use the command.
② TAB can automatically complete the path, folder, or file name.
③ The PWD command (print working directory) can print the current working directory.
4 Run the ls command (list) to list the contents in the current path.
⑤ The CLS command (clear screen) can clear the screen of the command window.
Vi. Engineering of the project
On the project engineering command line, the most used is certainly NPM, but the domestic use of Taobao mirror CNPM, configuration methods can go to view here.
1. NPM init generates package.json files for managing dependency configurations.
–save-dev or –save depending on whether it is in the development environment (development time) or production environment (after live).
CNPM install sass –save-dev writes dependencies to devDependencies in package.json.
CNPM install vuex –save. In package.json, add dependencies to the dependencies node.
③ There is also a need for global installation such as: webpack installation, CNPM install webpack -g, need to add -g suffix, because it is equivalent to you install a global command.
In practical development we can use the shorthand: install can be shortened to I, –save-dev can be shortened to -s, –save can be shortened to -d.
The last
Of course, the above command line is only the tip of the iceberg, but the actual development of the common also those, I hope to give you some help, if there is wrong or omission of the place, also hope not hesitate to comment.