Shell filename expansion - miraj/tools GitHub Wiki
- ? []
##Questions ####Question 1 what's the difference the * in
grep RESULT *
grep * result.txt
grep "TestCase.*Result=" logfile.txt
grep "Result" *
####Question 2 what happens in this command:
grep * *
####Question 3 What's wrong in this? Since -r is given, will this search in all subfolders? why?
grep -r correctPinControl *.pm
####Examples:
All .c files
ls *.c
All c and h files
ls *.[ch]
All cpp and hpp files
ls *.[ch]pp
All files starts with test
ls test*
All files start with test. and have single character file extension
ls test.?
Question 4
ls *.c
ls sees how many arguments? 1?
Question 5
ls *.c
if there are no .c files in the current folder, what does * expanded to? What's the argument to ls?
Question 5
All files starts with MyShows in MyShows folder
ls MyShows/MyShows*.pm
All files starts with MyShows or Myshows in MyShows folder
ls MyShows/My[sS]hows*.pm
Matches all subfolders of scripts/
ls scripts/*/*.pm.xml