Skip to content

windows

# 查看 80 端口是否有使用
netstat -ano | findstr 0.0:80
# 查看 443 端口是否有使用
netstat -ano | findstr 0.0:443

Opening a tab or pane in the same directory in Windows-Terminal

# C:\Users\yu_da\.bash_profile

----------------------------------

# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc



PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"'


export JAVA_HOME=/c/Users/yu_da/.jdks/openjdk-17
export PATH=$PATH:$JAVA_HOME/bin

# C:\Program Files\PowerShell\7\Profile.ps1  (create file)

----------------------------------

function prompt {
  $loc = $($executionContext.SessionState.Path.CurrentLocation);
  $out = "PS $loc$('>' * ($nestedPromptLevel + 1)) ";
  $out += "$([char]27)]9;9;`"$loc`"$([char]27)\"
  return $out
}

function prompt
{
  $loc = Get-Location

  $prompt = & $GitPromptScriptBlock

  $prompt += "$([char]27)]9;12$([char]7)"
  if ($loc.Provider.Name -eq "FileSystem")
  {
    $prompt += "$([char]27)]9;9;`"$($loc.Path)`"$([char]7)"
  }

  $prompt
}

setx PROMPT "%PROMPT%"