[关闭]
@bornkiller 2014-08-12T06:20:15.000000Z 字数 908 阅读 2855

linux 文件目录操作

linux


文件位置查阅

ls

cp, mv, rm

touch

basename, dirname

  1. basename /home/static/default.conf
  2. default.conf
  3. basename /home/static/default.conf .conf
  4. default
  5. dirname /home/static/default.conf .conf
  6. /home/static

文件内容查阅

cat (输出全部内容)

tac(输出全部内容,两者显示顺序不同)

more(分页输出内容)

less (分页输出内容)

tail, head

命令与文件的查询

which command 根据$PATH变量寻找对应的可执行文件

  1. ##command
  2. which ifconfig
  3. ##result
  4. /bin/ifconfig

whereis filename 依据数据库查询文件

  1. ##command
  2. whereis ifconfig
  3. ##result
  4. ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz

locate keyword

find

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注