UNIX Exercise Solutions
back to the problems
p1 (ls
/cd
)
cs107
, because of course it was
- in two commands:
cd ..; cd math19
(in one command: cd ../math19
)
.the_actual_triangle_soln.c
p2 (file processing)
wc wordlist.txt
yields 88835
grep celeriac wordlist.txt
yields yes, grep voluter wordlist.txt
yields no
p3 (man
)
tree
tree -L 2
p4 (tab autocompletion)
- "Did you use tab-complete?", I typed
cat z<TAB>
to exploit autocomplete
p5 (filesystem manipulation)
touch breakfast/american/bacon.txt
(you could also use
vim
/emacs
to create the file)
rm lunch/w2_stanford_2020.pdf
mkdir lunch/american; mv lunch/baked_chicken.txt lunch/american
mv supper dinner
rm -r dinner/american/tax2020
cp lunch/american/baked_chicken.txt dinner/american