문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
windows:powershell [2018/01/13 16:22] kwon37xi [Windows Powershell] |
windows:powershell [2019/11/27 09:51] kwon37xi |
||
---|---|---|---|
줄 2: | 줄 2: | ||
* https:// | * https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | ===== 기본 개인 profile 파일 ===== | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | New-Item $profile -force -itemtype file | ||
+ | </ | ||
+ | * '' | ||
===== Powershell Core ===== | ===== Powershell Core ===== | ||
* [[https:// | * [[https:// | ||
* Powershell Core는 Linux와 Mac 까지 지원한다. | * Powershell Core는 Linux와 Mac 까지 지원한다. | ||
+ | ===== sudo ===== | ||
+ | * [[windows: | ||
+ | |||
+ | ===== Color ls ===== | ||
+ | * [[https:// | ||
+ | * [[windows: | ||
+ | * '' | ||
+ | # for colored ls | ||
+ | Import-Module Get-ChildItemColor | ||
+ | |||
+ | Set-Alias ls Get-ChildItemColor -option AllScope | ||
+ | Set-Alias ll Get-ChildItemColorFormatWide -option AllScope | ||
+ | </ | ||
===== 명령창 없이 명령 실행하기 ===== | ===== 명령창 없이 명령 실행하기 ===== | ||
줄 16: | 줄 36: | ||
===== Consoles ===== | ===== Consoles ===== | ||
* [[http:// | * [[http:// | ||
+ | * [[https:// | ||
+ | * https:// | ||
+ | |||
+ | ===== process 목록 ===== | ||
+ | <code sh> | ||
+ | ps *foo* | ||
+ | get-process | findstr foo | ||
+ | get-process | where ProcessName -like " | ||
+ | </ | ||
+ | |||
+ | ===== 환경변수 Environment Variable ===== | ||
+ | * [[https:// | ||
+ | < | ||
+ | #값 읽기 | ||
+ | $Env:< | ||
+ | $Env:PATH | ||
+ | |||
+ | # 값 지정 | ||
+ | $Env:< | ||
+ | |||
+ | $Env:path = $env:path + "; | ||
+ | Set-Item -Path Env:Path -Value ($Env:Path + "; | ||
+ | |||
+ | # 환경변수 목록 | ||
+ | Get-ChildItem Env: | ||
+ | </ | ||
+ | |||
+ | ===== 기본명령 ===== | ||
+ | * 디렉토리 삭제< | ||
+ | Remove-Item [dirname] -Force | ||
+ | </ | ||
+ | * Symoblic Link< | ||
+ | # 관리자 권한 필요 | ||
+ | New-Item -ItemType SymbolicLink -Name MySymLinkFile.txt -Target $pshome\profile.ps1 | ||
+ | New-Item -ItemType SymbolicLink -Path C: | ||
+ | </ | ||
+ | * grep 대체 [[https:// | ||
+ | # 문자열 filter | ||
+ | " | ||
+ | # *.xml 파일들에서 문자열 탐색 | ||
+ | Select-String -Path " | ||
+ | |||
+ | # 매칭이 안되는 부분 찾기 | ||
+ | Select-String -Path " | ||
+ | </ | ||
+ | * rename - [[https:// | ||
+ | Rename-Item -Path old_name -NewName new_name [-Force] | ||
+ | </ | ||
+ | ===== curl ===== | ||
+ | * [[linux: | ||
+ | * '' | ||
+ | remove-item alias:curl | ||
+ | </ | ||
+ | |||
+ | ===== wget ===== | ||
+ | * '' | ||
+ | |||
+ | <code sh> | ||
+ | wget http:// | ||
+ | </ | ||
+ | |||
+ | ===== tail ===== | ||
+ | 마지막 1000 줄 보여주면서 계속 출력하기 | ||
+ | |||
+ | <code sh> | ||
+ | Get-Content 파일경로 -Wait -Tail 1000 | ||
+ | </ | ||
+ | |||
+ | ===== alias ===== | ||
+ | < | ||
+ | # vi 를 vim.exe 실행하는 것으로 alias 걸기 | ||
+ | set-alias -name vi -value vim.exe | ||
+ | </ | ||
+ | |||
+ | ===== Timezone ===== | ||
+ | * [[https:// | ||
+ | |||
+ | < | ||
+ | Set-TimeZone -Id "Korea Standard Time" | ||
+ | </ | ||
+ | ===== 참조 ===== | ||
+ | * [[https:// | ||