author: “Big Data Zen”
Column introduction: This column mainly shares Linux technology, will involve common Linux command operation, common service applications and related operation and maintenance knowledge, as well as some deep analysis of Linux system
fan benefits: join the big data community of small Zen
Welcome to like
, collect
, leave a message
Everything is a file in Linux!
/ : Root directory. Generally, only directories are stored in the root directory. Do not store files, modify, or delete contents in the directory
/ MNT: test directory. Files in it are not important
/root: home directory of user root
/home: home directory of common users
/ TMP: temporary directory (e.g. when a file is uploaded)
/var: stores frequently modified data, such as program running log files
/boot: Store the kernel files used to start Linux, including connection files and image files, try not to touch things here
/etc: the default place for storing the configuration file
/bin: a program that can be executed by all users
/sbin: a program that only root can execute
/usr: this is where you can use your own software, such as mysql or other related software. /usr/local/
/dev/cdrom #dev/cdrom #dev/cdrom At this time if we see our ISO file hanging up, you can use the following command to view.
/media: Mount disks are usually empty until they are mounted (how to use this drive? Mount /dev/cdrom /media # mount /dev/cdrom /media # mount /dev/cdrom /media # mount /dev/cdrom /media
Unmount the CD-ROM: umount /dev/cdrom
Absolute path: in plain English, the complete path
Relative path: relative to the current location path./ represents the current directory meaning.. / stands for the directory above (CD..) perform
The use of Linux Master editor VI
Basic concepts of vi :(three modes)
I: imperative # This mode is not editable ii: insert mode # also known as edit mode III: bottom line mode
1: Enter insert mode: press I or O on the keyboard or A # press O to start another line
2: Enter command mode: Press esc in the upper left corner of the keyboard
3: Enter bottom line mode: The premise is to enter in command mode
1: Operations in command line mode:
$ Move to the end of the line
gg This mode will automatically jump to the beginning of the first line by pressing GG
G Move to the beginning of the last line of the document
x # delete content, delete a character
dd Delete the entire row where the cursor is located
u # undo the original operation
v Press Y to copy the range. Press V to select the range
p # paste
Copy the code
2: In bottom line mode operation, enter colon to enter bottom line mode
n #n is a number. Move the cursor to line NTH # for example, enter 20 to jump to line 20.
/ # find content #/lovxyz so that the cursor jumps to the line of the word%s/word1/word2/gThe meaning of this line is to find the word1 string from the first to the last line and replace the string with word2
n1,n2s/word1/word2/g #n1 and n2 are numbers. Search for the string word1 between lines n1 and n2 and replace it with #. For example, if you type set nu to display the number of lines, n1 and n2 will be 12, and 20 will be between 12 and 20.For word2set nu # display line number
set nonu # cancel line number
q! # Force leave without saving
wq # Leave and save
wq! # Force leave and save! ls# Leave temporarily
Copy the code