$ netstat
$ netstat ip port
$ tcpdump -Xns0 port 9229
$ ps -ef|grep port
$ lsof -i:port
$ curl ifconfig.me/all.xml
$ md5sum file
$ python -m json.tool somejson.txt
$ zip -r ./xahot.zip ./* -r表示递归
$ zip [参数] [打包后的文件名] [打包的目录路径]
$ zip –q –r xahot.zip /home/wwwroot/xahot
$ tar zcvf FileName.tar.gz DirName
$ tail -f 文件
$ df -h
$ du -sh *
$ top
$ ps
ps -ef|grep defunct
scp [参数] [原路径] [目标路径]
$ scp -r file.tar.gz path
$ ll /proc/pid
$ useradd testuser
$ passwd testuser
$PATH:决定了shell将到哪些目录中寻找命令或程序,PATH的值是一系列目录,当您运行一个程序时,Linux在这些目录下进行搜寻编译链接。
$ echo $PATH
$ export PATH=/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH
- 与用户(user)相关的配置文件; /etc/passwd 注:用户(user)的配置文件; /etc/shadow 注:用户(user)影子口令文件;
- 与用户组(group)相关的配置文件; /etc/group 注:用户组(group)配置文件; /etc/gshadow 注:用户组(group)的影子文件
vim 技巧
- 格式化全文指令 gg=G
- 自动缩进当前行指令 ==
- 格式化当前光标接下来的8行 8=
- 格式化选定的行 v
- 选中需要格式化的代码段 =
:$ 跳转到最后一行 :1 跳转到第一行 第二种方式
shift+g 跳转到最后一行 gg 跳转到第一行
ooooooo 方便日后用,主要是在my.ini文件中,配置skip-grant-tables,略过验证,然后再更新里面的密码设置。 具体步骤: 1、修改my.ini配置文件,添加skip-grant-tables 2、重启mysql服务 3、登录mysql,并设定新的密码 4、删除my.ini配置文件中的skip-grant-tables 5、重启mysql服务并登录
- 修改my.ini配置文件,添加skip-grant-tables
#编辑mysql配置文件
vim /etc/my.cnf
#添加
skip-grant-tables
2、重启mysql服务
service mysql restart
#新的mysql执行这个命令
systemctl restart mysqld.service
3、登录mysql,并设定新的密码
#连接mysql,直接回车即可,不需要输入密码
mysql -u root -p
#更新root用户密码
update mysql.user set authentication_string=password('yellowcong') where user='root' and Host = 'localhost';
#刷新权限
flush privileges;
#推出mysql
exit 或者 quit
4、删除my.ini配置文件中的skip-grant-tables
vim /etc/my.cnf
#注释掉skip-grant-tables
5、重启mysql服务并登录
service mysql restart
mysql -uroot -pyellowcong
crudini
crudini --set [--existing] config_file section [param] [value]
crudini --get [--format=sh|ini] config_file [section] [param]
crudini --del [--existing] config_file section [param]
crudini --merge [--existing] config_file [section]