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

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

主站蜘蛛池模板: 澎湖县| 遂溪县| 罗城| 凌海市| 丰镇市| 西和县| 马鞍山市| 土默特右旗| 上犹县| 陈巴尔虎旗| 康保县| 靖远县| 那曲县| 南京市| 绵阳市| 邯郸县| 通山县| 双柏县| 黑龙江省| 灵丘县| 龙泉市| 垣曲县| 海口市| 梅河口市| 耒阳市| 平罗县| 迁西县| 磐石市| 鄂伦春自治旗| 寿光市| 余干县| 黄梅县| 丰都县| 云南省| 垫江县| 永安市| 宜兴市| 泌阳县| 章丘市| 达拉特旗| 澎湖县|