find ./ -maxdepth 2 -type d -exec bash -c 'n=$(find {} -maxdepth 1 -type f -printf x | wc -c); echo "{} $n"' \; |sort -k2n
查看Linux内核/系统版本
cat /proc/version
1 2
cat /proc/version Linux version 5.5.13-arch2-1 (linux@archlinux) (gcc version 9.3.0 (Arch Linux 9.3.0-1)) #1 SMP PREEMPT Mon, 30 Mar 2020 20:42:41 +0000
uname -a
1 2
uname -a Linux sds0 5.5.13-arch2-1 #1 SMP PREEMPT Mon, 30 Mar 2020 20:42:41 +0000 x86_64 GNU/Linux
-r 只看内核号
lsb_release -a
1 2 3 4 5 6
lsb_release -a LSB Version: 1.4 Distributor ID: Arch Description: Arch Linux Release: rolling Codename: n/a
cat /etc/issue
1 2
cat /etc/issue Arch Linux \r (\l)
curl 部分用法
模拟浏览器发送get请求
1
curl http://www.baidu.com
发送POST请求
1
curl -X POST -d "flagpls=flagpls" http://ip
在浏览器开发者工具存储器中可设置cookie
获取可进行的请求
1
curl http://..... -X OPTIONS -v
设置User-agent,不设置ua默认的是curl/curl的版本号
1 2 3 4
User-Agent: curl/7.64.1
那么怎么设置呢? -A, --user-agent <name> Send User-Agent <name> to server
1
curl www.baidu.com -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36'
如果抓包的话就会发现请求包头的UA字段变成了上面那个了。
wget部分用法
wget设置UA下载
1
wget --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" url
select count(1) from table into outfile '/tmp/test.xls';
有可能就英文secure_file_priv或者是mysql权限的原因导致无法写入。
命令行写
1
mysql -h 127.0.0.1 -u root -p XXXX -P 3306 -e "select * from database.table" > /tmp/test/txt
ssh-keygen生产私钥对
1
ssh-keygen rsa 4096 -f a.key
SSH
Unable to negotiate with 10.129.131.134 port 22022: no matching key exchange method found. Their offer: gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1