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

[](#)JavaJava


- [ ](#-)
  - [1.1 ](#11-)
  - [1.2 ](#12-)
- [ Linux](#-linux)
  - [2.1 Linux](#21-linux)
  - [2.2 Linux](#22-linux)
  - [2.3 Linux](#23-linux)
- [ Linux](#-linux)
  - [3.1 Linux](#31-linux)
  - [3.2 ](#32-)
- [ Linux](#-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-)


GithubLinux(Java)

> Linux

##  

### 1.1 



- **Operation SystemOS**
- ** **
- ** **
- ****

![](https://user-gold-cdn.xitu.io/2018/7/3/1645ee3dc5cf626e?w=862&h=637&f=png&s=23899)
### 1.2 

1. **Windows:**  
2. **Unix**  .Unix /
![Unix](https://user-gold-cdn.xitu.io/2018/7/3/1645ee83f036846d?w=1075&h=475&f=png&s=914462)
3. **Linux:** LinuxUnix.LinuxLinux **Linux** LinuxLinuxLinuxLinuxLinuxGNU 

![Linux](https://user-gold-cdn.xitu.io/2018/7/3/1645eeb8e843f29d?w=426&h=240&f=png&s=32650)


### 1.3 

**:
[](https://www.jianshu.com/p/85e931636f27) (,,)**




LinuxLinux
Linux:Debian,RedHat,Ubuntu,Suse,Centeos

### 

unixlinux


![](../../media/pictures/linux/.png)

#### ?
cpu
cpu**()****()**

****

* (,): ****


* : ****
,


* : 

#### 
* : 


* : cpu


* : cpu
cpu


#### RAM(Random Access Memory )
CPU

#### (Virtual Memory)
****
windowsLinuxswap

#### Swap
: 

(:LRU)
Swap
()



##  Linux

### 2.1 Linux

Linux
- **Unix** LinuxUnix 
- **Linux** LinuxLinux 
- **Linux** LinuxLinuxGit

![Linux](https://user-gold-cdn.xitu.io/2018/7/3/1645ef0a5a4f137f?w=270&h=376&f=png&s=193487)

### 2.2 Linux

- 1991Linus TorvaldsMinixUnixftpLinux GNU; 
- Linux 


### 2.3 Linux

**Linux**

1. **** LinuxLinuxI/O
2. **** LinuxubuntuCentOSCentOS
![Linux](https://user-gold-cdn.xitu.io/2018/7/3/1645efa7048fd018?w=548&h=274&f=png&s=99213)


##  Linux

### 3.1 Linux

**Linux**

LINUX****UNIXLinuxUNIXUNIXUNIX

### 3.2 Inode
inodelinux/unixinode


#### Inode??
(Sector),512(0.5kb)
**
(block)4kb
8**
metadata
**inode inode
 stat inodeinode
Linux/Unixinode**

**inode2
inode
inodeinode table**

inode:

![inode](../../media/pictures/linux/inode.png)


### 3.3 

**Linux: 
Socket

![](https://camo.githubusercontent.com/3d2c05419cb1f93fae15869cfc541c2bb3d5674b/68747470733a2f2f757365722d676f6c642d63646e2e786974752e696f2f323031382f372f332f313634356631613764363464656631613f773d39303126683d35343726663d706e6726733d3732363932)

- : txt,html,pdf


- : 


![](../../media/pictures/linux/.png)

- : ()

  - (Hard Link):inodeinode
2inode
inodeinode
inode,
,


  - ()(Symbolic Link): Windows


:

![](../../media/pictures/linux/.png)

- 
,/dev

  - : **
/** 

  - : **
windows**


****
: "word"
word()

- : mkfifo

- Socket: 2Socket


### Linux


**Linux**

Linux
![Linux](https://user-gold-cdn.xitu.io/2018/7/3/1645f1c65676caf6?w=823&h=315&f=png&s=15226)

****

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


##  Linux

Linux

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

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

### 4.2 ()

1. **`mkdir `** 
2. **`lsll`**llls -lll
3. **`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" `
    
4. **`mv  `** 

   mv  mvmv
5. **`mv  `**  ---
  
    mvmvcpmvcp
6. **`cp -r  `** -r 
  
    cp  -r
7. **`rm [-rf] `:** 
  
    rm  `rm -rf` //


### 4.3 ()

1. **`touch `:**  
2. **`cat/more/less/tail `** 
    - **`cat`** 
    - **`more`**  q
    - **`less`** PgUpPgDn q
    - **`tail-10` ** 10Ctrl+C
    
    tail -f  tomcat  tail -f catalina-2016-11-11.log    
3. **`vim `**  

   vimLinuxvivimvim

   **vim**
   
    vim ------>----->------>i----->  ------->Esc----->wq/q! wqq!
4. **`rm -rf `** 

     `rm -rf`  
    
### 4.4 

**1**

Linux.tar.gz

.tar.gz
**`tar -zcvf  `**


  zgzip

  c

  v

  f

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


**2**

tar [-xvf] 

x



1 /testtest.tar.gz**`tar -xvf test.tar.gz`**

2 /testtest.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`

![](https://user-gold-cdn.xitu.io/2018/7/5/1646955be781daaa?w=589&h=228&f=png&s=16360)



![](https://user-gold-cdn.xitu.io/2018/7/5/16469565b6951791?w=489&h=209&f=png&s=39791)

> Linux


****

- d 
- - 
- l window


**Linux**

- rr4
- ww2
- xx1

****

 

 

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

 

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


**000**
**linuxlinux**

- ****

  ls ahl chown    
- ****

   ls ahl chgrp     
- ****

   

> /

**/`chmod`**

/testaaa.txt


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

**`chmod -R u=rwx,g=rwx,o=rwx ./log`** // log

![](https://user-gold-cdn.xitu.io/2018/7/5/164697447dc6ecac?w=525&h=246&f=png&s=12362)



chmod 764 aaa.txt


**:**

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

useraddLinuxuseraddpasswduserdeluseradd/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 Statusgrep
  
- **`kill -9 pid`** -9 

  pskill
  
- ****
    - ifconfig
    - ping 
    - netstat -an
    
-  **net-tools  iproute2 **
    `net-tools`BSDTCP/IPLinux2001LinuxLinuxArch LinuxCentOS/RHEL 7net-tools`iproute2`linux ipifconfig[LinuxIP](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`** 

## 



**Java:** JavaV2.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