UNIX Tutorial Four
2015-08-20 17:59
134 查看
UNIX Tutorial Four
http://www.ee.surrey.ac.uk/Teaching/Unix/unix4.html4.1 Wildcards
The * wildcard
The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example, in yourunixstuff directory, type% ls list*
This will list all files in the current directory starting with
list....
Try typing
% ls *list
This will list all files in the current directory ending with
....list
The ? wildcard
The character? will match exactly one character.
So ?ouse will match files like house and
mouse, but not grouse.
Try typing
% ls ?list
4.2 Filename conventions
We should note here that a directory is merely a special type of file. So the rules and conventions for naming files apply also to directories.In naming files, characters with special meanings such as / * & % , should be avoided. Also, avoid using spaces within names. The safest way to name a file is to use only alphanumeric characters, that is, letters and numbers, together with
_ (underscore) and . (dot).
Good filenames | Bad filenames |
---|---|
project.txt | project |
my_big_program.c | my big program.c |
fred_dave.doc | fred & dave.doc |
prog1.c . Then in order to list all files containing C code in your home directory, you need only typels *.c in that directory.
4.3 Getting Help
On-line Manuals
There are on-line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behaviour of the command. Typeman commandto read the manual page for a particular command.
For example, to find out more about the
wc (word count) command, type
% man wc
Alternatively
% whatis wc
gives a one-line description of the command, but omits any information about options etc.
Apropos
When you are not sure of the exact name of a command,% apropos keyword
will give you the commands with keyword in their manual page header. For example, try typing
% apropos copy
Summary
Command | Meaning |
---|---|
* | match any number of characters |
? | match one character |
man command | read the online manual page for a command |
whatis command | brief description of a command |
apropos keyword | match commands with keyword in their man pages |
相关文章推荐
- SQL Server 创建链接服务器
- STL:关键概念
- Java中堆、栈、常量池等概念解析
- AOP
- ZooKeeper
- MUI - 打开页面默认弹出键盘及返回关闭键盘
- odoo view field option, action flage 参数
- Jquery 实现 点击按钮后倒计时效果,多用于实现发送手机验证码、邮箱验证码
- 黑马程序员——Java基础语法(二)---函数与数组
- https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/
- LayoutInflater那些事儿
- HTML+js写的简单的打地鼠游戏,还有待完善
- org.apache.hadoop.yarn.conf.ConfigurationProviderFactory分析加载配置文件两种方式
- html5读取本地文件,图片预览
- 19、XHTML
- Sencha Touch CRUD
- 虚拟机时间问题引起的hadoop集群时间问题
- C++开源库
- Android 相对布局
- Android FrameLayout子view居中(左居中,右居中)等