Linux
- 1. Operating system
- 2. Linux statement (you can refer to RUNOOB)
-
- 1. Directory structure
- 2. Directory commands:
- 3. File commands:
- 4. View the contents of the file:
- 5.vi editor: vi file name
- 6. View mode: mainly view
- 7. Editing mode: for input, press ESC to exit the editing mode and return to the viewing mode
- 8. Last line mode: press `:`, `/`, `in view mode? `Enter the bottom line mode
- 9. User commands:
- 10. User group commands:
- 11. Authority management:
- 12. Modify permissions: chmod gr
- 13. Modify the user/group:
- 14. Process management commands
- 15.echo command
- 16.printenv command
- 17.more, less commands
- 18.wc command
- 18. Pipe symbol: `|` The result on the left is input as the command on the right
- 19.grep command
- 20.file command
- 21. Standard input/output and redirection
- 22.which command
- 23.ln
- 24.find command
- 25.date command
- 26.cut command
- 27.tr command
- 28.ping command
- 29.Linux software installation
- Three. SVN installation
1. Operating system
Common operating systems
- Android
- Apple
- Windows
Operating system classification
2. Linux statement (you can refer to RUNOOB)
1. Directory structure
- Home directory (the root directory of the current user):
~
- System root directory:
/
- Current directory:
.
- Up-level directory:
..
2. Directory commands:
- View the current directory:
pwd
- Switch directory:
cd
- View the contents of the directory:
ls [-属性] [目录]
- Create a directory:
mkdir 目录路径
- Delete directory:
rmdir 空目录路径
- Change directory:
mv 原路径 新路径
- Copy directory:
cp 原路径 新路径
ls attributes:
-a
Display all files and directories (hidden files starting with. Will also be listed)
-l
In addition to the file name, the file type, permissions, owner, file size and other information are also listed in detail.
-r
The files are displayed in reverse order (in English) Alphabetical order)
-t
List the files in the order of creation time.
-A
Same as -a, but do not list "." (current directory) and "..." (parent directory)
-F
. Add a symbol after the listed file name; for example, executable Add "*" to the file, and add "/" to the
-R
directory. If there are files in the directory, the following files are also listed in sequence
Example
Arrange in reverse order of establishment time and list in detail
3. File commands:
- Create a file:
touch 文件路径
- Delete Files:
rm [-rf] 文件路径
- Change file:
mv 原路径 新路径
- Copy files:
cp 原路径 新路径
4. View the contents of the file:
- View from the beginning:
head -n 文件名
(n stands for number, view n lines from the beginning ) - View from the end:
tail -n 文件名
(view n lines from the end) - Dynamic view:
tail -f 文件名
- Look at lines 20-30:
head -30 文件名 | tail -10
5.vi editor: vi file name
6. View mode: mainly view
- Enter
a/A/i/I/o/O/insert
key to enter edit mode - Enter after the cursor:
a
- Enter at the end of the current line of the cursor:
A
- Enter before the cursor:
i
- Enter at the beginning of the current line of the cursor:
I
- Insert in the next line:
o
- Insert in the previous line:
O
- Copy a whole line:
yy
- Copy multiple lines:
nyy
- Paste:
p
- Delete a line:
dd
- Delete multiple lines:
ndd
- Jump quickly to the first line:
1GG
- Last line: shift+
G
- Any line:
nGG
- How many lines down
n
+ carriage return
7. Editing mode: for input, press ESC to exit the editing mode and return to the viewing mode
8. The line mode: viewing mode press :
, /
, ?
enter line mode
9. User commands:
- Create user:
useradd 用户名
- Switch user:
su 用户名
- Modify user password:
passwd 用户名
- delete users:
userdel 用户名
- Modification-User:
usermod 用户名
10. User group commands:
- Create a group:
groupadd 组名
- Delete group:
groupdel 组名
- Modify group:
groupmod 组名
11. Authority management:
drwxr-xr-x
: Folder default permissions ( r
represents readable, w
represents writable, x
represents executable)
d
Representative folder (-
representative file)- The first three
rwx
represent the permissions of the user (u) - The middle three
r-x
represent the authority of the group (g) - The last three
r-x
represent the permissions of other groups (o) - Default permissions for folders: 755, default permissions for files: 644
12. Modify permissions: chmod gr
chmod -w 文件/文件夹名
All users cannot write-
chmod 777 文件/文件夹名
full permissions
13. Modify the user/group:
chown 用户:组 文件/文件夹名
14. Process management commands
ifconfig
View the host IP address
ps -aux | grep [进程标识]
View the process
ps -ef | grep [进程标识]
View the process (the two process commands focus on different points)
kill -9 进程编号
Kill the process
Demo
15.echo command
Use the echo command to print the value of the variable
echo $PATH
Demo
16.printenv command
printenv
Command can print environment variables
17.more, less commands
cat: cat 文件名
load all files at one time, and display all
more: more 【参数】 文件名
load all files at one time, but paged display
less: less 【参数】文件名
load only one page of the file at a time, cache one page, and display page by page
18.wc command
18. Pipe symbol: the |
result on the left is input as the command on the right
Like
cat 文件名 | more
19.grep command
grep: Find words/sub-contents in file contents
printenv | grep path
#Environmental variables to find lowercase path #Find
printenv | grep -i path
path, case-insensitive
grep -ir python
#Find python in any file in the current and all subdirectories #Find python
grep -ir python file1
in file1 #Find
grep -ir --include *.py math ~
the py file in home and all subdirectories that contains' math' line, not case sensitive
Demo
20.file command
Used to identify the file type
Usage
file zipfile.py
file -z zipFile
file /dev/null
Demo
21. Standard input/output and redirection
Standard input is represented by 0, standard output is represented by 1, and standard error is represented by 2 (the first two can be ignored).
Output redirection:> Overwrite >> Append
22.which command
Used to find commands
Demo
23.ln
Equivalent to desktop shortcut
Create soft link: ln -s 要链接的地址 链接名
delete soft link: rm 链接名
(Note: if it is a directory, do not add /)
24.find command
Search for files in the directory hierarchy
25.date command
Print or set the system date and time
26.cut command
Extract fields from file
27.tr command
Used to convert or delete characters in the file
28.ping command
Used to test the connectivity with the target host
29.Linux software installation
【1】.tar: unzip and install
Installation package format: tar, tar.gz, tar.bz
Installation package:tar –zxvf [包名]
Note: tar command and gz command
tar command: playing, unpacking command
tar -xvf 拆包的文件
unpacking
tar -cvf 打包后的名字 打包前的文件
packed
z: Representative gz command: command compress
gzip 要压缩的文件
compression
gunzip 要解压的文件
decompression
is generally directly tar -zxvf 包名
extracting installer
Demo
【2】.rpm: direct installation
Installation package format: rpm
installation package: rpm –ivh 软件包路径
uninstall package:rpm –e 软件包全名
【3】.yum: online installation
Install the package: yum -y install 软件包
Uninstall the package:yum -y remove 软件包
Three. SVN installation
1. SVN (Subversion): version control system
Can share files
2. SVN features
Cross-platform
simple and easy to use
3. Central warehouse: the storage location of files on the SVN server
4. Work space: the location of the file downloaded by the operator to the local
5. SVN interaction process
6. Steps
yum install -y subversion
Install subversion server side to
mkdir /svnData
create SVN resource library directory
mkdir /svnData/projects
svnadmin create /svnData/projects/testSvn
Generate SVN resource directory
Configure SVN project permission authentication
cd /svnData/projects/testSvn/conf/
vi authz
Configure root user to read and write to the root directory
vi passwd
Set SVN user password
vi svnserve.conf
Modify the option of svnserve file
Start SVN (preferably start in the root directory)
svnserve -d -r /svnData