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

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

主站蜘蛛池模板: 平安县| 芜湖县| 枝江市| 平安县| 大姚县| 韶关市| 瑞昌市| 沁水县| 大港区| 黄冈市| 历史| 康保县| 皮山县| 阳朔县| 安溪县| 贵南县| 曲水县| 伊春市| 肇庆市| 石嘴山市| 海城市| 玉山县| 梓潼县| 台北市| 东丰县| 巨野县| 富民县| 彭水| 翁牛特旗| 绿春县| 威信县| 昌邑市| 聂荣县| 宾川县| 蓝田县| 凯里市| 白朗县| 滦南县| 容城县| 宣武区| 昭通市|