bash
for i in `ls *.txt`; do mv $i ${i%.txt}.md; done
bash
echo '127.0.0.1' | sed -n '/[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+/p'
bash
find / | grep -vE "要搜的字符" nasm .txt gcc
bash
awk '{ sum += $1 }; END { print sum }' filename
awk -F: '{ print $1 }' | cat /etc/passwd
bash
for i in `curl <url> | tr -cs '[:alnum:]' ' ' | sort -u`;
do
echo $i >> <filename>;
done
bash
url="<url>"
curl url | grep -Eo 'href="[^\"]+"' | sed 's/href=//; s/\"//g' | while read line; do
if [[ $line == /* ]] || [[ $line =~ ^https?:// ]]; then
echo $line
else
echo "${url}${line}"
fi
done
标签:do,随笔,echo,done,line,txt,bash
From: https://www.cnblogs.com/userhhh/p/17450156.html