ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
``` https_proxy=http://username:password@proxy.example.com command 2>&1 | tee output.txt # print to stdout and file chmod -Rv a-x,u=rwX,go=rX /data # 把data目录及子目录下所有文件的权限设为644,所有目录的权限设为755 sed -i "s#search#replace#g" file # 替换file文件中的字符串 grep "search" * -R | awk -F: '{print $1}' | sort | uniq | xargs sed -i "s#search#replace#g" # 替换当前目录及子目录下所有文件中的search内容 find . -type f -name "*.gz" -delete # 删除当前目录及子目录下,type为f(表示普通文件)、名字以.gz结尾的文件 date -s "xxxx-xx-xx xx:xx:xx" # 设置时间 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 设置时区 hostnamectl set-hostname xxx hostnamectl ste-hostname ${HOSTNAME,,} # 主机名大写to小写 lsof /path/file # 查看哪个进程在使用这个文件 lsof -p <pid> # 查看进程打开的文件 lsof -i:3306 # 查看端口号为3306的进程所打开的文件 dig -t A xxx.default.svc.cluster.local. @10.96.0.10 # DNS查询 nslookup xxx.default.svc.cluster.local. 10.96.0.10 # DNS查询 "ctrl" + "]" # telnet退出方式 nohup command > file.log 2>&1 & # 后台执行命令,并只把输出打印到file.log中 ```