grep usage issues in Windows under ADB command

Source: Internet
Author: User
Tags locale

Myself looking for a long, rookie I also finally found a software to solve this problem. Hope to help those who will use later.

The content has been found on the Internet. If you have any questions, you can leave a message. Solved together.

Cygwin: Baidu Cloud disk. Http://pan.baidu.com/s/1c0eXgNQ

Cygwin is a UNIX simulation environment that runs on the Windows platform and is the free software developed by Cygnus Solutions Corporation. It is for learning unix/linux operating environments, or porting applications from UNIX to Windows, or for some special development.

Cygwin the latest version of the 2.738 Local installation package, with detailed fool-style installation tutorials, designed for Android NDK customization, collection of make3.8.1, gcc3.4.4, with some basic commands, I close test success.

Beta version: ANDROID-NDK-R5

Installed on Windows, you can run Bash,vi,g

Cygwin Local Installation Installation tutorial:

1, double-click to run Cyg_win_setup.exe Installer installation, please install with the Administrator account (your computer's login user is administor identity)!! installation process, sometimes will stop, do not force off, not the crash, just slow down!

2. Select "Install from Local Directory" installation;

3, select the installation package is not recommended to choose, because the installation time is long, disk space is too large.

OpenSSL and openssh-------sshd service packs,
CYGRUNSRV------Cygwin Service Pack,
SED------Base category for easy use of Hadoop in eclipse
Vim---Editors category to make it easy to modify sub-profiles on Cygwin
Subversion------under the Devel category

4, configure environment variables, Java_home point to the JDK installation directory, the path path to add the JDK Bin directory, the JRE bin directory and Cygwin bin directory, usr sbin directory;


Variable name: CYGWIN, Variable value: Ntsec mintty (TTY not supported for tty1.17 version)
Or, instead of adding an environment variable, modify the Cygwin.bat file directly and add "set Cygwin=ntsec mintty" after @echo off. Not set to be entered when installing Ssh-host-config)

5. When modifying the. sh file, modify it using the VI command.

"After successful installation, note:"
1.
The first run of Cygwin produces the home/User name folder, under which three profiles are generated (c:\cygwin\home\ the current user). Bashrc,.bash_ Profile and. inputrc files, the most important of these three files is the. bashrc file, which is used later by the user to customize environment variables.

(using Cygwin Terminal to change its associated property option, information is generated in the. minttyrc file)

2).
Locale is to view the local encoding

Modify Cygwin encoding
Cygwin Chinese garbled:
Right---option---text--manually modify---Locale (zh-gn), Character set (GBK Chinese);

Fixed modification:
Cygwin setting Chinese
Cygwin\home\ User name \.BASHRC
# Let LS and dir command display Chinese and color
Alias ls= ' ls--show-control-chars--color '
Alias dir= ' Dir-n--color '
# Set the Chinese environment so that the hint becomes Chinese
Export lang= "ZH_CN. GBK "
# Output to Chinese encoding
Export output_charset= "GBK"

Cygwin\home\username\.inputrc
# You can enter Chinese
Set Meta-flag on
Set Output-meta on
Set Convert-meta off
# Ignore Case
Set Completion-ignore-case on

3).
For the cygwin1.71 version, cygwin= TTY is no longer supported!
If you have previously used this TTY environment variable, reinstalling the registry does not automatically update
Open Hkey_local_machine\system\currentcontrolset\services\sshd\parameters\environment, edit the value of the modified string " Modify the path to the execution program you are now Cygwin "

How to use Cygwin?

1, Cygwin use experience
a). Access Windows disk in Cygwin
Cd/cygdrive/c
CD C:

2.
. Consolidate Cygwin commands into Windows
Assuming that Cygwin is installed in D:/develop/cygwin, add D:/develop/cygwin/bin to the system variable path (preferably in front of windows, so that some of the same commands are executed with the Cygwin command first, Instead of Windows commands, such as Find)

You can execute the tar czvf xxx.tgz directly below the cmd.exe.
Basically all the commands are available, including ls,more,less,find,grep and so on.

3. Using tgz Backup
Add the Cygwin bin to the path
Build a BAT file:
@echo off
D:
CD D:\website\8thmanage
Tar czvf 8thmanage.tgz 8thmanage

4. Restore Cygwin shortcuts
For some reason, accidentally deleted the Cygwin shortcut, but could not find the original program location. A lot of people (including myself) were frustrated and simply cygwin the load. But Cygwin's hard-built development environment is gone. Wouldn't it hurt?

Here you'll find shortcuts to manually creating Cygwin.

(1) First of all, the shortcut to Cygwin is actually pointing to a batch file named Cygwin.bat, not the. exe file that you often see. In fact, the principle is the same, batch files and exe files are executable files, the difference is that the batch processing is rarely seen, and security defense software is usually the batch file as a problem program to delete.

(2) Find Cygwin installation folder, I installed in D:\cygwin, note that this file should be the real program storage location, this directory must have these folders: Bin, cygdriver, Dev, etc, home, lib ....

Now create the file "Cygwin.bat" in the directory just below (D:\cygwin), note: The suffix must be. bat.

Then edit the file, adding the following code to it:

@echo off
(This line is a space)
D:
ChDir D:\cygwin\bin
Set Lang=en_us.utf8
Bash–login-i

Finally, create a shortcut to the desktop for this file

Now that the work is basically done, the only thing that is not enough is the shortcut icon you just created is the icon for the batch file just now, not the one that was originally installed.

(3) in the folder (D:\cygwin) just found Cygwin.ico, it is this picture.

Now to the shortcut: Right-click the –> property –> Change the icon –> browse –> find cygwin.ico–> OK

6,. Command--help to view the help of this command;

File/directory permission settings command: chmod This is one of the most common commands used by Linux system administrators,
It is used to change the access rights of a file or directory. There are two ways to use this command: The syntax format of a text setting with letters and operator expressions: chmod [who] [opt] [mode] File/directory name where the WHO represents an object, is one or a combination of the following letters: U: Represents the file owner G: Represents the same group of users o: indicates another user A : Indicates that all user opt represents an action and can be: +: Add a permission-: cancel a permission =: give the given permission, and cancel the original permission.

grep usage issues in Windows under ADB command

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.