替换命令 shell
Whether I fat-finger a command or my MacBook Pro keyboard's keys don't want to respond like they should, I'm frequently misspelling commands. What's more frustrating is that many of these commands are long, taking making fixing theme time-consuming.
不管我是用手指指命令还是MacBook Pro键盘的键都不想像应该的那样响应,我经常在拼错命令。 更令人沮丧的是,其中许多命令都很长,这使得修复主题非常耗时。
Luckily a , providing me a quick command for fixing the misspelled command:
幸运的是, ,为我提供了一个快速命令来修复拼写错误的命令:
~ $ crul davidwalsh.name-bash: crul: command not found~ $ ^crul^curlcurl davidwalsh.name301 Moved Permanently Moved Permanently
The document has moved here.
Apache Server at davidwalsh.name Port 80
The ^
command usage above returns fixes the spelling from the previous command, executes the command, and as a bonus, adds the correct command to history.
上面的^
命令用法返回结果可修复前一个命令的拼写,执行该命令,并作为奖励将正确的命令添加到历史记录中。
Small tips like these and make my command life experience so much better. What's your favorite command line trick?
像这样的小技巧和使我的命令生活变得更好。 您最喜欢的命令行技巧是什么?
翻译自:
替换命令 shell