Home > OS >  Linux learning notes
Linux learning notes

Time:10-06

IP query methods: ipconfig Windows
The ifconfig Linux
IP a
Linux command format: the command parameters [] [path]
Ls # list all files under the
Ls - a # path all files (hidden files)
D folder
- a text file
| link
The hostname # XXX temporarily changes hostname, session level
Vim/etc/sysconfig/network # lasting change centos6
Vim/etc/hostname # lasting change centos7
Commonly used commands:
The date -s' format '# for a corresponding time format
The date # for current time
Ps # static view process commonly used in the filtration system is a process
Dynamic view top # process
Ps - ef | grep # XXX filtering process
Pstree # process tree
Grep # filter command
Touch # create an empty file
The mkdir # to create the folder
The mkdir - pv/xx/# XXX multistage create
The rm # delete command
The rm -f # mandatory delete
Rm - r # used to delete the folder, the recursive delete
Rm - rf #
Echo # standard output
Echo "hello Java & gt;" A.t xt # create text
> A.t xt # additional content to text
Cp source files - the target file # copy file
Mv # shear command
Find -name./*. Java # through corresponding to the file path query to meet the requirements of
Wc # statistical word
Link command: two soft links
Hard links
Ln -s xx # Windows shortcuts
Ln # xx xx is equivalent to backup
More less # paging display
The head # header data
Tail - n 100 # according to 100 data
Tail - f # dynamic monitoring data
Stat # shows the details of the specified file
Who \ \ w whoami # displays the current login user name
Du # according to the path of disk usage
Df # check disk usage
Fdisk # disk management
Which # check command path
Whereis # command path
Netstat # to check the usage of network and use the port
Kill kill 9 # process
Shutdown, restart, log off
Shutdown - r | - h # shutdown command
Shudown -h now # immediately shut down
Shudown - r # 10=reboot to restart
Shut down the halt #
The exit # exit
Shut down init4 0 #
Init6 # restart
Logout # cancellation

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
7.7
# sudo temporary access administrator rights
Su # user switching
Su - # switch to the user work interval
Find the path - # name lookup file
Apt \ yum install openssh - # server installation SSH service
The use of the init command:
Init num {0 ~ 6} 0 # process closed, stop condition
3 # no interface system
5 # interface system
6 # restart
# cat/etc/inittab centos7 systemctl (service the chkconfig) set - the default XXX. Target
Archive command:
Archive: put together a collection multiple files
Compression: the file using a certain algorithm to reduce volume
Tar - CVF XXX. Tar xx. # XXX xx archive file
Tar XVF - XXX. Tar # solution archive file
Use gzip to document compression
Gzip XXX. Compressed tar #
Gzip - d XXX. Tar. Gz # extract
Tar ZXVF - XXX. Tar. Gz # solution archive and extract the
The tar - ZCVF XXX. Tar. Gz file xx xx XXX #
The virtual machine network configuration:
On | off | restart the network service
# network service (start) start/stop/restart
Three vm virtual network card:
Bridge
Only local
NAT
Vim editor
1. The vi is Linux built-in text editor
2. Edit, create a document
3. Create a document
Vi/vim file name
4. Three models: command mode shift:
Set number # shows the line number
Q! # kicked out
Wq # save out
X # automatically determine whether save
#/retrieve content from top and bottom
? # from the bottom up to retrieve content

Edit mode I/a
Operating mode
Yy # copy line cursor
P # pasting
Dd # to delete the current line
Nyy # line copy n
U # cancellation
Ctrl R # return cancellation
CTRL f # jump down a page
CTRL u # jump up half a page
CTRL b # jump up a page

The file permissions: rw - rw - r -
U
G
O
Modify the file permissions chmod

File has: chown root root/a.t xt
  • Related