Assistance on work Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
- The problem statement, all variables and given/known data:
Files stored in /bin, /sbin, /usr/bin, and /usr/sbin vary in their respective sizes. In fact, there are 244 different sizes if we do not count the zero byte files. Create a command line that proves this and stores the answer, 244, in a files named sizes.txt.
On how many lines does �state� (in any case) appear in any and all of the files in /usr/dict/? Your answer should be a total, not a count per file
-
Relevant commands, code, scripts, algorithms:
See below? -
The attempts at a solution (include all code and scripts):
- du -a /{,usr/}{,s}bin | sort -nu | grep -v ^0 | wc -l > ~/sizes.txt
- 248
I am close but i cant figure out how or why it counts the directories themselves
grep -i "state" /usr/dict/* | wc -l
-- 731
grep -i " state " /usr/dict/* | wc -l
-- 45
grep -i "\<"state"\>" /usr/dict/* | wc -l
--110
These all give me different counts...i know some are looking for just the word state and others occurrences of "state" but i when i do occurrences of "state" its not everyone of them...
- Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
KeeneStateCollege(KSC), Keene(NH), USA, Charlie W., CS-215-01 Unix
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).