for

循环命令.展开单词,并对结果列表中的每个成员执行一次命令,其名称绑定到当前成员

语法

  for name [in words ...]; do commands; done

  for (( expr1 ; expr2 ; expr3 )) ; do commands ; done

实例

循环遍历一组字符串:

for m in Apple Sony Panasonic "Hewlett Packard" Nokia
do
  echo "Manufacturer is:" $m
done

也可以写成一行…

for m in Apple Sony Panasonic "Hewlett Packard" Nokia; do echo "Manufacturer is:" $m;done

循环100次:

for i in $(seq 1 100); do echo -n "Hello World${i} "; done

循环传递给函数的参数:

foo ()
{
    for ARG in "$@";do echo $ARG; done
}

运行它

foo abc 123 "Hello World" 'bash rules'

for 命令实例:

linux命令:for i in *.jpg; do identify -format %[EXIF:DateTimeOriginal] $i; echo; done done echo; $i; %[EXIF:DateTimeOriginal] -format identify do *.jpg; in i for for i in *.jpg; do identify -format %[EXIF:DateTimeOriginal] $i; echo; donerootopen.com
linux命令:for i in *.jpg; do identify -format %[EXIF:DateTimeOriginal] $i; echo; done done echo; $i; %[EXIF:DateTimeOriginal] -format identify do *.jpg; in i for for i in *.jpg; do identify -format %[EXIF:DateTimeOriginal] $i; echo; donerootopen.com
2019-07-09 21:09:41

linux命令:for card in $(pacmd list-cards | grep 'name: ' | sed 's/.*<\(.*\)>.*/\1/'); do pacmd set-card-profile $card a2dp_sink; done done a2dp_sink; $card set-card-profile pacmd do 's/.*<\(.*\)>.*/\1/'); sed | ' 'name: grep | list-cards $(pacmd in card for for card in $(pacmd list-cards | grep 'name: ' | sed 's/.*<\(.*\)>.*/\1/'); do pacmd set-card-profile $card a2dp_sink; donerootopen.com
linux命令:for card in $(pacmd list-cards | grep 'name: ' | sed 's/.*<\(.*\)>.*/\1/'); do pacmd set-card-profile $card a2dp_sink; done done a2dp_sink; $card set-card-profile pacmd do 's/.*<\(.*\)>.*/\1/'); sed | ' 'name: grep | list-cards $(pacmd in card for for card in $(pacmd list-cards | grep 'name: ' | sed 's/.*<\(.*\)>.*/\1/'); do pacmd set-card-profile $card a2dp_sink; donerootopen.com
2019-06-04 22:15:47

linux命令:for i in {1..65535}; do (echo < /dev/tcp/127.0.0.1/$i) &>/dev/null && printf "\n[+] Open Port at\n: \t%d\n" "$i" || printf "."; done done "."; printf || "$i" \t%d\n" at\n: Port Open "\n[+] printf && &>/dev/null /dev/tcp/127.0.0.1/$i) < (echo do {1..65535}; in i for for i in {1..65535}; do (echo < /dev/tcp/127.0.0.1/$i) &>/dev/null && printf "\n[+] Open Port at\n: \t%d\n" "$i" || printf "."; donerootopen.com
linux命令:for i in {1..65535}; do (echo < /dev/tcp/127.0.0.1/$i) &>/dev/null && printf "\n[+] Open Port at\n: \t%d\n" "$i" || printf "."; done done "."; printf || "$i" \t%d\n" at\n: Port Open "\n[+] printf && &>/dev/null /dev/tcp/127.0.0.1/$i) < (echo do {1..65535}; in i for for i in {1..65535}; do (echo < /dev/tcp/127.0.0.1/$i) &>/dev/null && printf "\n[+] Open Port at\n: \t%d\n" "$i" || printf "."; donerootopen.com
2019-06-03 22:33:08

linux命令:for f in *.zip; do unzip -d "${f%*.zip}" "$f"; done done "$f"; "${f%*.zip}" -d unzip do *.zip; in f for for f in *.zip; do unzip -d "${f%*.zip}" "$f"; donerootopen.com
linux命令:for f in *.zip; do unzip -d "${f%*.zip}" "$f"; done done "$f"; "${f%*.zip}" -d unzip do *.zip; in f for for f in *.zip; do unzip -d "${f%*.zip}" "$f"; donerootopen.com
2019-02-25 22:38:07

linux命令:for i in {1..10}; do time some_script.sh; done 2>&1 | grep ^real | sed -e s/.*m// | awk '{sum += $1} END {print sum / NR}' NR}' / sum {print END $1} += '{sum awk | s/.*m// -e sed | ^real grep | 2>&1 done some_script.sh; time do {1..10}; in i for for i in {1..10}; do time some_script.sh; done 2>&1 | grep ^real | sed -e s/.*m// | awk '{sum += $1} END {print sum / NR}'rootopen.com
linux命令:for i in {1..10}; do time some_script.sh; done 2>&1 | grep ^real | sed -e s/.*m// | awk '{sum += $1} END {print sum / NR}' NR}' / sum {print END $1} += '{sum awk | s/.*m// -e sed | ^real grep | 2>&1 done some_script.sh; time do {1..10}; in i for for i in {1..10}; do time some_script.sh; done 2>&1 | grep ^real | sed -e s/.*m// | awk '{sum += $1} END {print sum / NR}'rootopen.com
2018-12-13 23:10:46

linux命令:for i in {1..10}; do time curl http://localhost:8000 >/dev/null; done 2>&1 | grep real real grep | 2>&1 done >/dev/null; http://localhost:8000 curl time do {1..10}; in i for for i in {1..10}; do time curl http://localhost:8000 >/dev/null; done 2>&1 | grep realrootopen.com
linux命令:for i in {1..10}; do time curl http://localhost:8000 >/dev/null; done 2>&1 | grep real real grep | 2>&1 done >/dev/null; http://localhost:8000 curl time do {1..10}; in i for for i in {1..10}; do time curl http://localhost:8000 >/dev/null; done 2>&1 | grep realrootopen.com
2018-12-13 23:09:58

linux命令:for file in $(egrep 'abc|def' *.sql | cut -d":" -f1 | uniq); do sed -i '/abc/d' ./$file ; sed -i '/def/d' ./$file; done done ./$file; '/def/d' -i sed ; ./$file '/abc/d' -i sed do uniq); | -f1 -d":" cut | *.sql 'abc|def' $(egrep in file for for file in $(egrep 'abc|def' *.sql | cut -d":" -f1 | uniq); do sed -i '/abc/d' ./$file ; sed -i '/def/d' ./$file; donerootopen.com
linux命令:for file in $(egrep 'abc|def' *.sql | cut -d":" -f1 | uniq); do sed -i '/abc/d' ./$file ; sed -i '/def/d' ./$file; done done ./$file; '/def/d' -i sed ; ./$file '/abc/d' -i sed do uniq); | -f1 -d":" cut | *.sql 'abc|def' $(egrep in file for for file in $(egrep 'abc|def' *.sql | cut -d":" -f1 | uniq); do sed -i '/abc/d' ./$file ; sed -i '/def/d' ./$file; donerootopen.com
2018-12-13 22:45:11

linux命令:for FILE in *; do tar -jxf $FILE; done done $FILE; -jxf tar do *; in FILE for for FILE in *; do tar -jxf $FILE; donerootopen.com
linux命令:for FILE in *; do tar -jxf $FILE; done done $FILE; -jxf tar do *; in FILE for for FILE in *; do tar -jxf $FILE; donerootopen.com
2018-12-08 16:57:03

linux命令:for i in *.flac; do flac -c -d "$i" | lame -m j -b 192 -s 44.1 - "${i%.flac}.mp3"; done done "${i%.flac}.mp3"; - 44.1 -s 192 -b j -m lame | "$i" -d -c flac do *.flac; in i for for i in *.flac; do flac -c -d "$i" | lame -m j -b 192 -s 44.1 - "${i%.flac}.mp3"; donerootopen.com
linux命令:for i in *.flac; do flac -c -d "$i" | lame -m j -b 192 -s 44.1 - "${i%.flac}.mp3"; done done "${i%.flac}.mp3"; - 44.1 -s 192 -b j -m lame | "$i" -d -c flac do *.flac; in i for for i in *.flac; do flac -c -d "$i" | lame -m j -b 192 -s 44.1 - "${i%.flac}.mp3"; donerootopen.com
2018-12-02 21:35:21

linux命令:for i in $(grep :boss /etc/group | cut -f1 -d:); do adduser wife $i; done done $i; wife adduser do -d:); -f1 cut | /etc/group :boss $(grep in i for for i in $(grep :boss /etc/group | cut -f1 -d:); do adduser wife $i; donerootopen.com
linux命令:for i in $(grep :boss /etc/group | cut -f1 -d:); do adduser wife $i; done done $i; wife adduser do -d:); -f1 cut | /etc/group :boss $(grep in i for for i in $(grep :boss /etc/group | cut -f1 -d:); do adduser wife $i; donerootopen.com
2018-11-26 23:24:43

linux命令:for i in *; do mv "$i" "${i,,}"; done done "${i,,}"; "$i" mv do *; in i for for i in *; do mv "$i" "${i,,}"; donerootopen.com
linux命令:for i in *; do mv "$i" "${i,,}"; done done "${i,,}"; "$i" mv do *; in i for for i in *; do mv "$i" "${i,,}"; donerootopen.com
2018-11-26 23:18:35

linux命令:for f in `find`; do mv -v "$f" "`echo $f | tr '[A-Z]' '[a-z]'`"; done done '[a-z]'`"; '[A-Z]' tr | $f "`echo "$f" -v mv do `find`; in f for for f in `find`; do mv -v "$f" "`echo $f | tr '[A-Z]' '[a-z]'`"; donerootopen.com
linux命令:for f in `find`; do mv -v "$f" "`echo $f | tr '[A-Z]' '[a-z]'`"; done done '[a-z]'`"; '[A-Z]' tr | $f "`echo "$f" -v mv do `find`; in f for for f in `find`; do mv -v "$f" "`echo $f | tr '[A-Z]' '[a-z]'`"; donerootopen.com
2018-11-22 22:56:40

linux命令:for x in 2 4; do /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions $x; done done $x; --partitions --remove_rootfs_verification /usr/share/vboot/bin/make_dev_ssd.sh do 4; 2 in x for for x in 2 4; do /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions $x; donerootopen.com
linux命令:for x in 2 4; do /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions $x; done done $x; --partitions --remove_rootfs_verification /usr/share/vboot/bin/make_dev_ssd.sh do 4; 2 in x for for x in 2 4; do /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions $x; donerootopen.com
2018-11-17 12:59:34

linux命令:for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv *.apk $i.apk 2&> /dev/null ;done ;done /dev/null 2&> $i.apk *.apk mv $2}')"; '{print -F':' awk | $i path pm shell "$(adb pull adb do $2}'); '{print -F':' awk | packages list pm shell $(adb in i for for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv *.apk $i.apk 2&> /dev/null ;donerootopen.com
linux命令:for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv *.apk $i.apk 2&> /dev/null ;done ;done /dev/null 2&> $i.apk *.apk mv $2}')"; '{print -F':' awk | $i path pm shell "$(adb pull adb do $2}'); '{print -F':' awk | packages list pm shell $(adb in i for for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv *.apk $i.apk 2&> /dev/null ;donerootopen.com
2018-11-17 12:57:17

linux命令:for i in `adb shell "su -c find /data /system -name '*.key'"`; do mkdir -p ".`dirname $i`";adb shell "su -c cat $i" > ".$i";done ".$i";done > $i" cat -c "su shell $i`";adb ".`dirname -p mkdir do '*.key'"`; -name /system /data find -c "su shell `adb in i for for i in `adb shell "su -c find /data /system -name '*.key'"`; do mkdir -p ".`dirname $i`";adb shell "su -c cat $i" > ".$i";donerootopen.com
linux命令:for i in `adb shell "su -c find /data /system -name '*.key'"`; do mkdir -p ".`dirname $i`";adb shell "su -c cat $i" > ".$i";done ".$i";done > $i" cat -c "su shell $i`";adb ".`dirname -p mkdir do '*.key'"`; -name /system /data find -c "su shell `adb in i for for i in `adb shell "su -c find /data /system -name '*.key'"`; do mkdir -p ".`dirname $i`";adb shell "su -c cat $i" > ".$i";donerootopen.com
2018-11-17 12:56:47

linux命令:for ((i=1; i<=99; ++i)); do echo $i; done done $i; echo do ++i)); i<=99; ((i=1; for for ((i=1; i<=99; ++i)); do echo $i; donerootopen.com
linux命令:for ((i=1; i<=99; ++i)); do echo $i; done done $i; echo do ++i)); i<=99; ((i=1; for for ((i=1; i<=99; ++i)); do echo $i; donerootopen.com
2018-11-17 11:55:16

linux命令:for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; done done "Unlocked"; echo $i; unlock qm $i; "Unlocking:" echo do VMID); -v grep | }' $1 print '{ awk | list $(qm in i for for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; donerootopen.com
linux命令:for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; done done "Unlocked"; echo $i; unlock qm $i; "Unlocking:" echo do VMID); -v grep | }' $1 print '{ awk | list $(qm in i for for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; donerootopen.com
2018-09-11 09:55:30

linux命令:for f in *;do echo $f;done $f;done echo *;do in f for for f in *;do echo $f;donerootopen.com
linux命令:for f in *;do echo $f;done $f;done echo *;do in f for for f in *;do echo $f;donerootopen.com
2018-09-20 06:32:03

linux命令:for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; done done "Unlocked"; echo $i; unlock qm $i; "Unlocking:" echo do VMID); -v grep | }' $1 print '{ awk | list $(qm in i for for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; donerootopen.com
linux命令:for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; done done "Unlocked"; echo $i; unlock qm $i; "Unlocking:" echo do VMID); -v grep | }' $1 print '{ awk | list $(qm in i for for i in $(qm list | awk '{ print $1 }' | grep -v VMID); do echo "Unlocking:" $i; qm unlock $i; echo "Unlocked"; donerootopen.com
2018-09-11 09:55:30

linux命令:for i in `cat list`; do cp "$i" "$i".bak ; done done ; "$i".bak "$i" cp do list`; `cat in i for for i in `cat list`; do cp "$i" "$i".bak ; donerootopen.com
linux命令:for i in `cat list`; do cp "$i" "$i".bak ; done done ; "$i".bak "$i" cp do list`; `cat in i for for i in `cat list`; do cp "$i" "$i".bak ; donerootopen.com
2018-08-11 21:50:04

linux命令:for i in $(aws ec2 describe-regions --output text --region "" | cut -f 3); do aws ec2 describe-images --output text --region $i --filter Name=name,Values=myimage | cut -f 6 | grep ami* | xargs -I {} aws ec2 deregister-image --region $i --image-id {};done {};done --image-id $i --region deregister-image ec2 aws {} -I xargs | ami* grep | 6 -f cut | Name=name,Values=myimage --filter $i --region text --output describe-images ec2 aws do 3); -f cut | "" --region text --output describe-regions ec2 $(aws in i for for i in $(aws ec2 describe-regions --output text --region "" | cut -f 3); do aws ec2 describe-images --output text --region $i --filter Name=name,Values=myimage | cut -f 6 | grep ami* | xargs -I {} aws ec2 deregister-image --region $i --image-id {};donerootopen.com
linux命令:for i in $(aws ec2 describe-regions --output text --region "" | cut -f 3); do aws ec2 describe-images --output text --region $i --filter Name=name,Values=myimage | cut -f 6 | grep ami* | xargs -I {} aws ec2 deregister-image --region $i --image-id {};done {};done --image-id $i --region deregister-image ec2 aws {} -I xargs | ami* grep | 6 -f cut | Name=name,Values=myimage --filter $i --region text --output describe-images ec2 aws do 3); -f cut | "" --region text --output describe-regions ec2 $(aws in i for for i in $(aws ec2 describe-regions --output text --region "" | cut -f 3); do aws ec2 describe-images --output text --region $i --filter Name=name,Values=myimage | cut -f 6 | grep ami* | xargs -I {} aws ec2 deregister-image --region $i --image-id {};donerootopen.com
2018-07-27 22:26:48

linux命令:for i in *.pdf; do mv "$i" CS749__"$i"; done done CS749__"$i"; "$i" mv do *.pdf; in i for for i in *.pdf; do mv "$i" CS749__"$i"; donerootopen.com
linux命令:for i in *.pdf; do mv "$i" CS749__"$i"; done done CS749__"$i"; "$i" mv do *.pdf; in i for for i in *.pdf; do mv "$i" CS749__"$i"; donerootopen.com
2018-07-14 16:18:38

linux命令:for i in *; do I=`echo $i|cut -c 1|tr a-z A-Z`; if [ ! -d "$I" ]; then mkdir "$I"; fi; mv "$i" "$I"/"$i"; done done "$I"/"$i"; "$i" mv fi; "$I"; mkdir then ]; "$I" -d ! [ if A-Z`; a-z 1|tr -c $i|cut I=`echo do *; in i for for i in *; do I=`echo $i|cut -c 1|tr a-z A-Z`; if [ ! -d "$I" ]; then mkdir "$I"; fi; mv "$i" "$I"/"$i"; donerootopen.com
linux命令:for i in *; do I=`echo $i|cut -c 1|tr a-z A-Z`; if [ ! -d "$I" ]; then mkdir "$I"; fi; mv "$i" "$I"/"$i"; done done "$I"/"$i"; "$i" mv fi; "$I"; mkdir then ]; "$I" -d ! [ if A-Z`; a-z 1|tr -c $i|cut I=`echo do *; in i for for i in *; do I=`echo $i|cut -c 1|tr a-z A-Z`; if [ ! -d "$I" ]; then mkdir "$I"; fi; mv "$i" "$I"/"$i"; donerootopen.com
2018-07-14 16:07:21

linux命令:for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%A); if [ $NDATE == 'Friday' ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; done done echo; done; fi; "; "$PRINTME -n +%B);echo "$y-$m-13" --date PRINTME=$(date then ]; 'Friday' == $NDATE [ if +%A); "$y-$m-13" --date NDATE=$(date do 12); 1 $(seq in m for "; -> "$y -n echo do 2018); 1996 $(seq in y for for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%A); if [ $NDATE == 'Friday' ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; donerootopen.com
linux命令:for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%A); if [ $NDATE == 'Friday' ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; done done echo; done; fi; "; "$PRINTME -n +%B);echo "$y-$m-13" --date PRINTME=$(date then ]; 'Friday' == $NDATE [ if +%A); "$y-$m-13" --date NDATE=$(date do 12); 1 $(seq in m for "; -> "$y -n echo do 2018); 1996 $(seq in y for for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%A); if [ $NDATE == 'Friday' ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; donerootopen.com
2018-07-14 15:48:09

linux命令:for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%w); if [ $NDATE -eq 5 ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; done done echo; done; fi; "; "$PRINTME -n +%B);echo "$y-$m-13" --date PRINTME=$(date then ]; 5 -eq $NDATE [ if +%w); "$y-$m-13" --date NDATE=$(date do 12); 1 $(seq in m for "; -> "$y -n echo do 2018); 1996 $(seq in y for for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%w); if [ $NDATE -eq 5 ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; donerootopen.com
linux命令:for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%w); if [ $NDATE -eq 5 ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; done done echo; done; fi; "; "$PRINTME -n +%B);echo "$y-$m-13" --date PRINTME=$(date then ]; 5 -eq $NDATE [ if +%w); "$y-$m-13" --date NDATE=$(date do 12); 1 $(seq in m for "; -> "$y -n echo do 2018); 1996 $(seq in y for for y in $(seq 1996 2018); do echo -n "$y -> "; for m in $(seq 1 12); do NDATE=$(date --date "$y-$m-13" +%w); if [ $NDATE -eq 5 ]; then PRINTME=$(date --date "$y-$m-13" +%B);echo -n "$PRINTME "; fi; done; echo; donerootopen.com
2018-07-14 15:46:28

linux命令:for i in {2018..2022}-{01..12}-13; do date --date $i +"%Y %B %w" | sed '/[^5]$/d; s/ 5*$//'; done done 5*$//'; s/ '/[^5]$/d; sed | %w" %B +"%Y $i --date date do {2018..2022}-{01..12}-13; in i for for i in {2018..2022}-{01..12}-13; do date --date $i +"%Y %B %w" | sed '/[^5]$/d; s/ 5*$//'; donerootopen.com
linux命令:for i in {2018..2022}-{01..12}-13; do date --date $i +"%Y %B %w" | sed '/[^5]$/d; s/ 5*$//'; done done 5*$//'; s/ '/[^5]$/d; sed | %w" %B +"%Y $i --date date do {2018..2022}-{01..12}-13; in i for for i in {2018..2022}-{01..12}-13; do date --date $i +"%Y %B %w" | sed '/[^5]$/d; s/ 5*$//'; donerootopen.com
2018-07-14 15:45:03

linux命令:for i in {2018..2025}-{01..12}-13; do [[ $(date --date $i +"%u" | grep 5) != 5 ]] || echo "$i Friday the 13th"; done done 13th"; the Friday "$i echo || ]] 5 != 5) grep | +"%u" $i --date $(date [[ do {2018..2025}-{01..12}-13; in i for for i in {2018..2025}-{01..12}-13; do [[ $(date --date $i +"%u" | grep 5) != 5 ]] || echo "$i Friday the 13th"; donerootopen.com
linux命令:for i in {2018..2025}-{01..12}-13; do [[ $(date --date $i +"%u" | grep 5) != 5 ]] || echo "$i Friday the 13th"; done done 13th"; the Friday "$i echo || ]] 5 != 5) grep | +"%u" $i --date $(date [[ do {2018..2025}-{01..12}-13; in i for for i in {2018..2025}-{01..12}-13; do [[ $(date --date $i +"%u" | grep 5) != 5 ]] || echo "$i Friday the 13th"; donerootopen.com
2018-07-13 21:14:48

linux命令:formail -Y -s /usr/sbin/sendmail bar@example.com < /var/mail/foo /var/mail/foo < bar@example.com /usr/sbin/sendmail -s -Y formail formail -Y -s /usr/sbin/sendmail bar@example.com < /var/mail/foorootopen.com
linux命令:formail -Y -s /usr/sbin/sendmail bar@example.com < /var/mail/foo /var/mail/foo < bar@example.com /usr/sbin/sendmail -s -Y formail formail -Y -s /usr/sbin/sendmail bar@example.com < /var/mail/foorootopen.com
2018-05-25 10:10:48

linux命令:for jj in `seq -f "%02.0f" 1 12`; do rr=`ls *S04E$jj*.smi`; tt=`ls *S04E$jj*.avi`; mv "$rr" "${tt%.*}.smi"; done done "${tt%.*}.smi"; "$rr" mv *S04E$jj*.avi`; tt=`ls *S04E$jj*.smi`; rr=`ls do 12`; 1 "%02.0f" -f `seq in jj for for jj in `seq -f "%02.0f" 1 12`; do rr=`ls *S04E$jj*.smi`; tt=`ls *S04E$jj*.avi`; mv "$rr" "${tt%.*}.smi"; donerootopen.com
linux命令:for jj in `seq -f "%02.0f" 1 12`; do rr=`ls *S04E$jj*.smi`; tt=`ls *S04E$jj*.avi`; mv "$rr" "${tt%.*}.smi"; done done "${tt%.*}.smi"; "$rr" mv *S04E$jj*.avi`; tt=`ls *S04E$jj*.smi`; rr=`ls do 12`; 1 "%02.0f" -f `seq in jj for for jj in `seq -f "%02.0f" 1 12`; do rr=`ls *S04E$jj*.smi`; tt=`ls *S04E$jj*.avi`; mv "$rr" "${tt%.*}.smi"; donerootopen.com
2018-05-04 02:54:48

linux命令:for i in $(locate your_search_phrase); do dirname $i; done | sort | uniq uniq | sort | done $i; dirname do your_search_phrase); $(locate in i for for i in $(locate your_search_phrase); do dirname $i; done | sort | uniqrootopen.com
linux命令:for i in $(locate your_search_phrase); do dirname $i; done | sort | uniq uniq | sort | done $i; dirname do your_search_phrase); $(locate in i for for i in $(locate your_search_phrase); do dirname $i; done | sort | uniqrootopen.com
2018-02-26 17:20:48

linux命令:for i in * ; do cp $i $i.bak; done done $i.bak; $i cp do ; * in i for for i in * ; do cp $i $i.bak; donerootopen.com
linux命令:for i in * ; do cp $i $i.bak; done done $i.bak; $i cp do ; * in i for for i in * ; do cp $i $i.bak; donerootopen.com
2018-02-12 14:20:48

linux命令:for i in *.bak ; do nuname=`echo $i | sed 's/\.[^\.]*$//'`; echo renaming $i to $nuname;mv $i $nuname; done done $nuname; $i $nuname;mv to $i renaming echo 's/\.[^\.]*$//'`; sed | $i nuname=`echo do ; *.bak in i for for i in *.bak ; do nuname=`echo $i | sed 's/\.[^\.]*$//'`; echo renaming $i to $nuname;mv $i $nuname; donerootopen.com
linux命令:for i in *.bak ; do nuname=`echo $i | sed 's/\.[^\.]*$//'`; echo renaming $i to $nuname;mv $i $nuname; done done $nuname; $i $nuname;mv to $i renaming echo 's/\.[^\.]*$//'`; sed | $i nuname=`echo do ; *.bak in i for for i in *.bak ; do nuname=`echo $i | sed 's/\.[^\.]*$//'`; echo renaming $i to $nuname;mv $i $nuname; donerootopen.com
2018-04-08 15:36:48

linux命令:for x in `git status | grep deleted | awk '{print $3}'`; do git rm $x; done done $x; rm git do $3}'`; '{print awk | deleted grep | status `git in x for for x in `git status | grep deleted | awk '{print $3}'`; do git rm $x; donerootopen.com
linux命令:for x in `git status | grep deleted | awk '{print $3}'`; do git rm $x; done done $x; rm git do $3}'`; '{print awk | deleted grep | status `git in x for for x in `git status | grep deleted | awk '{print $3}'`; do git rm $x; donerootopen.com
2018-01-05 12:52:48

linux命令:for i in `ps aux | grep httpd | awk '{print $2}'`; do lsof -n -p $i | grep ESTABLISHED; done; done; ESTABLISHED; grep | $i -p -n lsof do $2}'`; '{print awk | httpd grep | aux `ps in i for for i in `ps aux | grep httpd | awk '{print $2}'`; do lsof -n -p $i | grep ESTABLISHED; done;rootopen.com
linux命令:for i in `ps aux | grep httpd | awk '{print $2}'`; do lsof -n -p $i | grep ESTABLISHED; done; done; ESTABLISHED; grep | $i -p -n lsof do $2}'`; '{print awk | httpd grep | aux `ps in i for for i in `ps aux | grep httpd | awk '{print $2}'`; do lsof -n -p $i | grep ESTABLISHED; done;rootopen.com
2017-12-25 23:59:48

linux命令:for x in */*.rar; do unrar x $x; done done $x; x unrar do */*.rar; in x for for x in */*.rar; do unrar x $x; donerootopen.com
linux命令:for x in */*.rar; do unrar x $x; done done $x; x unrar do */*.rar; in x for for x in */*.rar; do unrar x $x; donerootopen.com
2017-12-25 19:48:48

linux命令:for i in $(ls /the/path); do du -hs /the/path/$i; done done /the/path/$i; -hs du do /the/path); $(ls in i for for i in $(ls /the/path); do du -hs /the/path/$i; donerootopen.com
linux命令:for i in $(ls /the/path); do du -hs /the/path/$i; done done /the/path/$i; -hs du do /the/path); $(ls in i for for i in $(ls /the/path); do du -hs /the/path/$i; donerootopen.com
2018-01-10 03:28:48

linux命令:for ip in $(seq 1 25); do ping -c 1 192.168.0.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.0.$ip UP" || : ; done done ; : || UP" "192.168.0.$ip echo && ] 0 -eq $? [ 192.168.0.$ip>/dev/null; 1 -c ping do 25); 1 $(seq in ip for for ip in $(seq 1 25); do ping -c 1 192.168.0.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.0.$ip UP" || : ; donerootopen.com
linux命令:for ip in $(seq 1 25); do ping -c 1 192.168.0.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.0.$ip UP" || : ; done done ; : || UP" "192.168.0.$ip echo && ] 0 -eq $? [ 192.168.0.$ip>/dev/null; 1 -c ping do 25); 1 $(seq in ip for for ip in $(seq 1 25); do ping -c 1 192.168.0.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.0.$ip UP" || : ; donerootopen.com
2018-02-22 13:35:48

linux命令:for File in *.jpg; do mogrify -resize 1024 -quality 96 $File; done done $File; 96 -quality 1024 -resize mogrify do *.jpg; in File for for File in *.jpg; do mogrify -resize 1024 -quality 96 $File; donerootopen.com
linux命令:for File in *.jpg; do mogrify -resize 1024 -quality 96 $File; done done $File; 96 -quality 1024 -resize mogrify do *.jpg; in File for for File in *.jpg; do mogrify -resize 1024 -quality 96 $File; donerootopen.com
2018-03-22 20:45:48

linux命令:for i in $(seq 1 50) ; do echo Iteration $i ; done done ; $i Iteration echo do ; 50) 1 $(seq in i for for i in $(seq 1 50) ; do echo Iteration $i ; donerootopen.com
linux命令:for i in $(seq 1 50) ; do echo Iteration $i ; done done ; $i Iteration echo do ; 50) 1 $(seq in i for for i in $(seq 1 50) ; do echo Iteration $i ; donerootopen.com
2018-01-26 15:12:48

linux命令:for x in *.pgp do `cat /file_with_the_passphrase.dat|(gpg --batch --no-tty --yes --passphrase-fd=0 --decrypt `basename $x`; ) > 'dump_content.dat'` done; done; 'dump_content.dat'` > ) $x`; `basename --decrypt --passphrase-fd=0 --yes --no-tty --batch /file_with_the_passphrase.dat|(gpg `cat do *.pgp in x for for x in *.pgp do `cat /file_with_the_passphrase.dat|(gpg --batch --no-tty --yes --passphrase-fd=0 --decrypt `basename $x`; ) > 'dump_content.dat'` done;rootopen.com
linux命令:for x in *.pgp do `cat /file_with_the_passphrase.dat|(gpg --batch --no-tty --yes --passphrase-fd=0 --decrypt `basename $x`; ) > 'dump_content.dat'` done; done; 'dump_content.dat'` > ) $x`; `basename --decrypt --passphrase-fd=0 --yes --no-tty --batch /file_with_the_passphrase.dat|(gpg `cat do *.pgp in x for for x in *.pgp do `cat /file_with_the_passphrase.dat|(gpg --batch --no-tty --yes --passphrase-fd=0 --decrypt `basename $x`; ) > 'dump_content.dat'` done;rootopen.com
2018-04-16 10:18:48

linux命令:for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $file `echo $file | sed 's/\.pdf$/\.jpg/'`; done done 's/\.pdf$/\.jpg/'`; sed | $file `echo $file 80 -quality 300 -density none -interlace 800 -resize RGB -colorspace -verbose convert do *.pdf`; `ls in file for for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $file `echo $file | sed 's/\.pdf$/\.jpg/'`; donerootopen.com
linux命令:for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $file `echo $file | sed 's/\.pdf$/\.jpg/'`; done done 's/\.pdf$/\.jpg/'`; sed | $file `echo $file 80 -quality 300 -density none -interlace 800 -resize RGB -colorspace -verbose convert do *.pdf`; `ls in file for for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $file `echo $file | sed 's/\.pdf$/\.jpg/'`; donerootopen.com
2018-04-25 18:24:48

linux命令:for file in *.png; do convert "$file" "$(basename $file .png).gif"; done done .png).gif"; $file "$(basename "$file" convert do *.png; in file for for file in *.png; do convert "$file" "$(basename $file .png).gif"; donerootopen.com
linux命令:for file in *.png; do convert "$file" "$(basename $file .png).gif"; done done .png).gif"; $file "$(basename "$file" convert do *.png; in file for for file in *.png; do convert "$file" "$(basename $file .png).gif"; donerootopen.com
2018-03-31 16:55:48

linux命令:for h in host1 host2 host3 host4 ; { scp file user@$h:/destination_path/ ; } } ; user@$h:/destination_path/ file scp { ; host4 host3 host2 host1 in h for for h in host1 host2 host3 host4 ; { scp file user@$h:/destination_path/ ; }rootopen.com
linux命令:for h in host1 host2 host3 host4 ; { scp file user@$h:/destination_path/ ; } } ; user@$h:/destination_path/ file scp { ; host4 host3 host2 host1 in h for for h in host1 host2 host3 host4 ; { scp file user@$h:/destination_path/ ; }rootopen.com
2018-01-12 14:51:48

linux命令:for (( i = 0; i < 100; i++ )); do echo "$i"; done done "$i"; echo do )); i++ 100; < i 0; = i (( for for (( i = 0; i < 100; i++ )); do echo "$i"; donerootopen.com
linux命令:for (( i = 0; i < 100; i++ )); do echo "$i"; done done "$i"; echo do )); i++ 100; < i 0; = i (( for for (( i = 0; i < 100; i++ )); do echo "$i"; donerootopen.com
2018-04-01 11:08:48

linux命令:for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i; done; done; $i; add svn do $2}'); '{print awk | "?" grep | st $(svn in i for for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i; done;rootopen.com
linux命令:for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i; done; done; $i; add svn do $2}'); '{print awk | "?" grep | st $(svn in i for for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i; done;rootopen.com
2018-06-05 23:42:48

linux命令:for I in `echo "show databases;" | mysql | grep -v Database`; do mysqldump $I > "$I.sql"; done done "$I.sql"; > $I mysqldump do Database`; -v grep | mysql | databases;" "show `echo in I for for I in `echo "show databases;" | mysql | grep -v Database`; do mysqldump $I > "$I.sql"; donerootopen.com
linux命令:for I in `echo "show databases;" | mysql | grep -v Database`; do mysqldump $I > "$I.sql"; done done "$I.sql"; > $I mysqldump do Database`; -v grep | mysql | databases;" "show `echo in I for for I in `echo "show databases;" | mysql | grep -v Database`; do mysqldump $I > "$I.sql"; donerootopen.com
2018-04-14 19:44:48

linux命令:for I in `find . -name "*.php"`; do sed -i "s/old name/new name/g" $I; done done $I; name/g" name/new "s/old -i sed do "*.php"`; -name . `find in I for for I in `find . -name "*.php"`; do sed -i "s/old name/new name/g" $I; donerootopen.com
linux命令:for I in `find . -name "*.php"`; do sed -i "s/old name/new name/g" $I; done done $I; name/g" name/new "s/old -i sed do "*.php"`; -name . `find in I for for I in `find . -name "*.php"`; do sed -i "s/old name/new name/g" $I; donerootopen.com
2018-05-22 18:22:48

linux命令:for i in `df -P |grep string|cut -f2 -d%|cut -c2-100`; do umount -l -f $i;done $i;done -f -l umount do -c2-100`; -d%|cut -f2 string|cut |grep -P `df in i for for i in `df -P |grep string|cut -f2 -d%|cut -c2-100`; do umount -l -f $i;donerootopen.com
linux命令:for i in `df -P |grep string|cut -f2 -d%|cut -c2-100`; do umount -l -f $i;done $i;done -f -l umount do -c2-100`; -d%|cut -f2 string|cut |grep -P `df in i for for i in `df -P |grep string|cut -f2 -d%|cut -c2-100`; do umount -l -f $i;donerootopen.com
2018-01-04 17:36:48

linux命令:fortune -s -c -a | cowthink -d -W 45 45 -W -d cowthink | -a -c -s fortune fortune -s -c -a | cowthink -d -W 45rootopen.com
linux命令:fortune -s -c -a | cowthink -d -W 45 45 -W -d cowthink | -a -c -s fortune fortune -s -c -a | cowthink -d -W 45rootopen.com
2018-03-10 13:23:48

linux命令:for i in {001..999}; print $i $i print {001..999}; in i for for i in {001..999}; print $irootopen.com
linux命令:for i in {001..999}; print $i $i print {001..999}; in i for for i in {001..999}; print $irootopen.com
2018-06-03 21:43:48

Linux的Bash命令行(A-Z排序)