Monday, May 24, 2010

Help Help Help w/ Unix?

Here is the question: Give a command line to display the types of all the files in your ~/unix directory that start with the word chapter, are followed by a digit 1,2,6,8,9 and end with .eps or .prn the solution that i came up with is this: ls chapter[12689]*.eps; ls chapter[12689]*.prn now my question to you is how can i combine that without having to use the semicolen, i know there is a command but i can't think of it. Please help!

Help Help Help w/ Unix?
Just do this





ls chapter[12689]*.eps chapter[12689]*.prn





Or if you want to be fancy





find ~/unix -name 'chapter[12689]*\.eps' -o -name 'chapter[12689]\*.prn' -print





More typing to do the same thing. However, "find" is a powerful command to know. Try "man find" or "info find".


No comments:

Post a Comment