zoukankan      html  css  js  c++  java
  • 实用Shell命令备忘

    开场白:这里简单记录一些常用的bash命令,一则备忘,二来希望可以帮助别人解决一些问题。

    1.检测文件是否存在

    if [ -f ./foo.txt ]
    then
        echo the file exists
    fi


    2. 检测目录是否存在

    if [ -d ./test1 ]
    then
    	echo the directory exists
    fi


    3. 让高亮功能一直存在

    androidyue@ubuntu:~/Desktop$ ls | grep s --color=always | more


    4.使用curl批量下载ftp资源

    curl -u user:password 'ftp://10.0.1.5/archive/photo/IMG_[8763-9147].JPG' -O

    5.后台执行程序,在程序后加上&,注意两者之间有一个空格

    androidyue@ubuntu:~/Desktop$ start_eclipse.sh &
    [1] 3749

    6.获取文件信息

    androidyue@ubuntu:~/Pictures/coding$ file flyweight.png 
    flyweight.png: PNG image data, 723 x 311, 8-bit/color RGB, non-interlaced


  • 相关阅读:
    CF293E Close Vertice
    [SCOI2016]幸运数字
    [NOI2003]逃学的小孩
    0302读后感
    1231递归下降语法分析
    1210-有穷自动机
    11.12 评论汇总
    1029语言文法
    0921 词法分析
    0909开启编译原理之路
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3178085.html
Copyright © 2011-2022 走看看