Linux entry and common commands & Linux software installation-SVN

1. Operating system

Common operating systems

  • Android
  • Apple
  • Windows

Operating system classification
Insert picture description here

2. Linux statement (you can refer to RUNOOB)

1. Directory structure

Insert picture description here

  • 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:

-aDisplay all files and directories (hidden files starting with. Will also be listed)
-lIn addition to the file name, the file type, permissions, owner, file size and other information are also listed in detail.
-rThe files are displayed in reverse order (in English) Alphabetical order)
-tList the files in the order of creation time.
-ASame 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
-Rdirectory. 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
Insert picture description here

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/insertkey 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:

Insert picture description here

drwxr-xr-x: Folder default permissions ( rrepresents readable, wrepresents writable, xrepresents executable)

  • dRepresentative folder ( -representative file)
  • The first three rwxrepresent the permissions of the user (u)
  • The middle three r-xrepresent the authority of the group (g)
  • The last three r-xrepresent 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

ifconfigView 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

Insert picture description here

15.echo command

Use the echo command to print the value of the variable
echo $PATH

Demo

·

16.printenv command

printenvCommand 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

Insert picture description here
Insert picture description here

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
Insert picture description here

printenv | grep path#Environmental variables to find lowercase path #Find
printenv | grep -i pathpath, case-insensitive
grep -ir python#Find python in any file in the current and all subdirectories #Find python
grep -ir python file1in file1 #Find
grep -ir --include *.py math ~the py file in home and all subdirectories that contains' math' line, not case sensitive

Demo
Insert picture description here

20.file command

Used to identify the file type
Usage

file zipfile.py

file -z zipFile

file /dev/null
Demo
Insert picture description here

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
Insert picture description here

23.ln

Equivalent to desktop shortcut
Create soft link: ln -s 要链接的地址 链接名
delete soft link: rm 链接名(Note: if it is a directory, do not add /)
Insert picture description here

24.find command

Search for files in the directory hierarchy
Insert picture description here

25.date command

Print or set the system date and time
Insert picture description here

26.cut command

Extract fields from file
Insert picture description here

27.tr command

Used to convert or delete characters in the file
Insert picture description here

28.ping command

Used to test the connectivity with the target host
Insert picture description here

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

Insert picture description here
Insert picture description here

【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

Insert picture description here

6. Steps

yum install -y subversionInstall subversion server side to
mkdir /svnDatacreate 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
Insert picture description here
vi passwd
Set SVN user password
Insert picture description here
vi svnserve.conf
Modify the option of svnserve file
Insert picture description here
Start SVN (preferably start in the root directory)
svnserve -d -r /svnData

Guess you like

Origin blog.csdn.net/nayomi927/article/details/114624124