UNIX/Linux Shell CheatSheet : free A4
PDF (52Kb) |
PNG (90Kb)
/tmp/a
into /tmp/b. All the .txt files? All the .html files?
$ cp /tmp/a/* /tmp/b/ $ cp /tmp/a/*.txt /tmp/b/ $ cp /tmp/a/*.html /tmp/b/Now how would you list the files in
/tmp/a/ without using
ls /tmp/a/?
echo /tmp/a/*? What are the two key differences
between this and the ls output? How can this be useful?
Or a hinderance?
$ mv *.txt *.bak
will not have the desired effect; think about how this gets expanded by
the shell before it is passed to mv. Try this using echo
instead of mv if this helps.
We will look into this further later on, as it uses a few concepts
not yet covered.

My blog has tips about how to use Unix and Linux commands