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
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 type@: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
-Give multiple names to one file ・ It does not disappear even if the original file is deleted. ・ Disappears when all hard links are gone
-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