Useful CLI tools (bash) for Arch Linux administration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
418 B

6 years ago
  1. #!/bin/bash
  2. ###########################################################
  3. # Grep/List matching strings in a specific folder
  4. if [ -z "$1" ]; then
  5. $1=/ #If folder not specified, then we use root folder as a starting path
  6. fi
  7. if [ -z "$2" ]; then #If string not defined, then...
  8. # display usage if no string is given
  9. echo "Usage: findmatch <folder_path> <string>"
  10. return 1
  11. else
  12. ls $1 |grep -i "$2"
  13. fi