When creating a portfolio, I think that there are many people who are ** only learning frameworks and not so much studying Linux **.
However, ** Linux is closely involved in development. ** ** When I was just learning programming without knowing that, I was silently creating a portfolio without knowing the efficiency of Linux and the "L" of Linux. This is an article ** that describes convenient Linux keyboard operations to improve development efficiency, for yourself and those who are planning to develop from now on when you attended such a past school.
・ Mac ・ CentOS ・ Bash
If you should type Linux
but mistakenly type Linx
, you want to move the cursor using ← → (cursor key), right?
However, the ** cursor key is located in the lower right corner, and it is far from the home position, so the cursor cannot be moved smoothly. ** **
$ echo Linx
In such a case, move the cursor with ctrl
+ f
or b
.
command | Description |
---|---|
ctrl + f |
forward [cursor forward (to the right)] |
ctrl + b |
back [Cursor back (to the left)] |
It's annoying to move the cursor back character by character to the very end or the beginning of such a long command like an idiot! !! !! !! Here are some useful commands! !! !!
$ git log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold green)%d%C(reset)' --abbrev-commit --date=relative --all
command | Description |
---|---|
ctrl + a |
Move the cursor first |
ctrl + e |
Move the cursor to the end |
Sometimes you want to move the cursor word by word! !! !!
command | Description |
---|---|
option + → |
Move to the right |
option + ← |
Move to the left |
It's okay to delete the characters you typed with backspace
, but using this key will cause a large deviation from your home position. So at that time ...
command | Description |
---|---|
ctrl + h |
Delete the character after the cursor position |
ctrl + d |
Delete the character at the cursor position |
Delete word by word, not by character
command | Description |
---|---|
ctrl + w |
Delete word by word |
command | Description |
---|---|
ctrl + k |
Cut from the cursor position to the end of the line (cut) |
ctrl + u |
Cut from the cursor position to the beginning of the line (cut) |
ctrl + y |
Paste the last cut out (Yank) |
Can be used when you want to use a command entered in the past again
command | Description |
---|---|
↑ key | To the previous command history |
↓ key | To the next command history (when looking at the command history from the past) |
ctrl + r |
Search history |
ctrl
+ r
When searching for the same command used in the past
① Press ctrl
+ r
(2) Enter a part of the command name you want to use (ʻecho in this case) ③ If found, execute the command with ʻEnter
(reverse-i-search)`':
↓
(reverse-i-search)`echo': echo hello world
When you type the command ʻecho`, it's annoying to enter it to the end, right? In such a case, press the Tab key to complete the remaining characters.
$ec → Press the Tab key
$echo → Automatically complements the remaining "ho"
It's difficult to remember all the operations suddenly, so if you think that you can do something ** "Oh? This operation is really annoying ..." **, I think you can usually solve it. Please check this article or check it out on your own to improve the efficiency of development.