Need help on Tutorial 5, Question 9
Moderator: drgrussell
Need help on Tutorial 5, Question 9
Hi ,
question is -Use ls -l and grep to find all the files in the directory /etc that were last modified in August (hint: try looking for the case sensitive string "Aug"). Send this list to s6
I tried the below commands but its still failing, could anyone please help
1 ls -al /etc/ | grep 'Aug'
2 ls -al /etc/ | grep 'Aug' | grep -v '^d' (thinking only files are needed in s6)
3 ls -al /etc/ | grep "Aug" | grep -v '^d' > s6
s6 is populated with files as per above command. Not sure why its still failing.
Regards,
Pallab
question is -Use ls -l and grep to find all the files in the directory /etc that were last modified in August (hint: try looking for the case sensitive string "Aug"). Send this list to s6
I tried the below commands but its still failing, could anyone please help
1 ls -al /etc/ | grep 'Aug'
2 ls -al /etc/ | grep 'Aug' | grep -v '^d' (thinking only files are needed in s6)
3 ls -al /etc/ | grep "Aug" | grep -v '^d' > s6
s6 is populated with files as per above command. Not sure why its still failing.
Regards,
Pallab
-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Need help on Tutorial 5, Question 9
dont use -a
Re: Need help on Tutorial 5, Question 9
Hi drgrussell,
Thanks a lot for the reply, It was successful. One more question cropped up, the output(ls -al and ls -a with grep) seems same, but the size for file is different when i use -a option and without it. Whys is so?
Thanks a lot for the reply, It was successful. One more question cropped up, the output(ls -al and ls -a with grep) seems same, but the size for file is different when i use -a option and without it. Whys is so?
-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Need help on Tutorial 5, Question 9
Could be any number of reasons, such as the columns being slightly more spaced out, or even the inclusion of a hidden file you have not spotted.
Remember the check buttons do look for an exact match generally to what I think you should be doing at that stage, so where you include extra flags which may not change the information being requested, it may change the actual file, and thus be marked wrong.
Best to stick with the question specification tightly in general.
Remember the check buttons do look for an exact match generally to what I think you should be doing at that stage, so where you include extra flags which may not change the information being requested, it may change the actual file, and thus be marked wrong.
Best to stick with the question specification tightly in general.
Re: Need help on Tutorial 5, Question 9
I used this command but it didn't work ls -l /etc | grep 'Aug' | grep -v '^d' >> s6
-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Need help on Tutorial 5, Question 9
Forget the second grep for d and use > not >>
Re: Need help on Tutorial 5, Question 9
Thank very much, I followed your instructions, but I am still failing
I used this command, but it is still failing ls -l /etc | grep 'Aug' | grep -v '^d' > s6
I also used this command ls -l /etc | grep 'Aug' | grep '^-' > s6 to see if it will work, but it still failed I am out of options. Please help me I am out options.
Regards,
Moolorun
I used this command, but it is still failing ls -l /etc | grep 'Aug' | grep -v '^d' > s6
I also used this command ls -l /etc | grep 'Aug' | grep '^-' > s6 to see if it will work, but it still failed I am out of options. Please help me I am out options.
Regards,
Moolorun
-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Need help on Tutorial 5, Question 9
As I said, forget the second grep.
You are making it too complex. No need to check for it being a file or directory. Later on we worry about that, but for now just stick with
ls -l /etc | grep 'Aug' > s6
Best of luck.
You are making it too complex. No need to check for it being a file or directory. Later on we worry about that, but for now just stick with
ls -l /etc | grep 'Aug' > s6
Best of luck.
Who is online
Users browsing this forum: No registered users and 1 guest