[Linux] Basic command summary

Move the cursor, etc.

Ctrl + f     //One character forward
Ctrl + b     //One character back
Ctrl + a     //Move to the beginning of the line
Ctrl + e     //Move to the end of line
esc + f      //One word forward * After pressing esc
esc + b      //One word back * After pressing esc
Ctrl + h     //Delete the character on the left
Ctrl + d     //Delete the character on the right
Ctrl + u     //Delete from the cursor position to the first line
Ctrl + k     //Delete from the cursor position to the end of the line
Ctrl + y     //Insert the last deleted content
Ctrl + c     //forced termination
Ctrl + s     //Screen display lock (Does not accept character input from the keyboard)
Ctrl + q     //Unlock screen display
Tab          //Complements commands and paths

Basic commands

ls [option][Directory file name]      //List display
$ ls *.php                             //Display a list with the extension php
$ ls /z???                             //Start with z
$ ls -l                                //View details
$ ls -F                                //Display file [email protected]:Symbolic link, *:Executable file,No sign:Normal file

mkdir [option] <Directory name to create>    //Directory creation
$ mkdir -p test/2020/10/10             // -Creates a directory at the same time as adding p
$ rmdir <Directory name>                 //Empty directory

cat [file path]                        //View the contents of the file

less [file path]                       //Scroll the contents of the file
Space bar, f                //Scroll down one screen
b                                      //Scroll up one screen
j                                      //Scroll down one line
k                                      //Scroll up one line
q                                      //q Exit command
/<String>                               //Search down
?<String>                               //Search upwards

touch [file name]                         //Create an empty file
rm    [option] [file name]                //Delete files and directories
$ rm -r dirr                           //Delete the contents of the directory at once

mv [file name 1][file name 2]              //Rename file
mv [file name][Destination directory name]   //Move files
* Behavior changes depending on whether the destination is a directory or a file

cp [Original][Copy to]
*It will be overwritten. If you do it safely-Add the i option.

find <Search start directory><Search conditions><action>
$ find . -name README.md -print 

Hard links and symbolic links

Hard link

-Give multiple names to one file ・ It does not disappear even if the original file is deleted. ・ Disappears when all hard links are gone

Symbolic link

-A special file with the path of the link destination // Shortcut etc. -If you delete or move the actual file while leaving the symbolic link, you will not be able to refer to it.

ln [option][Link source file][file name]
$ ln file1 file2              //Hard link without options
$ ln -s file1 file2

Recommended Posts

[Linux] Basic command summary
Linux command <Basic 2>
Linux command <Basic 1>
Linux basic command memorandum
Linux operation for beginners Basic command summary
Linux command # 3
Linux Summary
Linux command # 5
[Linux] User / group command summary
Linux command (basic in basic) personal memo
Linux command list
linux at command
[Linux] Search command
Linux [directory command]
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux [shell command]
Basic LINUX commands
[Linux] Command / Knowledge
My linux command
Linux command collection
Linux mkdir command
Linux command basics
[Linux] Git command
Docker command summary
Linux (command memory)
[Linux command summary] Command list [Must-see for beginners]
[Linux] Volume configuration command
Linux command cheat sheet
Linux command (sequential update)
Linux command [File operation]
Basic knowledge about Linux
OpenVPN Summary + Amazon Linux2
Basic Python command memo
Linux command for self-collection
linux command error collection 1
[Infrastructure] While command summary
Linux command line shortcut
Find, locate command summary
Image related command summary
[Copy and paste OK] Basic Linux command collection [18 selections]
linux sar command CPU usage
CLI and Linux basic terms
What is Linux? [Command list]
Linux a summary shortcut key
Summary of Linux distribution types
virtualenv Basic command usage memo
Easy df command on Linux
[Linux] [Initial Settings] [Flutter] Summary
Linux tar xz command memo
Basic usage of Pandas Summary
Linux Command Dictionary (for myself)
linux: create original Terminal command
[Note] Useful linux command collection
A brief summary of Linux
Linux command memorandum [for beginners]
Linux PC spec check command
[Learning memo] Django command summary
[Linux] [C / C ++] backtrace acquisition method summary
[Infrastructure] Linux command, shell script collection