[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/Peazz-Stack/JavaGuide/master/docs/operating-system/linux.md [Back]  [Original]

[](#)Java  Java 


- [1. ](#1-)
  - [1.1. ](#11-)
  - [1.2. ](#12-)
    - [1.2.1. Windows](#121-windows)
    - [1.2.2. Unix](#122-unix)
    - [1.2.3. Linux](#123-linux)
    - [1.2.4. Mac OS](#124-mac-os)
  - [1.3. Kernel](#13-kernel)
  - [1.4. CPUCentral Processing Unit](#14-cpucentral-processing-unit)
  - [1.5. CPU vs Kernel()](#15-cpu-vs-kernel)
  - [1.6. ](#16-)
- [2.  Linux](#2--linux)
  - [2.1. Linux ](#21-linux-)
  - [2.2. Linux ](#22-linux-)
  - [2.3.  Linux ](#23--linux-)
- [3. Linux ](#3-linux-)
  - [3.1. Linux ](#31-linux-)
  - [3.2. inode ](#32-inode-)
  - [3.3. Linux ](#33-linux-)
  - [3.4. Linux ](#34-linux-)
- [4. Linux ](#4-linux-)
  - [4.1. ](#41-)
  - [4.2. ()](#42-)
  - [4.3. ()](#43-)
  - [4.4. ](#44-)
  - [4.5. Linux ](#45-linux-)
  - [4.6. Linux ](#46-linux-)
  - [4.7. Linux ](#47-linux-)
  - [4.8. ](#48-)
- [5. ](#5-)


 Java  Linux 

__

## 1. 

![](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/2020-8/image-20200807161118901.png)

 Linux 

### 1.1. 



1. **Operating System OS**
2. ** ** 
3. **** 
4. **Kernel**

> Kernel

![Kernel_Layout](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/2020-8/Kernel_Layout.png)

### 1.2. 

#### 1.2.1. Windows

 

_ Windows  Windows  Mac _

![windows](images/windows.png)

#### 1.2.2. Unix

  Linux  Unix



![unix](images/unix.png)

#### 1.2.3. Linux

**Linux  Unix ** Linux  **Linux ** 

> Linux  Linux  GNU/Linux Linux  Linux  GNU  Linux 
>
> ** GNU/Linux  Linux**

![linux](images/linux.png)

#### 1.2.4. Mac OS

 Linux  Linux 

![macos](images/macos.png)

### 1.3. Kernel



> ****Kernel I/OCPU ** IO **
>
> !



1. **Kernel**
2. ****

### 1.4. CPUCentral Processing Unit

 CPU 

1. **CPU Core+ Control Unit**
2. **CPU +**
3. **CPU 01**

### 1.5. CPU vs Kernel()

KernelCPU

1. Kernel CPU 
2. CPU Kernel

CPU 

![Kernel_Layout](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/2020-8/Kernel_Layout.png)

### 1.6. 





1. **(user mode)** : 
2. **(kernel mode)**: 

****



)



- **** 
- **** 
- **** 
- **** 
- **** 

_~_

![](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/2020-8/L181kk2Eou-compress.jpg)

## 2.  Linux

### 2.1. Linux 

 Linux

- ** Unix **  Linux  Unix 
- **Linux  Linux **  Linux  Linux  Linux  Linux 
- **Linux **   **Linux **  Linux  Git 

![Linux](images/Linux.png)

### 2.2. Linux 

1989 Linus Torvalds  11  minix 1990  Unix

> **Minix**  Unix  Linux 

1991 Linus Torvalds  Linux Linux 

![OPINION: Make the switch to a Linux operating system | Opinion ...](images/Linux-Logo.png)

### 2.3.  Linux 

Linus Torvalds  Linux  Linux  Linux 

> 

Linux 

-  Red Hat  CentOS 
-  Debian  UbuntuDebian

 Linux , CentOS 

## 3. Linux 

### 3.1. Linux 

** Linux **  Linux ****

 UNIX  UNIX Linux  UNIX 

### 3.2. inode 

**inode  linux/unix inode ??**

(Sector)(block) 4kb 8  512  block

(block) ** metadata**  ** inode****iindex+node**  inode

 `stat`  inode  inode Linux/Unix  inode 

inode 



- **inode**  stat  inode 
- **block**  block inode 

![inode](images/inode.png)

### 3.3. Linux 

Linux : **********************Socket **

- **-**   Linux PDFtext
- **ddirectory file** 
- **lsymbolic link** 
- **cchar** 
- **bblock**  
- **(p,pipe)** : 
- **(s,socket)** 

### 3.4. Linux 



**Linux **

Linux 
![Linux](images/Linux.png)

****

- **/bin** (lscatmkdir )
- **/etc** 
- **/home**  user /home/user~user 
- **/usr ** 
- **/opt**  tomcat 
- **/proc** 
- **/root** ^o^
- **/sbin:**  root  ifconfig 
- **/dev** 
- **/mnt** 
- **/boot** 
- **/lib **  
- **/tmp** 
- **/var** 
- **/lost+found** windows .chk

## 4. Linux 

 Linux 

Linux [http://man.linuxde.net/](http://man.linuxde.net/)

### 4.1. 

- **`cd usr`**  usr 
- **`cd ..cd../`** 
- **`cd /`** 
- **`cd ~`** 
- **`cd -`** 

### 4.2. ()

- **`mkdir `** 
- **`ls/ll`**ll  ls -l ll 
- **`find  `**  : `find .` `/home`.txt :`find /home -name "*.txt"` ,: `find /home -iname "*.txt"`  .txt .pdf :`find . \( -name "*.txt" -o -name "*.pdf" \)``find . -name "*.txt" -o -name "*.pdf"`
- **`mv  `** mv  mv  mv 
- **`mv  `** ---mv  mv  cp mv  cp 
- **`cp -r  `** -r  cp  -r 
- **`rm [-rf] ` :** rm  `rm -rf` //

### 4.3. ()

- **`touch `:** 
- **`cat/more/less/tail `**   `tail -f `  tomcat   `tail -f catalina-2016-11-11.log`    
- **`vim `** vim  Linux  vi vim  vim  vim  `vim ------>----->------>i-----> ------->Esc----->wq/q!`  wq  q!
- **`rm -rf `** 

### 4.4. 

**1**

Linux .tar .gz .tar.gz
`tar -zcvf  ` 

- z gzip 
- c
- v
- f

 test aaa.txt bbb.txt ccc.txt test  test.tar.gz **`tar -zcvf test.tar.gz aaa.txt bbb.txt ccc.txt`  `tar -zcvf test.tar.gz /test/`**

**2**

`tar [-xvf] ``

x



-  /test  test.tar.gz **`tar -xvf test.tar.gz`**
-  /test  test.tar.gz /usr :**`tar -xvf test.tar.gz -C /usr`**- C 

### 4.5. Linux 

 Linux (readable)(writable)(excutable)(owner)(group)(other)

 **`ls -l`**  

`ls -l`

![](images/Linux.png)



![](images/Linux.png)

> Linux 

****

- d 
- - 
- l  window 

**Linux **

- rr  4 
- ww  2 
- xx  1 

****





|  |                   |
| :------- | --------------------------: |
| r        |  cat  |
| w        |           |
| x        |     |



|  |                |
| :------- | -----------------------: |
| r        |        |
| w        |  |
| x        |      cd  |

 ** 000**

** linux  linux **

- **(u)**  `ls ahl`   chown   
- **(g)**  `ls ahl` chgrp  
- **(o)** 

> /

**/`chmod`**

/test  aaa.txt 

**`chmod u=rwx,g=rw,o=r aaa.txt`**  **`chmod 764 aaa.txt`**

![](images/.png)

**:**

 zookeeper

1.  zookeeper
2.  zookeeper :`chmod +x zookeeper`
3.  zookeeper `chkconfig --add zookeeper`
4. `chkconfig --list`

### 4.6. Linux 

Linux 



**Linux :**

- `useradd  `:
- `userdel  `:
- `usermod  `:
- `passwd `:
- `passwd -S ` :
- `passwd -d `: 

`useradd`  Linux `useradd``passwd``userdel``useradd` `/etc/passwd`

`passwd`

### 4.7. Linux 

 Linux  Linux 

`/etc/group`

**Linux :**

- `groupadd  ` :
- `groupdel `:
- `groupmod  ` : 

### 4.8. 

- **`pwd`** 

- `sudo + ` sudo  root 

- **`grep   --color`** --color 

- **`ps -ef`/`ps -aux`** **`ps aux|grep redis`**  redis  `pgrep redis -a`

   psProcess Status grep 

- **`kill -9 pid`** -9 

   ps  kill 

- ****
  - ifconfig
  - ping
  - netstat -an
- **net-tools  iproute2 **
  `net-tools` BSD  TCP/IP  LinuxLinux  2001 Linux  Linux  Arch Linux  CentOS/RHEL 7  net-tools`iproute2`linux ip  ifconfig[ Linux  IP ](https://linoxide.com/linux-command/use-ip-command-linux)
- **`shutdown`** `shutdown -h now` `shutdown +5 "System will shutdown after 5 minutes"` 5 

- **`reboot`** **`reboot`** **`reboot -w`** 

## 5. 



**Java :** Java V3.0 PDF [](#) **"Java "** 

**Java :**  Java  **1** 

![](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-6/167598cd2e17b8ec.png)

Web Proxy Viewer  |  New URL  |  Original Page