Skip to content

Instantly share code, notes, and snippets.

@zhangdxchn
Last active February 10, 2020 06:05
Show Gist options
  • Save zhangdxchn/20b66f8f0b1c73bf14eee551c4459aa8 to your computer and use it in GitHub Desktop.
Save zhangdxchn/20b66f8f0b1c73bf14eee551c4459aa8 to your computer and use it in GitHub Desktop.
Linux Shell +
> find / -name FILE_NAME
> ps -ef | grep tomcat | awk '{print "kill -9 " $2}' | sh
> ln -s full-path-to-mysql-os  /usr/local/mysql
> unlink /usr/local/mysql
> curl -XGET --header 'Content-Type: application/json'
> curl -XGET -H 'Content-Type: application/json'

# 打印目录树中文
> tree -N

# 加密
zip -P 123 xxx.zip xxx/

# 后台
nohup <command> > 1.log 2>&1 &
nohup <command> > /dev/null 2>&1 &

# 合并文件夹
> rsync -av source target

> uname -r
2.6.32-642.6.2.el6.x86_64

#or lsb_release -a
> cat /etc/redhat-release  
CentOS release 6.8 (Final)

# Centos 下载
> yum install --downloadonly --downloaddir=<directory> <package>

# 离线文档
> wget -m -c -np -k -E -p [url]
> wget -m -c -np -k -E -H -D [urls] -p [url]

# ssh
> ssh -i ./me.key root@[ip]
> ssh-copy root@[ip]
## upload
> scp -i ./me.key a.txt root@[ip]:/root/a.txt
## download
> scp -i ./me.key root@[ip]:/root/a.txt a.txt

## 生成加密长度4096位密钥 
> ssh-keygen -t rsa -b 4096 -f ${private}.key
## 生成加密长度1024位密钥 
> ssh-keygen -t rsa -b 1024 -f ${private}.key
## 生成加密长度1024位密钥
> openssl genrsa -out rsaprivatekey.pem 1024

# 格式化json
> cat josn.txt | jq . > josn.josn

> echo -n "123456" | md5sum     

>vi /etc/environment
>#add these lines...
>LANG=en_US.utf-8
>LC_ALL=en_US.utf-8


> yum -y update && yum -y upgrade
> #Or
> yum -y install yum-cron
> vi /etc/yum/yum-cron.conf
download_updates = yes
apply_updates = yes	

#no redis-cli, use telnet
telnet 127.0.0.1 6379

# `date +%Y-%m-%d-%s`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment