Wildcards and Hidden Files

Wildcards and Hidden Files - Wildcards and Hidden Files In...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Wildcards and Hidden Files In UNIX invisible files start with “.” like .login, .bashrc etc. In these files that start with “.”, the “.” should not be matched with a wildcard. For example “echo *” will not display “.” and “. .”. To do this, you will add a filename that starts with “.” only if the wildcard has a “.” at the beginning.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Wildcards and Hidden Files if (advance (…) ) { if (ent->d_name[0] == ‘.’) { if (arg[0] == ‘.’) add filename to arguments; } } else { add ent->d_name to arguments } }
Background image of page 2
Subdirectory Wildcards Wildcards also match directories inside a path: Eg. echo /p*/*a/b*/aa* To match subdirectories you need to match component by component
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Subdirectory Wildcards /u*/l*/a* /usr/l*/a* /u/l*/a* /unix/l*/a* /usr/lib/a* /usr/local/a* /u/loc/a* /u/lll/a* /unix/lll/a* /usr/lib/aa /usr/lib/abb /usr/local/a12 /u/loc/ar /unix/lll/ap3 /u/lll/atp /unix/l34/a* /unix/lll/ab /unix/l34/a45 /unix/l34/abcd /u/lll/apple /u/loc/aq /usr/local/axz
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

Wildcards and Hidden Files - Wildcards and Hidden Files In...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online