Skip to content

Instantly share code, notes, and snippets.

@rasor
Last active October 7, 2018 12:34
Show Gist options
  • Select an option

  • Save rasor/01b2a0dc75eac16c029609dd38934135 to your computer and use it in GitHub Desktop.

Select an option

Save rasor/01b2a0dc75eac16c029609dd38934135 to your computer and use it in GitHub Desktop.
various-bash-shell-scripts
#!/bin/bash
# Find files (subfolder included -R) having somesearchstring in filename (and ignore case -i)
# Usage: sh find-filename.sh somesearchstring
# https://stackoverflow.com/questions/11328988/linux-find-files-with-name-containing-string/11329078#comment92302732_11329078
ls -R | grep -i $1
# If you only want to find PDF files
# ls -R | grep -i $1 | grep -F -i '.pdf'
# https://www.lifewire.com/pass-arguments-to-bash-script-2200571
# done
#!/bin/bash
# Split a file into X lines
# https://stackoverflow.com/questions/3066948/how-to-file-split-at-a-line-number
split -l 30000 test.log
# done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment