Command-line Basics some nouns
- "Graphical Interface"
- "Command Line"
- Terminal
- "shell"
- "bash"
Installation use
- Windws: Install git, open Gitbash
- Linux Open Terminal
- MAC Open Terminal
Basic command View current full path
pwd
View files in the current directory
# 不包括隐藏文件ls# 查看当前目录下所有文件(包括隐藏文件)ls -a# 查看当前目录下所有文件(包括隐藏文件)的详细信息ls -al
Switch directories
cd /c/projectcd codecd ../csscd ~/Desktop
File Operations Create files
touch readme.md
deleting files
#创建readme.mdrm readme.md #删除node_modules文件夹,不提示rm -rf node_modules
Renaming files
mv readme.md README.md
Create a folder
mkdir projects
File path root directory
cd /
Home Directory
cd ~pwd
Current directory
cd bookscd ./books
Parent Directory
cd ..cd ../css
Editor vim
Edit mode
Command mode
vim a.mdInitial Entry into Editor command mode
iEnter edit mode
- A can also be added
- The upper left corner of the keyboard
esc enters command command mode
:wqSave exit
:q!Do not save forced exits
Installing the server
npm install -g http-serverhttp-server
如果按照这种方式一致报错
解决方案为 加上sudo执行:
即:sudo npm install -g http-server
按回车 输入机器密码即可
Login to the development machine
#passwd: xxxxx
File permissions
chmod 777 index.htmlchown -R git:git even
The most likely issue in command-line operations
- Bad case
- Blank Space for writing leaks
- Take multiple commands as a command
Linux Command line Basics