Convenient Linux keyboard operation that I want to teach myself when I was in school

About this article

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.

environment

・ Mac ・ CentOS ・ Bash

Move the cursor without using the cursor keys

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)]

Move the cursor to the beginning / end

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

Move the cursor word by word

Sometimes you want to move the cursor word by word! !! !!

command Description
option + Move to the right
option + Move to the left

Delete one character you typed

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 the entered characters word by word

Delete word by word, not by character

command Description
ctrl + w Delete word by word

Cut (total cut) and yank (paste)

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)

Command history

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

Example of 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

Complementary function

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"

Finally

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.

Recommended Posts

Convenient Linux keyboard operation that I want to teach myself when I was in school
The story of Linux that I want to teach myself half a year ago
Log when I was worried that I could not connect to Wi-Fi on Linux
I want to be notified when the command operation is completed on linux!
I want to do something in Python when I finish
What I was addicted to when dealing with huge files in a Linux 32bit environment
Memo (March 2020) that I was addicted to when installing Arch Linux on MacBook Air 11'Early 2015
Automatically acquire the operation log in the terminal when logging in to Linux
A note I was addicted to when making a beep on Linux
I want to print in a comprehension
I want to use Linux on mac
I want to embed Matplotlib in PySimpleGUI
What I was addicted to when creating a web application in a windows environment
[Python] I want to know the variables in the function when an error occurs!
I want to create a priority queue that can be updated in Python (2.7)
A story that I was addicted to when I made SFTP communication with python
I want to pin Datetime.now in Django tests
I was able to recurse in Python: lambda
I want to create a window in Python
I want to store DB information in list
I want to merge nested dicts in Python
I want to log file I / O on Linux
I want to display the progress in Python!
A story that was convenient when I tried using the python ip address module
What I was addicted to when combining class inheritance and Joint Table Inheritance in SQLAlchemy
I want to use a network defined by myself in PPO2 of Stable Baselines
What I did when I was angry to put it in with the enable-shared option
I want to write in Python! (1) Code format check
I want to embed a variable in a Python string
I want to easily implement a timeout in python
I want to transition with a button in flask
I want to use self in Backpropagation (tf.custom_gradient) (tensorflow)
I want to write in Python! (2) Let's write a test
Even in JavaScript, I want to see Python `range ()`!
less command I want to definitely remember this [linux command]
I want to randomly sample a file in Python
I was addicted to scraping with Selenium (+ Python) in 2020
I want to work with a robot in python.
I want to write in Python! (3) Utilize the mock
A story that I was addicted to at np.where
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
When you want to plt.save in a for statement
I was able to repeat it in Python: lambda
I was addicted to trying logging.getLogger in Flask 1.1.x
I want to say that there is data preprocessing ~
I want to use the R dataset in python
What I was addicted to when using Python tornado
I want to manipulate strings in Kotlin like Python!
python> link> Mid-line comment in Python?> I was told that it's better to use named arguments.
Super easy molecular phylogenetic tree creation technique that I do not want to teach anyone
When I tried to install PIL and matplotlib in a virtualenv environment, I was addicted to it.
Useful operation when you want to solve all problems in multiple programming languages with Codewars
[Python3] Code that can be used when you want to resize images in folder units
The story I was addicted to when I specified nil as a function argument in Go