Test Your New Unix Knowledge


Your mission is to find the answers to the questions below. Note that each question has some hints and at the end is the typescript output for you to compare your results.

  1. How many files are there that begin with the letter "a" in the /usr/bin directory?
    • change to the directory /usr/bin
      cd /usr/bin
    • list the files using ls. There are too many to count!
    • list just the ones that begin with a using the asterisk wildcard
      ls a*
    • there are still too many to count!
      you can "page" the results with the command:
      ls a* | more
      There are 130
  2. How many files are there in the /usr/bin directory that end in "te"?
  3. How many files and directories are there in the root of the file system?
    • The root on Unix is /
      cd /
    • list the files and directories
      there are 25
  4. How many files are there in /mnt?
  5. Are the files in /mnt files or directories
    • ls -l
    • Note the "d" at the beginning of each line, they are directories
  6. Copy the file named animate in /usr/bin to your home directory
    • change back to your home directory
    • cd without anything, takes you back to home
    • Use the copy command cp with the source filename of /usr/bin/animate
    • The destination is the current directory, so use a .
      cp /usr/bin/animate .
  7. with one command, copy animate to the /tmp directory and name it your userid (i.e., abc1234 where abc are you initials...)
    cp animate /tmp/deborah.whitfield
  8. NOTE: you were able to copy into a system folder!
  9. delete the file you created in /tmp
    • cd /tmp
    • ls deborah.whitfield
    • rm deborah.whitfield

log of a solution