From 889c6c19078ecf4655358c25852facd24171b9b0 Mon Sep 17 00:00:00 2001 From: TaurusXin Date: Wed, 16 Oct 2024 10:35:18 +0800 Subject: [PATCH] fix: touch --- content/post/080.terminal/index.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/content/post/080.terminal/index.md b/content/post/080.terminal/index.md index a532a60..cbfd35d 100644 --- a/content/post/080.terminal/index.md +++ b/content/post/080.terminal/index.md @@ -201,13 +201,10 @@ Set-PSReadlineKeyHandler -Key "Ctrl+d" -Function ViExit # 设置 Ctrl+z 为撤销 Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo -# 使用 ls 和 ll 查看目录 -function ListDirectory { - (Get-ChildItem).Name - Write-Host("") +# 使用 ll 查看目录 +function ll { + Get-ChildItem } -Set-Alias -Name ls -Value ListDirectory -Set-Alias -Name ll -Value Get-ChildItem # 设置向上键为后向搜索历史记录 Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward @@ -215,8 +212,15 @@ Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward # 设置向下键为前向搜索历史纪录 Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward -# rm alias -Set-Alias rmrf "Remove-Item -Force -Recurse" +# rm -rf alias +function rmrf ($dir_path){ + Remove-Item -Recurse -Force $dir_path +} + +# mv alias +function mv($file_path, $des_name) { + Move-Item -Path $file_path -Destination $des_name +} # touch alias function touch {