This shows you the differences between two versions of the page.
|Both sides previous revision Previous revision|
journal:spring2019:bmurphy7:week4 [2019/02/13 15:32]
journal:spring2019:bmurphy7:week4 [2019/02/13 16:11] (current)
|Line 2:||Line 2:|
|====February 13, 2019====||====February 13, 2019====|
|+||So in this week of Unix we learned about Wildcards which are “commands” that allow us to simplify our commands, or in the case of //ls// allow us to narrow down what we are searching for. There are four wildcards “? , *, , [^]” which means match any one character, match 0 or more of any character, match 1 of any of enclosed characters, and do **__NOT__** match one of any enclosed characters, respectfully. The best way to show how it works is with the //ls// command. The ? means that for each ? //ls// will display every file that has that many characters, so //ls ????// will display all files that are 4 characters long. The * means that everything from here to a new character is fair game, for instance //ls *// will display all files in the directory for we say show us all files that have 1 or more characters in their name, note that it will use every character. Now if we do //ls c*// we will see every file that starts with c. //ls *c*// will show all files that contain a “c”, since * can also be no characters, and //ls *c*c*// will show all files that contain two or more c’s. The  means that any characters in it can be used, so //ls [ct]*// will mean show all files that start with a “c” or a “t”. While //ls [c-t]*// will show all files that start with any letter from “c” to “t.” The final wildcard [^] means that whatever is in here is wrong so do not use these, for stance //ls [^ct]// means show all files that start with any letter that is not a “c” or “t.” |