Skip to content

Instantly share code, notes, and snippets.

@miranda-zhang
Last active April 2, 2019 05:24
Show Gist options
  • Save miranda-zhang/422929059e0df1a22f2b9fd35fa97a78 to your computer and use it in GitHub Desktop.
Save miranda-zhang/422929059e0df1a22f2b9fd35fa97a78 to your computer and use it in GitHub Desktop.
handy tips for windows

Windows Tips

Copy both the path and the file name to the clipboard

Shift key down and then right-click the file name, choose "copy as path".

Settings

Windows Key + i In cmd: systeminfo

IP

ipconfig
ipconfig/all

Port

netstat -abon | findStr "3000"

https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows

Kill a process, if you know the PID, then you can specify that, as in:

taskkill /pid 1234 /f

The "/f" is for "force".

https://stackoverflow.com/questions/49988/really-killing-a-process-in-windows

Linux on Windows

As of the Windows 10 "Anniversary" update (Version 1607), you can now run an Ubuntu subsystem from directly inside of Windows by enabling a feature called Developer mode.

To enable developer mode, go to Start > Settings then typing "Use developer features" in the search box to find the setting. On the left hand navigation, you will then see a tab titled For developers. From within this tab, you will see a radio box to enable Developer mode.

After developer mode is enabled, you will then be able to enable the Linux subsystem feature. To do so, go to Control Panel > Programs > Turn Windows features on or off > and check the box that says Windows Subsystem for Linux

https://stackoverflow.com/a/39538685/646732

After your computer restarts, open the Microsoft Store from the Start menu, and search for “Linux on Windows” in the store. Click “Get” i.e. on "Ubuntu".

https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/

files location

For example C drive is in /mnt/c/

cp /mnt/c/Users/admin-u5214628/Documents/w3id.org/cocoon/.htaccess .

https://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/

Environment Variable

Set a persistent environment variable from cmd.exe

Help page: setx /?

Example:

setx isDev "true"

Test in another cmd: set isDev To see all environment variable: set | more

SETX may truncate your variable length to 1024 char, very dangerous when manipulating %path% !

https://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe

shortcuts

media player

Shortcut	Action
Ctrl + P	Play/Pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment