Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* コマンド履歴 Get-History他 [#m01c3875]
*** 直近N回 [#w93e4173]
history -Count 3
*** ユニーク [#f598c0a8]
history | select -Unique
*** 検索 [#l52df391]
history | ? CommandLine -like "cd"
- なお、history | grep cd のようなこともできるが、Idが消...
*** コマンド入力中の検索 [#l03b0e0f]
Key Function Description
--- -------- -----------
UpArrow PreviousHistory 履歴の前の...
DownArrow NextHistory 履歴の次の...
Alt+< BeginningOfHistory 履歴の最初...
Alt+> EndOfHistory 履歴の最後...
Ctrl+g Abort 現在の操作...
Ctrl+n HistorySearchForward 履歴を順方...
NextHistor...
Ctrl+o AcceptAndGetNext 現在の行を...
Ctrl+p HistorySearchBackward 履歴を逆方...
PreviousHi...
Ctrl+r ReverseSearchHistory 履歴を対話...
Ctrl+s ForwardSearchHistory 履歴を対話...
Alt+r RevertLine すべての編...
Escape,r RevertLine すべての編...
- よく使うのはctrl-r
- すでにコマンドをタイプしている状態で検索する場合はctrl-p
- 上カーソルキーで、過去のコマンドをたどれる
- この機能はPSReadLineによって提供されている
*** 履歴のコマンドを実行する [#qfd0ed2e]
PS> history
Id CommandLine
-- -----------
1 dir
2 cd temp
3 notepad 1.txt
4 start .
PS> Invoke-History 3
もしくは
PS> r 3
- notepad 1.txtが実行される
*** 履歴のクリア [#e50e1995]
Clear-History
** 参考 [#a4e6c223]
https://technet.microsoft.com/en-us/library/ee176849.aspx
終了行:
* コマンド履歴 Get-History他 [#m01c3875]
*** 直近N回 [#w93e4173]
history -Count 3
*** ユニーク [#f598c0a8]
history | select -Unique
*** 検索 [#l52df391]
history | ? CommandLine -like "cd"
- なお、history | grep cd のようなこともできるが、Idが消...
*** コマンド入力中の検索 [#l03b0e0f]
Key Function Description
--- -------- -----------
UpArrow PreviousHistory 履歴の前の...
DownArrow NextHistory 履歴の次の...
Alt+< BeginningOfHistory 履歴の最初...
Alt+> EndOfHistory 履歴の最後...
Ctrl+g Abort 現在の操作...
Ctrl+n HistorySearchForward 履歴を順方...
NextHistor...
Ctrl+o AcceptAndGetNext 現在の行を...
Ctrl+p HistorySearchBackward 履歴を逆方...
PreviousHi...
Ctrl+r ReverseSearchHistory 履歴を対話...
Ctrl+s ForwardSearchHistory 履歴を対話...
Alt+r RevertLine すべての編...
Escape,r RevertLine すべての編...
- よく使うのはctrl-r
- すでにコマンドをタイプしている状態で検索する場合はctrl-p
- 上カーソルキーで、過去のコマンドをたどれる
- この機能はPSReadLineによって提供されている
*** 履歴のコマンドを実行する [#qfd0ed2e]
PS> history
Id CommandLine
-- -----------
1 dir
2 cd temp
3 notepad 1.txt
4 start .
PS> Invoke-History 3
もしくは
PS> r 3
- notepad 1.txtが実行される
*** 履歴のクリア [#e50e1995]
Clear-History
** 参考 [#a4e6c223]
https://technet.microsoft.com/en-us/library/ee176849.aspx
ページ名: