More commands and switches

Learning outcomes:

  • Demonstrate finding files with several criteria
  • Show the use of ls with wildcards and recursive searches
  • Explain how to locate running processes and kill a process

Would you like to download my PowerPoint to follow along?

  • Using Switches
    • Commands have their own sentence structure
    • The basic pattern is "Command Switch Argument"
    • Switches give us the ability to get more details and power from commands
  • the find command
    • Search using find (or locate)
    • find -name myfile (basic)
    • find /etc -name passwd (within a folder)
    • find -name “*.txt” (search by extension)
    • find - testfile (case insensitive find)
    • Groups, user, file type, dirdctory, empty files, date, last access etc.
    • Video: How to use the find command
  • Wildcards
  • Processes

Suggested Activities and Discussion Topics:

  • Activity: Go to a Linux Emulator or Linux machine and try to solve the following problems using wildcards:
    • All files including hidden files
    • Files that start with “f”
    • Files that start with “f” or “F”
    • Files that have “f” or “F” anywhere in the name
    • Files that have a digit in the name
    • Files that start with a through d
    • Files that end with 1 or 2
    • Experiment with the find command. Include going to your home directory and using find.

Would you like to see some more classes? Click here