</p>
Today I thought on sharing with you some bash command line tricks to help improve your productivity and help you earn a few geek points</em></p>
This tricks will help you a lot and helps you to extent your keyboard live by saving a few hundredth strokes</p>
we will dive into the bash history secrets and the ! (bang) command:</p>
- !!</strong>
This bang command, when entered into the bash shell will run the previous command. It basically does the same thing as hitting the up arrow and hitting enter.</li>
</ul>- !command</strong>
Ex: !ls
This will run the last command that started with ‘ls’.</li>
</ul>- !command:p</strong>
Ex: !ls:p
This will display the command instead of running it.</li>
</ul>- !$</strong>
Ex: !$ or echo !$
The last word of the previous command. This the same as hitting Esc + . and is mainly useful for substitutions.</li>
</ul>- !$:p</strong>
Instead of running the last word of the previous command this will print it out.</li>
</ul>- !*</strong>
Runs the previous command without the first word.</li>
</ul>- !*:p</strong>
This will print the previous command without the first word.</li>
</ul>- Ctrl + r</strong>
Hit Ctrl + r and start typing, bash will search and show you the last command you rand that satisfies the search text you typed</li>
</ul>- Ctrl + s</strong>
Everything you type will not be shown</li>
</ul>- Ctrl + q</strong>
Inverts the effect of Ctrl + s, now everything is shown</li>
</ul>- Ctrl + a</strong>
Goes to the beginning of the line</li>
</ul>- Ctrl + e</strong>
Goes to the end of the line</li>
</ul>- Ctrl + w</strong>
Deletes the previous word</li>
</ul>- Esc + Esc</strong>
word compellation, it's the same as hitting tab</li>
</ul>- Esc + backspace</strong>
Deletes until finding a delimiter, if hitting Esc + backspace on file.txt the .txt will be deleted</li>
</ul></p>
What are your favorite command line tricks ?
</p>
- Esc + backspace</strong>
- Esc + Esc</strong>
- Ctrl + w</strong>
- Ctrl + e</strong>
- Ctrl + a</strong>
- Ctrl + q</strong>
- Ctrl + s</strong>
- Ctrl + r</strong>
- !*:p</strong>
- !*</strong>
- !$:p</strong>
- !$</strong>
- !command:p</strong>
- !command</strong>