Whether I fat-finger a 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.

Luckily a Twitter follower is looking out for me, providing me a quick command for fixing the misspelled command:


~ $ crul davidwalsh.name
-bash: crul: command not found
~ $ ^crul^curl
curl davidwalsh.name
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://davidwalsh.name/">here</a>.</p>
<hr>
<address>Apache Server at davidwalsh.name Port 80</address>
</body></html>


The ^ command 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 git checkout - make my command life experience so much better.  What’s your favorite command line trick?

  • Animating CSS3 Transforms with MooTools Fx
  • JavaScript Promise API

    While synchronous code is easier to follow and debug, async is generally better for and flexibility. Why “hold up the show” when you can trigger numerous requests at once and then handle them when each is ready?  Promises are becoming a big part of the JavaScript

  • CSS Fixed Position Background Image

    Backgrounds have become an integral part of creating a web 2.0-esque website since gradients have become all the rage. If you think gradient backgrounds are too cliche, maybe a fixed position background would work for you? It does provide a neat inherent effect by…

  • Form Element AJAX Spinner Attachment Using MooTools

    Many times you’ll see a form dynamically change available values based on the value of a form field. For example, a “State” field will change based on which Country a user selects. What annoys me about these forms is that they’ll often do an…





Source link
thanks you RSS link
( https://davidwalsh.name/replace-command-)

LEAVE A REPLY

Please enter your comment!
Please enter your name here