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

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

主站蜘蛛池模板: 渭源县| 和平区| 尼木县| 淮南市| 武冈市| 桑植县| 武隆县| 临高县| 周口市| 竹溪县| 南丹县| 阿拉尔市| 金坛市| 古田县| 南岸区| 扶风县| 中江县| 萨嘎县| 元阳县| 青浦区| 措美县| 梅河口市| 崇义县| 丰原市| 奉节县| 沭阳县| 略阳县| 枞阳县| 杂多县| 灵宝市| 仁怀市| 萨迦县| 神农架林区| 古田县| 崇左市| 兴义市| 化德县| 紫金县| 祁连县| 浮山县| 芮城县|