Just A Moment

      19

Are you sick of typing ls instead of dir by accident on a command prompt when you’re using Windows? Are you sick of Windows telling you that the command you just tried is not recognized as an internal or external command, operable program or batch file?


You don’t need to suffer anymore, because DOSKEY is here và it allows you to create your own aliases in Windows.

Bạn đang xem: Just a moment

Create alias.cmd in %USERPROFILE% and showroom your aliases in said file, lượt thích so:


echo offDOSKEY alias=notepad %USERPROFILE%/alias.cmdDOSKEY ls=dir /WDOSKEY ll=dirDOSKEY ~=cd %USERPROFILE%DOSKEY touch=copy nul $* > nulDOSKEY clear=clsDOSKEY history=DOSKEY /hDOSKEY g=git $*DOSKEY d=docker $*DOSKEY k=kubectl $*NOTE: $* means every argument after the alias. Taking k from the example above, k get pods would be transformed into kubectl get pods.

Create add-autorun-alias.reg and add the following nội dung in the file:

Windows Registry Editor Version 5.00"AutoRun"="%USERPROFILE%\alias.cmd"The above will cause your alias.cmd khổng lồ run automatically every time command prompt starts.


assuming you remain on the same drive, i.e. No D: then cd D:somedir needed.

In my case, C: holds system files, but all work is on D:

2 parts. First set some working directories, using a batch file.

let"s say localprofile.cmd. You can have multiple ones of these, just run them as needed.

set wd1=D:homeworkfb440.dumperset wd2=D:homeworkpy estsnow use another command file to move around, based on those environment variables you just set.

wd.cmd

echo offd:if %1.==. Set | findstr wdif %1==1 cd %wd1%if %1==2 cd %wd2%if %1==3 cd %wd3%if %1==4 cd %wd4%if %1==5 cd %wd5%if %1==6 cd %wd6%And a bit of a sample use:

D:homein>wd 2D:homein>echo offD:homeworkpy ests>wd 1D:homeworkpy ests>echo offwd by itself is supposed to lớn show me the các mục of bookmarked directories. It works, but not sure why I am getting this "unexpected cd" message.

D:homeworkfb440.dumper>wdD:homeworkfb440.dumper>echo offwd1=D:homeworkfb440.dumperwd2=D:homeworkpy estscd was unexpected at this time.D:homeworkfb440.dumper> Regular .cmd batches

Aside from directory navigation, you can create a foo.cmd somewhere on your PATH and it can act much as an alias. Remember, unlike Linux/OSX shells, cmd files can affect environment variables và the session, without needing khổng lồ sourcethem.

I have a cdbin.cmd to lớn navigate me, for example:


Có thể bạn quan tâm

d:cd homeinAnd this is a pseudo-grep grep.cmd

findstr -n %1 %2in kích hoạt (whatever sort /+2 /+10 means)

D:homeworkfb440.dumper>grep class *.py | sort /+2 /+10

dumper2.py:18:class PrettySafeLoader(yaml.SafeLoader): dumper2.py:27:class Comparator(object): dumper2.py:3:class module_settings: linker2.py:5:class module_settings: dumper2.py:65:class DataCompProcessor(object): dumper2.py:69:class DataCompTextRenderer(DataCompProcessor): dumper2.py:76:class DataComparator(object):


Keytool is a không lấy phí command line tool that is added khổng lồ your system when you install Java.

If you want to build an android APK binary that can be distributed on the Play Store, you need to use keytool to lớn generate the SHA-1 fingerprint for your signing certificate.

This is a requiredstep when configuring the Firebase SDK for your game android (or Flutter) app.

This page on the official documentation explains how to lớn use keytool, but not how to install it.

So if you got stuck with this before, this article explains all the required steps.

sponsor

Code with Andrea is không lấy phí for everyone. Help me keep it that way by checking out this sponsor:


*

Build, manage, and grow in-app purchases. Glassfy provides an SDK that makes it simple khổng lồ build in-app subscriptions or one-time purchases. Glassfy offloads managing backend infrastructure & building paywalls so that you can focus on better monetizing your app or building other crucial parts of your product.

Ready? let"s go!

Getting the SHA-1 certificate fingerprint with keytool

This is how to use keytool to get the debug SHA-1 certificate fingerprint on Windows:

keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%.androiddebug.keystore


And this is the equivalent on macOS/Linux:

keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore

However, the commandsabove will only work if you have keytool already installed on your system, & it is included in your system PATH.

"keytool" is not recognized as aninternal or external command, operable program or batch file.

If this is not the case, you"ll be greeted with this message (on Windows):

"keytool" is not recognized as an internal or external command, operable program or batch file.

Xem thêm: Các Loại Tên Miền Là Gì? Các Loại Tên Miền Và Cách Thức Hoạt Động

Let"s fix this.

Install keytool on your system

Keytool is included as part of the Java runtime. So by installing Java, you"ll also have keytool in your system.

To install Java, visit the JAVA SE Downloads page.

Then,select the JDK download link.

This takes you to lớn a page called "Java SE Development Kit 15 Downloads".

Scroll khổng lồ the bottom, và you"ll find tải về links for Linux, macOS và Windows.

Java SE download linksJava SE download links

Download the correct installer (jdk-15.0.1_windows-x64_bin.exe on Windows, jdk-15.0.1_osx-x64_bin.dmg on macOS). Then follow the installation steps for your system & make a note of where this is installed (e.g. C:Program FilesJavajdk-15.0.1 on Windows).

Congratulations, the Java SDK is now installed onyour system.

Add the keytool folder to your system PATH (on Windows)

In order to run keytool from the command line, you need lớn add it to lớn your system PATH.

This step is required on Windows only, askeytool will is automatically installed on /usr/bin on macOS/Linux.

On the tìm kiếm box, type path, then mở cửa Edit the system environment variables (Control panel):

This opens the Advanced tab of the System Properties dialog:


From here, select Environment Variables..., which opens this dialog:

You"llsee that both the User variables & System variables have a Path variable. It doesn"t really matter which one you choose. For this example, we"ll edit the User variables one.

The next dialog shows the environment variables for the current user. Select New, then địa chỉ cửa hàng a new line pointing to lớn your jdk installation folder, with a trailing in at the end (e.g. C:Program FilesJavajdk-15.0.1in):

Then press OK and close all the dialogs, then xuất hiện a new command prompt.

Try running keytool. This time you should get thisoutput:

C:Userssalta>keytoolKey và Certificate Management ToolCommands: -certreq Generates a certificate request -changealias Changes an entry"s alias -delete Deletes an entry -exportcert Exports certificate -genkeypair Generates a key pair -genseckey Generates a secret key -gencert Generates certificate from a certificate request -importcert Imports a certificate or a certificate chain -importpass Imports a password -importkeystore Imports one or all entries from another keystore -keypasswd Changes the key password of an entry -list Lists entries in a keystore -printcert Prints the content of a certificate -printcertreq Prints the nội dung of a certificate request -printcrl Prints the nội dung of a CRL file -storepasswd Changes the store password of a keystore -showinfo Displays security-related informationUse "keytool -?, -h, or --help" for this help messageUse "keytool -command_name --help" for usage of command_name.Use the -conf url> option khổng lồ specify a pre-configured options file.

This confirms that keytool is installed & configured in your PATH.

Using keytool to generate te SHA-1

You"re now ready to lớn generate your SHA-1:

keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%.androiddebug.keystore

This will work, if you already have a keystore at the given location (%USERPROFILE%.androiddebug.keystore). If not you"llget this error:

keytool error: java.lang.Exception: Keystore file does not exist: C:Userssalta.androiddebug.keystorejava.lang.Exception: Keystore tệp tin does not exist: C:Userssalta.androiddebug.keystore at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:916) at java.base/sun.security.tools.keytool.Main.run(Main.java:422) at java.base/sun.security.tools.keytool.Main.main(Main.java:415)

If you don"t have a keystore, you"ll need to generate one with apk Studio. This document about phầm mềm signing on app android includes the information you need.

Conclusion

Phew! Getting keytool running on Windowsrequires a few steps, but we got there in the end.

hotlive |

https://hi88n.com/