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

    expect是交互式shell编程的利器,可以根据返回值来确定下面发送什么命令,特别好用。

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

    最近搞了几个VPS玩,VPS一般来说内存都不多,配置轻量级的Nginx+PHP,折腾当中权限问题搞了半天

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

    php可以用来做动态网页,当初php就是为做动态网页而开发的语言,但是理论上php可以用来做任何的程序,甚至是桌面程序,而php-cli是php在命令行运行的支持环境,也就是我们说的可以用来写Shell的环境支持