- Ubuntu 20.04 Essentials
- Neil Smyth
- 148字
- 2021-06-11 17:39:42
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
- Ansible Quick Start Guide
- 網頁編程技術
- 教父母學會上網
- 永磁同步電動機變頻調速系統及其控制(第2版)
- WordPress Theme Development Beginner's Guide(Third Edition)
- 大型數據庫管理系統技術、應用與實例分析:SQL Server 2005
- 計算機系統結構
- 觸控顯示技術
- 計算機網絡原理與技術
- LMMS:A Complete Guide to Dance Music Production Beginner's Guide
- Linux Shell編程從初學到精通
- 21天學通Linux嵌入式開發
- 寒江獨釣:Windows內核安全編程
- 電腦上網入門
- 漢字錄入技能訓練