I want to use Linux commands at the command prompt! Use Linux commands at the command prompt instead of Git Bash

background

Since Git is used on Windows, if you install Git for Windows, It came with something called Git Bash.

Git Bash allows you to type Linux commands on Windows. I used this because I thought it was convenient.

However, as I was using it, I got a little worried about it, so I changed the Linux commands that came with Git Bash so that they can be hit from the command prompt.

Caution In the first place, when installing Git for Windows, It seems that you can set the Git command to be used at the Command prompt. This article is for those who didn't make that setting. By the way, the OS is Windows 10.

Why you want to use command prompt instead of Git Bash

The reason why I wanted to operate at the command prompt.

Git Bash Subtly heavy

I just want to use it for a while, but in my environment I have to wait about 3 seconds. Only 3 seconds, but 3 seconds. It becomes stressful when piled up.

Command prompt is convenient to access

I'm touching Explorer and want to type a Grep command in this folder, At that time, if it is a command prompt, in the folder bar (I do not know the official name ...), Just type cmd to make that folder the current directory The command prompt will start. cmd.PNG

In Git Bash, start it up, wait a few seconds, type the cd command and it's finally started.

So, at the genuine Windows command prompt Try to use Linux commands.

The identity of the command

When I installed Git Bash A little supplement to why Linux commands can be used.

C:\Program Files\Git\usr\bin If you visit, you will find a lot of exe files.

This seems to be the true identity of the Linux command running from Git Bash. less.PNG

Familiar commands such as less.exe and ls.exe are lined up. Set environment variables so that you can run these files from the command prompt.

Setting environment variables

From the search window of the Windows Start menu Search by "Environment Variables"> "System Properties" Dialog> Environment Variables (I always forget how to open the environment variable dialog, so I've searched for an unforgettable method for this article. )

Opened earlier in PATH C:\Program Files\Git\usr\bin To add. git.PNG

Caution Some command names overlap with Windows commands. (Find commands etc. exist in both Windows and Linux.)

The point here is that when you execute such a command, If you want to give priority to Linux Make sure you bring Linux above % SystemRoot% \ System32.

Operation check

Check the operation with the ls command.

Microsoft Windows [Version 10.0.18363.900]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\karintoMania\Desktop\gitTest>ls
 test.PNG   text.txt

It seems to have worked.

Summary

I want to use the Linux commands that came with Git Bash at the command prompt → Add the command path to the environment variable.

In the next article, which Linux command did you want to use in the first place? I want to write something like that.

Recommended Posts

I want to use Linux commands at the command prompt! Use Linux commands at the command prompt instead of Git Bash
I want to use only the normalization process of SudachiPy
[Linux] I tried to summarize the command of resource confirmation system
I want to use Linux on mac
How to use the Linux grep command
I want to leave an arbitrary command in the command history of Shell
I want to customize the appearance of zabbix
I want to use Python in the environment of pyenv + pipenv on Windows 10
I want to crop the image along the contour instead of the rectangle [python OpenCV]
I want to be notified when the command operation is completed on linux!
I want to grep the execution result of strace
less command I want to definitely remember this [linux command]
Linux user addition, how to use the useradd command
I want to fully understand the basics of Bokeh
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
I want to automate ssh using the expect command!
I want to publish the product at the lowest cost
(Remember quickly) How to use the LINUX command line
I want to use the R dataset in python
I want to increase the security of ssh connections
The story of Linux that I want to teach myself half a year ago
linux / c> link> Get the execution result of the shell command in the C program> I was taught how to use popen ()
I want to use the latest gcc without sudo privileges! !!
I want to automate ssh using the expect command! part2
I want to get the operation information of yahoo route
[Python] I want to use the -h option with argparse
I want to judge the authenticity of the elements of numpy array
I want to know the features of Python and pip
Keras I want to get the output of any layer !!
I want to know the legend of the IT technology world
I want to get information from fstab at the ssh connection destination and execute a command
I want to get the name of the function / method being executed
I want to use shortcut translation like DeepL app on Linux
[Linux] I want to know the date when the user logged in
I want to read the html version of "OpenCV-Python Tutorials" OpenCV 3.1 version
I want to output the beginning of the next month with Python
Comparison of GCP computing services [I want to use it serverless]
[linux] kill command to kill the process
How to output the output result of the Linux man command to a file
I want to check the position of my face with OpenCV!
I used the worldcup command to check the outcome of the World Cup.
I want to know the population of each country in the world.
I want to revive the legendary Nintendo combination by making full use of AI and HR Tech!
I want to use complicated four arithmetic operations in the IF statement of the Django template! → Use a custom template
I want to use only the SMTP MAIL FROM command and RCPT TO command without sending mail with Python's smtplib
[Note] I want to completely preprocess the data of the Titanic issue-Age version-
I don't want to admit it ... The dynamical representation of Neural Networks
(Python Selenium) I want to check the settings of the download destination of WebDriver
I want to batch convert the result of "string" .split () in Python
I want to explain the abstract class (ABCmeta) of Python in detail.
I want to sort a list in the order of other lists
I want to use the Django Debug Toolbar in my Ajax application
I want to express my feelings with the lyrics of Mr. Children
I want to analyze the emotions of people who want to meet and tremble
I want to stop the automatic deletion of the tmp area with RHEL7
[Linux] Why do I, an infrastructure engineer, not use the "hostname" command?
I tried to summarize the umask command
I want to know how LINUX works!
I want to use jar from python
How to calculate Use% of df command
[Linux setting series] Prompt setting of bash. / prompt / bash / shell