mirror of
https://github.com/wahyd4/knowledge.git
synced 2026-08-09 05:06:28 +10:00
Make linux become a standalone page
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
- [Devops](categories/devops.md)
|
||||
- [Docker](categories/devops/docker.md)
|
||||
- [Incident Management](categories/devops/incident.md)
|
||||
- [Linux](categories/devops/linux.md)
|
||||
- [Web](categories/web.md)
|
||||
- [Success Team Work](categories/team-work.md)
|
||||
- [Uncategorised](categories/uncategorised.md)
|
||||
|
||||
+1
-21
@@ -10,26 +10,6 @@
|
||||
- Gitlab CI
|
||||
- Travis
|
||||
|
||||
# Linux
|
||||
- ssh
|
||||
- IP table
|
||||
- Cron job
|
||||
- ps aux
|
||||
- tail
|
||||
- nohup
|
||||
- df -h
|
||||
- free
|
||||
- Tips
|
||||
- Change timezone
|
||||
- TZ=Asia/Shanghai;ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
|
||||
- Check release
|
||||
- cat /etc/*-release
|
||||
- Packages
|
||||
- htop
|
||||
- like top, but more
|
||||
- mosh
|
||||
- auto reconnect ssh
|
||||
|
||||
# Everything is code
|
||||
- Infrastructure as code
|
||||
- CI config as code
|
||||
@@ -98,4 +78,4 @@ terraform apply # Apply changes to cluster
|
||||
- oh-my-zsh
|
||||
- IDE/tools
|
||||
- Intellij
|
||||
- vscode
|
||||
- vscode
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# Linux
|
||||
|
||||
## Useful commands and tips
|
||||
|
||||
### ssh
|
||||
Do not use default `22` port
|
||||
```bash
|
||||
ssh user@ip -p 22222
|
||||
```
|
||||
### IP table
|
||||
### Cron job
|
||||
|
||||
### PS
|
||||
```bash
|
||||
ps aux | grep 'ruby'
|
||||
```
|
||||
List process, using `grep` to filter processes
|
||||
### tail
|
||||
Tailing texts from file in realtime
|
||||
|
||||
```bash
|
||||
tail -f a.log
|
||||
```
|
||||
`f` means following, auto append texts to console
|
||||
### nohup
|
||||
Simply running application in background
|
||||
|
||||
|
||||
### df
|
||||
```bash
|
||||
df -h
|
||||
```
|
||||
Show disk usage and left, `h` means show in human readable way. Normally by MB/GB.
|
||||
### free
|
||||
```bash
|
||||
total used free shared buff/cache available
|
||||
Mem: 3960624 416720 270024 22252 3273880 3264060
|
||||
Swap: 4104188 109688 3994500
|
||||
```
|
||||
Show memory usage and
|
||||
|
||||
### Watch
|
||||
```
|
||||
watch kubectl get pods
|
||||
```
|
||||
Continuous running the commands, watching the changes. By default it refresh the result every `2s`.
|
||||
|
||||
### Change timezone
|
||||
```bash
|
||||
TZ=Asia/Shanghai;
|
||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
|
||||
```
|
||||
|
||||
### Check release
|
||||
```bash
|
||||
cat /etc/*-release
|
||||
```
|
||||
|
||||
### Debian check system version
|
||||
```bash
|
||||
cat /etc/issue
|
||||
|
||||
cat /etc/debian_version
|
||||
```
|
||||
|
||||
### htop
|
||||
like top, but more
|
||||
|
||||
#### mosh
|
||||
auto reconnect ssh
|
||||
|
||||
### show last something time
|
||||
|
||||
```bash
|
||||
last shutdown
|
||||
last reboot
|
||||
```
|
||||
|
||||
### Count files in current folder
|
||||
|
||||
```bash
|
||||
find . -type f | wc -l
|
||||
```
|
||||
Reference in New Issue
Block a user