* 无数个任意字符
? 单一任意字符
[] 括号中的任意一个字符
通配符实例
ls *.conf 匹配任意.conf结尾的文件或目录
ls /home/*.txt 匹配home目录下的.txt的文件
ls h*.conf 匹配h开头,.conf结尾的文件
ls test?.aa 匹配test,?单一个字符.aa结尾文件
ls [abc]* 匹配括号中的任意一个字符
获得帮助
命令 --help
man 命令
info 命令
文件类型
(-)普通文件
(d)目录
(l)符号链接
(c)字符设备文件
(b)块设备文件
(s)套接字文件
(p)命名管道
文件与目录操作
ls 显示指定文件或者目录 ls -al
-l显示详细信息 -a显示隐藏文件
pwd 显示当前目录地址
cd 进入指定目录 cd home/
cd / 返回/根目录下
mkdir 创建指定名称的目录
mkdir name
rmdir 删除指定名称的目录
文件操作目录
file 显示指定文件的类型
file etc/passwd
返回:etc/passwd: ASCII text
touch 建立指定名称的文件或者更新文件的时间
touch filename
cp 复制文件或目录
cp filename copyfilename
rm 删除文件或目录
rm filename
rm -rf filename 删除目录,及下面的所有的文件和目录,不提醒用户
mv 移动文件或目录,文件或目录重命名
mv filename /home
文本文件查看命令
cat 全部显示文本文件内容
cat filename
more 分页显示文本文件内容
more etc/passwd
退出按q
less 分页显示文本文件内容
more etc/passwd
退出按q
head 显示文件首部文件内容
head -5 etc/passwd 显示头5行信息
tail 显示文件尾部内容
tail -5 etc/passwd
显示尾部5行信息