Update OS/bash/Week2/answers.md

This commit is contained in:
Aadit Agrawal 2025-01-14 15:13:53 +05:30
parent 800dcbc077
commit 277bd63efa

View File

@ -7,6 +7,7 @@ Q2.
- `grep ' ' *` - `grep ' ' *`
- `grep '[0-9]' filename > outputfile` - `grep '[0-9]' filename > outputfile`
Q3. - `grep -c "ICT" ITStudents.txt` Q3. - `grep -c "ICT" ITStudents.txt`
- `sed 's/:IT:/:Information Technology:/g' students.txt > ITStudents.txt` - `sed 's/:IT:/:Information Technology:/g' students.txt > ITStudents.txt`
- `sed awk -F: '$1 == "1234" { avg = ($6 + $7 + $8) / 3; print avg }' students.txt` - `sed awk -F: '$1 == "1234" { avg = ($6 + $7 + $8) / 3; print avg }' students.txt`
@ -15,7 +16,9 @@ Q3. - `grep -c "ICT" ITStudents.txt`
Q4. - `grep -rl "MIT" . | xargs sed -i 's/MIT/Manipal Institute of Technology/g'` Q4. - `grep -rl "MIT" . | xargs sed -i 's/MIT/Manipal Institute of Technology/g'`
Q5. - `find . -type f -name '*[0-9]*' -exec wc {} +` Q5. - `find . -type f -name '*[0-9]*' -exec wc {} +`
Q6. - `for i in {1..5}; do wc example.txt & done` Q6. - `for i in {1..5}; do wc example.txt & done`
- `pkill wc` - `pkill wc`