1.url does not write the port number, the default is 80 port; This machine is 127.0.0.1 or localhost
2. User Management
View Current User:
ID: can view the current user; WhoAmI: view the current user; Who: can view the currently logged in user; W: can also view
Add Users:
Useradd username; Useradd-g groupname username; passwd username;
The user's default home directory is the/home/directory;
passwd: Add password to the added user, you can also reset the password;
Wavy Line ~ represents home directory;
Quick Home directory: cd ~; Direct CD
To switch users:
SU username; Su-username;
Difference: Su-will reload the user's environment variables;
sudo: Get super User privileges;
To add sudo permissions for a normal User:
Root all= (All) is found in the/etc/sudoers file
Username all= (All) Nopasswd:all
To delete a user:
Userdel username;
Userdel-r XW Delete the user's home directory when it is deleted;
Group Management
Add Group: Groupadd name;
Delete Group: Groupdel name;
Operations on a directory folder
PWD: Displays the current path
CD: Enter the directory (folder)
Create folder: mkdir document; Mkdir-p/tmp/besttest/blk; If the parent directory does not exist, create a
See what's Under the file:
Ls-l = = ll; Show details in this directory
Ls-a: Show contains hidden files
New file, file permissions
Permissions for the owner of the same group of permissions for other users
rw-r--r--
File name change:
MV Besttest Linux; MV Besttest/tmp
MV if followed by the file name is renamed, if the path is the mobile
Copy
CP ax/tmp/Copying files
Cp-r linux/tmp/Copy Folder
CP-RF Linux
Alias wgy= ' Cd/opt/lampp '
If it's permanent, add it to/etc/profile.
/top directory, My Computer equivalent to Windows
Relative path: Equivalent to the current path
Absolute path: The actual path
Cd.. Back to the top level directory
Cd.. /.. /go to the top level two directory
CD-Return to the last directory
Plus permissions
X: Execute W: Write R: Read
chmod o+x Other users chmod g+x this group of users chmod u+x themselves chmod +rwx all
chmod a+x All Remove permissions, turn + into-
R=4 w=2 x=1 The permissions of the digital mode
chmod 755 File If you add the permission to a folder, add-R
Chown change the owner of the file: Chown files user If the permission is a folder to add-R
CHGRP change the owning group of the files: Chgrp file group If the permission is a folder, add-R
Wc-l File: Count rows
| Pipe break: Connect two commands, execute the result of the previous command to handle the following command: LS |wc-l
&&: Connection two command, successively executed: SH starup.sh && tail-f/logs/catlina.out
Operations on files
Vi
Toggle edit mode and command mode: I check into the current position; O Next row of the line; a next position to edit
ESC exit edit mode switch to command mode
Exit VI:
Command mode:
: Q without modification, you can exit directly.
: q! does not save exit
: Wq Save Exit
: X Save exit
Find:
/test looking from the beginning.
? Test starts at the end of the file
Display line number:: Set Nu
Suppress line number:: Set Nonu
Fast to a line:: line number
Fast to end of file: Shift+g
Delete a single character: X
Delete entire line: DD
Delete multiple lines: 19DD
Undo: U
Copy a whole line: yy
Copy Multiple lines: 10yy
Paste: P
Repeat the previous operation:.
Move cursor to beginning of line: 0
Move cursor to end of line: $
Replacement string::%s/src_str/new_str/g
View File Contents
Cat, more, less, tail-f
Ln/opt/lampp/xampp ~/wxy
Find/-name MySQL finding files/folders
grep xxx file Find files
GREP-V Filter the specified keywords
Tail-f/opt/lampp/logs/access_log |grep WGY
Du-sh * Can see the space occupied by all the files in the current directory
Du-sh dirname
Df-h can see how much of the current disk is used
Installing the Software
Upload, download
FTP tools: Direct drag, anything can be agreed to upload, SFTP protocol
Rz/sz cannot upload folders
Switching machine, restart
Shutdown: Shutdown-h 30 timer shutdown
Shutdown-h now immediately shuts down the machine
Init 0 shuts down immediately
Reboot restart
Shutdown-r 20 timed restart
Exit Logout
of the network
IP A
Ifconfig
Dhclient Auto Get IP
Compress, unzip files
Tar CVF Linux is packaged directly, preceded by the name of the package, and who is to be packaged later
Tar zcvf linux.tgz Linux compression
Tar xvf Linux.tar Linux decompression, regardless of compression can be unlocked
Zip linux.zip Linux Zip package
Unzip Linux.zip
Gzip file can only package files, packaging the original files are not
Gunzip file.gz
Cat xx > New_xx covers the original content
Cat xx >> new_xx append
Ps-ef|grep mysql|grep-v grep Lookup process
PS just shows the state of execution that moment
Top dynamic viewing process, but cannot find
Kill-9 pid kill process, can follow multiple PID
Nohup./jmeter-server & Running a program in the background
Scheduled Tasks
CRONTAB-E Editing timed tasks
Crontab-l See which scheduled tasks are currently available
crontab file format m H d M D cmd; M minutes (0~59), H hours (0~23), d within a week of days (0~6,0 for Sunday), CMD to run the program, * every minute is executed
To view the port number:
Netstat-nlpt|grep 18983 Query What is the start port number for this process number?
Netstat-nplt|grep Port to see if this port number is occupied
Environment variables: Make a script/script available in whatever directory you want
System Environment variables:/etc/profile
User environment variable: ~/.BASHRC
Export path= $PATH:
Source/etc/profile
SOURCE ~/.BASHRC
Shell script: Multiple commands are written together
Ps-ef|grep jmeter|grep-v grep |awk ' {print $} '
awk ' {print $} ' takes two columns of data
The Linux default Shell interpreter is bash
Software Installation:
RPM-IVH xx.rpm
RPM-E xxxx
Rpm-qa|grep XXX Query Whether this software has been installed
Yum
XX yum-y Install XXX
SOURCE Installation:
./configure--prefix=/path Generating compiled files
Make compilation
Make install to put the compiled files in the specified directory
RZSZ command installation: Use Yum installation, yum-y install Lrzsz,
Compile and install: http://blog.chinaunix.net/uid-20639775-id-154615.html
Basic Linux Knowledge