This article experiences the use of Git bash on the Windows operating system.
What is bash?
is a shell environment, Bourne Again shell abbreviation.
install git for Windows
→http://git-for-windows.github.io/
→download, choose a suitable version
→ Installation
→ After installation there are git Bash, git CMD, and git GUI this three application
→ Run git Bash to check the current version
git version
→ Exit
Exit
Installing notepad++
→notepad-plus-plus.org
→download, choose the right version
→ Installation
Open notepad++ in bash
→ Find the notepad++ application file
In C:\Program files (x86) \notepad++, the C:\Program files (x86) \notepad++ are generally assigned
→ Right Click "My Computer", click "Advanced System Settings", click "Environment variable", double-click Path, put; C:\Program Files (x86) \notepad++ add to the end, click "OK"
→ Run git Bash
→notepad++
This will open the notepadd++ in bash.
Show view current directory
→ Run git Bash
→ View current directory
Pwd
Display/c/users/darren, where/c/is equivalent to C \,
→ List all files under the current folder
Ls
Or
Ls-l
Replace current directory
→ Run git Bash
→ Navigate to a different directory
CD videos/
→ Back to upper level
Cd..
→ Navigate to My Documents directory
CD my\ documents/
→ Return to Level Three
Cd.. /.. /.. /
→ Back to home directory
CD ~
→ Navigate to a directory on an absolute location
cd/c/windows/system32/
View command Source
→ View the source of the LS command
Whick ls
Show/bin/ls
Show Print
→ Show print environment variables
Echo $PATH
View File Contents
→ View a file content
Cat Test.txt
→ View a file content and edit
Less test.txt
Create, rename, move, delete files
→ Create an empty file
Touch Demo.txt
→ Rename a file
MV Demo.txt Demo-1.txt
→ Delete known files
RM demo-1.txt
Create, delete directory
→ Create a directory
mkdir projects
→ Delete Directory
RMDIR projects
→ create multi-level catalogs
mkdir projects/client-a/awesome-web-project/
→ Delete multi-level catalogs
RM-RF projects/
emptying and exiting
→ Clear contents
Clear
→ Exit the console
Exit
console Print information output to file
→ Print information output append to create file
echo "HI" >> demo.txt
→ print information input rewrite known file
echo "Hello" > Demo.txt
Execute bash Script
→ See where bash is installed
Which bash
Display:/bin/bash
→ Create an open file with notepad++
notepad++ example.sh
→ input Command
#!/bin/bash
echo "Hi, everyone"
Using Git Bash for Windows