![]() Well, in any case, all you have to do is press Ctrl + C. How many times did it happen when you wanted to stop the command execution and you had no idea how to do it and ended up closing the terminal itself? Ctrl +C: Stop the current process/execution Yes, it is different than the clear command as it removes the history and you will find the execution of the clear command in the command history.īut when you press Ctrl + L, it just declutters your current screen and you won't find it inside of the history (as it is not a command itself).įor example, here, I executed the history command and then pressed the Ctrl + L key to clear the screen: clear terminal screen in Linux using Ctrl+L 7. It does not clear the terminal screen in a true manner but declutters the screen and if you scroll up, you will still find the previous command and execution history. Ctrl + L: Clear terminal screen (kind of) When you press the Ctrl + W key, it will only remove a single word before the cursor: Delete single word before the cursor in Linux terminal by pressing Ctrl + WĦ. This is what I use daily as I often mistype commands and want to remove one part of the command for that, you can simply press the Ctrl + W. Ctrl + W: Delete a single word before the cursor To use this shortcut, first, you have to place your cursor from where you want to remove text to the end and then press the Ctrl + K as shown here: Delete text from the cursor to the end in Linux terminal using Ctrl + K 5. Ctrl + K: Delete from the cursor to the endĪs you can guess from the title, when you press the Ctrl + K, it will remove everything from the cursor to the end of the line (everything from the cursor position to the right-hand side). In that case, all you have to do is use the left arrow keys to place the cursor from where you would like to delete to the start of the line and then press Ctrl + U : Use Ctrl+U to delete from the cursor to the beginning of the lineĮntering the account password with sudo command and unsure whether you typed it correctly? Instead of pressing backspace all the way, just use Ctrl+U keyboard shortcut and start typing the password again. There are times when you want to remove everything from the cursor position to the beginning of the line. Ctrl + U: Delete from the cursor to start In the following example, I used a sample text and pressed Ctrl + E to get to the end of the line: Go to the end of the line in linux terminal using Ctrl + E 3. While using the terminal if you want to jump to the end of the line, you can simply press the Ctrl + E and it will do the job. here, I've demonstrated how you can press the Ctrl + A anywhere and it will shift you to the beginning of the line: Go to the beginning of the line in Linux terminal using Ctrl + A shortcut 2. When you press the Ctrl + A, it will shift the cursor to the beginning of the file which can be really helpful when you write a long command and want to make changes at the beginning of the line.įor example. Now, let's have a look at them individually. You don't have to press Shift+a key to get the uppercase A. I mean Ctrl+A means pressing Ctrl and the A key together. Though I have used the capital letters, you don't have to type them in caps. Show the next command (from the command history).Īuto-complete commands, files, or directories. Show the previous command (from the command history). Search command history (backward search). Pause the current process (can be resumed). So in this tutorial, I will walk you through the top terminal shortcuts with examples of how to use them.īefore I explain all the shortcuts individually, here's a cheat sheet of what I'll be discussing in this tutorial: Shortcutĭelete from the cursor to the start of the line.ĭelete from the cursor to the end of the line. ![]() You have no idea how helpful they are until you know how to use them to make your terminal sessions super productive. Sure, learning the Linux commands should always be your priority but once you get a grip on the command line, there's one other thing you should focus on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |