Tag: shell

  • ‘rsync’ command source and destination explained

    ‘rsync’ command source and destination explained

    rsync command is super useful because it could incrementally sync files between locations without the overhead of compressing and transferring. There are heaps of tutorials about how to use it, how very few cover the point that how to sync two folders, which I believe is the most common use. I’d run rsync -avzP dir1 […]

  • Bash速成

    条件语句(注意:条件里两边的空格,引号,等号) if [ “$var” = “abc” ]; then … elif [ “$var” = “ac” ]; then … else … fi for循环 for var in $(ls *.sh); do echo $var done while循环 var=1 while [ “$var” -le 20 ] ; do var=$(($var+1)) done until循环(跟while循环相反的) until condition do … done case条件(可用正则,;;相当于break) case “$var” in yes | YES […]

  • 交互式shell编程利器expect


  • Linux中文件和目录的权限问题


  • php-cli简介——不会Shell语言,一样用Shell!