课程: Linux: System Information and Directory Structure Tools
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Using globs to match file patterns - Linux教程
课程: Linux: System Information and Directory Structure Tools
Using globs to match file patterns
- [Instructor] One of the reasons that manipulating files on the command line can be faster and more efficient than the GUI is file globbing. File globbing uses patterns containing wild cards to match files based on their names. For instance, if you wanted to list all file names starting with the word file followed by an extension, you could use ls file*. This glob can be used with any command as the globing is handled by the shell itself. You can practice the globs in this video using the files that I've provided in this chapter's directory of the exercise files archive. The first wild card we'll cover is the asterisk. An asterisk matches zero or more of any type of character. It matches everything and nothing. Let me explain. In this example, I'm using a glob of file*. The asterisk would match the letters .txt, .jpg, and .tar.gz, but it would also match a file named file. The reason for this is that file doesn't have any…