linux常用命令技巧
查找目录dir中后缀为*.c和*.h的文件
用正则
find dir -type f -name '*.[ch]'
不用正则
find dir -type f -name '*.c' -o '*.h'
在目录a下建立目录b,而目录a可能不存在
mkdir -p a/b
查看dir目录下面所有txt文件中含有"string"串的总行数
find dir -type f -name *.txt -exec grep "string" {} \; | wc -l
让所有执器同时执行同一道命令
建立好ssh, 设置环境变量SLAVES指定slaves的地址.
for slave in `cat $SLAVES`; do
ssh $slave $"${@// /\\ }" \
2>&1 | sed "s/^/$slave: /"
done
slaves.sh scp [email protected]:/home/hadoop/.bash_profile ~/
slaves.sh scp [email protected]:/home/hadoop/.bashrc ~/
slaves.sh source ~/.bashrc
slaves.sh source ~/.bash_profile
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20