1. basic linux command
ls -> list
ls /
pwd: check current folder
su: switch user
about the command line:
for root user: it starts with #
for ordinary user: it starts with $
ifconfig: check ip address
make sure you set network as bridge, so that your linux server can work as a indepenent server, and it can connect to other servers.
在centos最小化安裝的情況下,沒有ifconfig命令,需要yum install net-tools
?(ubuntu:?sudo?apt?install?net-tools)
cd
absolute path: cd / -> go to root folder
cd /home
cd .. -> go to parent folder
cd ~ -> go to current user working folder
relative path: bin/xx
../bin/xx
mkdir/rmdir -> make a directory/remove a directory
touch -> create a file
cp -> copy file
cp test/sample.cnf test2
cp -r test/subtest test2
to copy directory, add -r option
mv
1. rename a file: mv sample.cnf sample2.cnf
2. move the file to diffirent location: mv sample2.cnf /home
rm
1. remove a file: rm xxx
2. remove a directory: rm -r xxx
3. remove without asking -f
rm -f xxx
rm -rf xxx
cat
1. cat xx.cnf
2. cat test1.cnf test2.cnf > test3.cnf
tar
in linux, package is different with zip
to package all the files in /home into a tar file(new.tar)
```
tar -cf new.tar /home
```
to unpackage the tar file
```
tar -xf new.tar
```
zip/unzip
two types of zip format,gz and biz2
```
zip: tar -cvzf soft.tar.gz /home/hxy
upzip: tar -xvzf abc.tar.gz
tar -xvzf abc.tar.gz -C /home
zip: tar -cvjf soft.tar.biz2 /home/hxy
unzip: tar -xvjf abc.tar.biz2
tar -xvjf abc.tar.biz2 -C /home
```
ps/kill
to check process
ps -aux
to kill process
kill pid
kill -9 pid (-9 stands for to kill by force)
查找端口占用的pid, 根據pid殺死進程。
netstat -lnp|grep 8080

顯示結果:
最后的一欄是 PID/Program Name
- 第一章 Linux
- 1. Linux安裝和網絡配置
- 2. Linux基本命令
- 3. Xshell和winscp
- 4. VIM編輯器
- 5. 安裝軟件
- 5.1 安裝JDK
- 5.2 安裝TOMCAT
- 5.3 安裝MySql
- 5.4 安裝Nginx
- 5.5 部署工程
- 第二章 Nginx
- 1. 安裝Nginx
- 2. 配置Nginx
- 2.1 配置靜態服務器
- 2.2 配置反向代理
- 2.3 配置負載均衡
- 2.4 配置動靜分離
- 2.5 跨域訪問
- 第三章 Redis
- 1. 安裝Redis
- 2. JAVA操作Redis
- 3. Redis事務
- 4. Redis持久化
- 5. 主從復制和集群
- 6. Redis實現Session共享
- 第四章 MySQL主從復制
- 4.1 MyCat安裝
- 4.2 MySQL主從復制
- 4.3MySQL讀寫分離
- 第五章 ActiveMQ
- 5.1 Queue
- 5.2 Topic
- 第六章 FastDFS圖片服務器
- 第七章