rpm2cpio xxx.rpm | cpio -div
例如:
rpm2cpio vim-8.2.2918-1.1.x86_64.rpm | cpio -div
33篇 shell related articles
rpm2cpio xxx.rpm | cpio -div
例如:
rpm2cpio vim-8.2.2918-1.1.x86_64.rpm | cpio -div
直接scp加参数 -o "StrictHostKeyChecking no"
scp -o "StrictHostKeyChecking no" -i /root/key xxx.qcow2 192.168.1.100:/opt/vm/
文件系统挂了,变成只读模式。supervisor无法启动,就连ping 域名时无法解析dns,想要修改/etc/resolve.conf,只读也写不进去。
试下往临时目录写也是这:
touch /tmp/aaa.txt
touch: cannot touch '/tmp/aaa.txt': Read-only file system
You can use vim programmatically with the option -c {command} :
Dos to Unix:
vim file.txt -c "set ff=unix" -c ":wq"
Unix to dos:
vim file.txt -c "set ff=dos" -c ":wq"
"set ff=unix/dos" means change fileformat (ff) of the file to Unix/DOS end of line format
":wq" means write file to disk and quit the editor (allowing to use the command in a loop)
使用iptables进行端口转发,如下,需要访问原主机的27017端口,但是没开放,只开放了5000-6000之间的端口,因此 需要映射 一个5027端口去访问27017 这个mongodb。
iptables -t nat -A PREROUTING -p tcp --dport 5027 -j DNAT --to-destination :27017
列表:
iptables -t nat --list
删除
PREROUTING 后跟的index 索引从1开始
iptables -t nat --delete PREROUTING 2
Things like this:
It brings useless word when we copy and paste the output.
To avoid this, we can use setTimeout
with a console.log.bind
:
setTimeout (console.log.bind (console, "This is a sentence."));
It's clean now!
Simply as
wget -i url.txt
url.txt is multple urls in each line. Like this:
https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3302399998,3216746631&fm=26&gp=0.jpg
https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1588620919,359805583&fm=26&gp=0.jpg
BTW, it's very fast.
for x in {a..z}
do
echo "$x"
mkdir -p path2/${x}
mv path1/${x}*.ext path2/${x}
done
One line with upper case example:
for letter in {A..Z} ; do wget http://www.abc.com/Letter_${letter}_Cap.gif;done;
bash中如何实现条件判断?
条件测试类型:
在Linux,你是不是曾经天真的以为,使用rm删除一个文件,占用的空间就释放了?事情可能不是常常如人意。