壓縮保留源文件:gzip –c filename > filename.gzshell
打包壓縮不帶路徑: tar -zcfP filename.tar.gz filename(解壓也要帶-P)ip
shell命令ci
file=/home/test/class/1.logit
no_file_path=${file%/*} ###no_file_path=/home/test/classclass
city=${no_file_path##*/} ### city=classtest