Linux命令随笔

cd ..     表示回到上层目录

cd -    表示回到刚才目录

mkdir -p test1/test2/test3  新建多层目录

mkdir -m 711 test2  新建权限为rwx--x--x的目录

echo $PATH 查看当前用户环境变量

ls -al ~  列出属性与隐藏文件

umask -S  目前用户在新建文件或目录时候的权限默认值

file  ~/.bashrc   查看文件类型

which   在环境变量$PATH设置的目录里查找符合条件的文件   eg: which ifconfig

whereis 寻找特定文件    eg:whereis  ifconfig

压缩操作实例

一、cp /etc/manpath.config  /tmp/

       cd /tmp/

       gzip -v manpath.config  压缩文件

       zcat manpath.config        zcat不真正解压缩文件,就能显示压缩包中文件的内容(由于manpath.config文本文件)

二、bzip2 -z manpath.config  (-z 强制执行压缩)

       bzcat  manpath.config.bz2 

       bzip2 -d manpath.config.bz2  (-d 执行解压缩)

grep '^#DEFINE' /etc/manpath.config | head -n 3   将行首为#DEFINE的前三行取出来



      




你可能感兴趣的:(Linux命令随笔)