Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐: 强烈推荐:Ylmf OS 3.0 正式版发布附迅雷高 XP系统下硬盘安装Fedora 14图文教程
搜索:
您的位置: Linux安全网 > Linux入门 > » 正文

通配符及其他!

来源: 未知 分享至:

常用通配符
【*】 代表0个或多个字符
【?】代表一个字母
[root@monitor ~]# ls
test
[root@monitor ~]# ls |grep te??
test
【~】表示当前用户的家目录
【&】将命令变成后台工作
【()】括号内为子shell的起始与结束
【[]】中间为字符组合
e.g
ls *[a-z]*或ls *[A-Z]*
命令是列出含小写字母或大写字母的文件或文件夹
ls *[!0-5]*
列出不含数字0到5的文件或文件夹

【{}】中间为命令区块的组合

补充:(`)可以用$()来代替
[root@Xiaoqiao ~]# echo "there are (`ls |wc -l`) files in this folder"
 
there are (26) files in this folder

[root@Xiaoqiao ~]# echo "there are `ls |wc -l` files in this folder" 
there are 26 files in this folder

[root@Xiaoqiao ~]# echo "there are $(ls |wc -l) files in this folder"          
there are 26 files in this folder



ctrl+m 回车
ctrl+s 暂停屏幕输出
ctrl+q 恢复屏幕输出


 


Tags: 通配 其他 常用通 配符 代表
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史