官术网_书友最值得收藏!

9.7 Filename Shorthand

Many shell commands take one or more filenames as arguments. For example, to display the content of a text file named list.txt, the cat command would be used as follows:

$ cat list.txt

Similarly, the content of multiple text files could be displayed by specifying all the file names as arguments:

$ cat list.txt list2.txt list3.txt list4.txt

Instead of typing in each name, pattern matching can be used to specify all files with names matching certain criteria. For example, the ‘*’ wildcard character can be used to simplify the above example:

$ cat *.txt

The above command will display the content of all files ending with a .txt extension. This could be further restricted to any file names beginning with list and ending in .txt:

$ cat list*.txt

Single character matches may be specified using the ‘?’ character:

$ cat list?.txt

主站蜘蛛池模板: 衢州市| 尼木县| 繁昌县| 鸡东县| 手游| 玉环县| 洛川县| 务川| 通化市| 樟树市| 彰武县| 横山县| 通辽市| 永平县| 遂平县| 延川县| 响水县| 东乌| 曲沃县| 蓬安县| 北票市| 轮台县| 福建省| 同仁县| 江永县| 彝良县| 武夷山市| 金溪县| 临夏县| 临海市| 威信县| 增城市| 临夏县| 玛曲县| 从化市| 晴隆县| 富宁县| 大新县| 兰溪市| 吉安县| 秦安县|