{"id":17688334,"url":"https://github.com/jonelo/bashberries","last_synced_at":"2026-04-20T03:01:37.745Z","repository":{"id":91746416,"uuid":"96620203","full_name":"jonelo/bashberries","owner":"jonelo","description":"A small set of tiny bash scripts that can do some work for you on GNU/Linux and macOS","archived":false,"fork":false,"pushed_at":"2020-06-01T18:50:56.000Z","size":131,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T21:30:48.978Z","etag":null,"topics":["bash","bash-script","bash-scripts","bashberries","linux","m3u8","macos","tiny"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-08T13:18:36.000Z","updated_at":"2021-06-02T12:14:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"2fde6b87-116c-42da-95c8-4a2dae2caa74","html_url":"https://github.com/jonelo/bashberries","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonelo/bashberries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Fbashberries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Fbashberries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Fbashberries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Fbashberries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonelo","download_url":"https://codeload.github.com/jonelo/bashberries/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonelo%2Fbashberries/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","bash-scripts","bashberries","linux","m3u8","macos","tiny"],"created_at":"2024-10-24T11:44:11.279Z","updated_at":"2026-04-20T03:01:37.724Z","avatar_url":"https://github.com/jonelo.png","language":"Shell","readme":"# bash berries\nbash berries is a set of tiny bash scripts that can do some work for you if you are a Linux admin or a developer on Linux.\n\nNot only scripts are being provided by this project, but also include files that help you to write our own bash scripts more quickly. All bash berries have been tested on the latest stable Ubuntu LTS and macOS releases.\nIf you don't set any parameters for a script, a short help will be printed.\n\n## User website\n\nhttps://jonelo.github.io/bashberries/\n\n## Install or update\n\n```\nbash \u003c(curl -Ls https://bit.ly/update-bashberries) ~/bin\n```\n\n## Install or update troubleshooting\n\nMake sure that you have the unzip utility installed and that you can connect to the internet, double check proxy\nsettings if applicable.\n\n## Overview of the bash berries\n\nScript name         | Description                                                                    |\n------------------- | ------------------------------------------------------------------------------ |\nbigfiles            | Determines the biggest files in a directory and it's subdirectories            |\ndeepgrep            | Finds text in files recursively                                                |\nlatlng              | Determines both latitude and longitude of a location                           |\nlines               | Extracts a block of lines from a textfile                                      |\nm3u8tomp4.sh        | Converts all .m3u8 files in the current working dir to .mp4\npwned               | Has your password been pwned?                                                  |\nupdate_jdk          | Downloads the latest JDK from the web, extracts it and creates a symlink       |\nupdate_property     | Updates the value of a key/value pair in a property file                       |\nupdate_bashberries  | Downloads all bash scripts from the bashberries project on github              |\nupdate_tzdatabase   | Updates the time zone database of your Java Runtime Environment                |\n\n\n## Overview of the include files\n\nInclude name        | Description                                                                    |\n------------------- | ------------------------------------------------------------------------------ |\ninteraction.include | provides functions for an user interaction                                     |\nmath.include        | provides mathematical functions                                                |\nnetwork.include     | provides specific network functions                                            |\npermissions.include | provides functions that are related to permissions                             |\nproxy.include       | provides proxy related functions                                               |\ntrim.include        | provides several trim functions                                                |\nversion.include     | provides version specific functions                                            |\n \n## The bash berries in detail\n\n### bigfiles\n\n```\nbigfiles v1.1.0, Copyright 2017 Johann N. Loefflmann\n\nDetermines the biggest files in a directory and it's subdirectories\n\nUsage:\n    bigfiles [-o] [-g greater] [-n max_files] [path]\n\nOptions:\n    -o           print the owners of the biggest files.\n    -g greater   a file is a big file if its file size is greater\n                 than the greater value. You may append\n                 k, M, G and T for kilo, Mega, Giga, and Tera.\n                 If greater is omitted, greater is set to 0.\n\n    -n max_files specifies the maximum number of big files.\n                 If max_files is omitted or if max_files is set to 0,\n                 all files will be printed that matches -g.\n\nParameters:\n    path         specifies the directory to be traversed.\n                 If path is omitted, this help will be printed.\n\nExamples:\n    bigfiles -g 1M .\n                 all files greater than 1 MB in the current working directory\n                 and below.\n\n    bigfiles -o -n 25 -g 1G /\n                 25 biggest files \u003e 1 GB in the root directory and below\n                 including a summary of the owners of those files.\n```\n\n### deepgrep\n```\ndeepgrep v1.0.0, Copyright 2018 Johann N. Loefflmann\n\nFinds text in files recursively.\n\nUsage:\n    deepgrep [-f file filter] [path] \u003ctext\u003e\n\nOptions:\n    -f     file filter\n\nParameters:\n    path   where to search; optional\n    text   what to search\n\nExamples:\n    deepgrep -f *.mine \"Gold\"\n           searches for \"Gold\" in all .mine files\n           in the current folder and all subfolders\n\n    deepgrep -f *.mine /big/mountain \"Gold\"\n           searches for \"Gold\" in all *.mine files\n           in the /big/mountain folder and all subfolders\n```\n\n### latlng\n```\nlatlng v1.0.0, Copyright 2017 Johann N. Loefflmann\n\nDetermines both latitude and longitude of a location.\nThe script uses the Google Maps web service.\n\nUsage:\n    latlng [-c][-i] [location]\n\nOptions:\n    -c         output as one line separated by a comma\n    -i         input in interactive mode\n\nParameters:\n    location   the location as a string\n\nExamples:\n    latlng \"Statue of Liberty\"\n               determines lat and lng of the Statue of Liberty\n    latlng -ic\n               reads input from the user in order to determine lat and lng\n```\n\n### lines\n```\nlines v1.0.0, Copyright 2017 Johann N. Loefflmann\n\nExtracts a block of lines from a textfile\n\nUsage:\n    lines [-i] [-b number] [-e number] [-H number] [-T number]\n          [file [begin [end]]]\n\nOptions:\n    -b number  If begin is a string and if it matches more than one line, you\n               can specify a particular match number.\n    -e number  If end is a string and if it matches more than one line, you\n               can specify a particular match number.\n    -i         Ignore case. Perform case insensitie matching. By default,\n               the search algorithm is case sensitive.\n    -H number  A positive number cuts the head of the output.\n               A negative number extends the head of the output.\n    -T number  A postivie number extends the tail of the output.\n               A negative number cuts the tail of the output.\n\nParameters:\n    file       Specifies the textfile that needs to be processed.\n               If file is omitted, this usage will be printed.\n\n    begin      Specifies the search string in order to find the \"begin\".\n               If begin is a string, it searches for the first occurence\n               in the file.  If begin is an integer, it specifies a line\n               number (starting with 1).\n\n    end        Specifies the search string in order to find the \"end\".\n               If end is a string, it searches for the first occurence\n               starting with the line that is specified by \"begin\".\n               If end is an integer, it specifies a line number\n               (starting with 1).\n\nExamples:\n    lines log.txt 20 40\n               Prints line number 20 to line number 40 from the file called\n               log.txt\n\n    lines -T -1 verylong.log \"^2017-08-06\" \"^2017-08-07\"\n               Prints lines from the log file called verylong.log, starting\n               with the line that starts with \"2017-08-06\" and ending with\n               the line that starts with \"2017-08-07\", but not printing out\n               that last ending line\n```\n\n### m3u8tomp4.sh\n\n```\nno options, no parameters. It just converts all .m3u8 files in the current\nworking directory to .mp4. It expects the latest ffmpeg binary in the script\ndir. It exits if there is an error. In case of success, the .m3u8 will\nbe removed.\n```\n\n### update_jdk\n```\nupdate_jdk v1.20.0, Copyright 2019-2020 Johann N. Loefflmann\n\nDownloads the JRE/JDK from the web, extracts it and creates/updates a symlink\ncalled \u003ctype\u003e_latest.\nThe latest timezone database can be applied to the requested JRE/JDK as well\nso that you have the most possible up to date JRE/JDK within a Java family\nfrom your preferred source. And since the symlink always points to the\nJRE/JDK you can update the JRE/JDK both fast and comfortable.\nBoth GNU/Linux and macOS are supported.\n\nUsage:\n    update_jdk [ [-h] |\n            [-d] [-f] [-k] -s source [-t type] [-z] [-Z location] [path] ]\n\nOptions:\n    -d      dry run. Don't download the JRE, JDK or tzupdater, just inform the\n            user.\n\n    -f      force. Even if we have the JRE, JDK or tzupdater already, update it\n            again.\n\n    -h      prints this help.\n\n    -k      keep the downloaded .tar.gz resp. .zip, don't remove it at the end.\n\n    -s      source. The URI should start with http or https and point to a\n            .tar.gz file that contains the JRE/JDK binaries. You can find\n            JRE/JDK tarballs for example at\n\n            - adoptopenjdk.net\n            - azul.com\n            - bell-sw.com/java\n            - java.com\n            - jdk.java.net\n            - www.oracle.com/java\n\n    -t      type. The name of the symlink prefix, if not specified, jre is used.\n\n    -v      version. Prints out the version of this script.\n\n    -z      after the JRE or JDK has been downloaded and extracted, the\n            latest tzdata will be applied to the JRE or JDK.\n            The script expects the tzupdater.jar in the /Users/johann/IdeaProjects/bashberries/bin\n\n    -Z      the timezone files if not from IANA.\n\nParameters:\n    path    specifies the path where the JRE, JDK should be stored.\n            It will be created if it doesn't exist.\n            If omitted, .\u003ctype\u003e/ will be used.\n\nExamples:\n    ./update_jdk -s \"$ADDRESS\"\n            downloads the JRE tarball from \"$ADDRESS\", extracts it, and updates\n            the JRE in ./jre/ and it creates a symlink called jre_latest there.\n    ./update_jdk -s \"$ADDRESS\" -z myjres\n            updates the JRE in myjres and it updates the symlink called\n            jre_latest there. Additionally the timezone updater\n            is being called so that the JRE's timezone database also gets updated.\n    ./update_jdk -s \"$ADDRESS\" -t jdk /opt/java/\n            updates the JDK in /opt/java/ and it updates a symlink\n            called jdk_latest there.\n    ./update_jdk -z -s \"$ADDRESS\" -t openjdk11\n            downloads the JDK from \"$ADDRESS\",\n            applies the latest timezone database from IANA to the JDK by calling\n            the tzupdater tool. Symlink called openjdk11/openjdk11_latest\n            will point to the latest and updated OpenJDK11 build.\n```\n\n\n### update_property\n```\nupdate_property v1.2.0, Copyright 2017,2018 Johann N. Loefflmann\n\nUpdates the value of a key/value pair in a property file.\nThe script saves existing comments and also the order of the properties.\n\nUsage:\n    update_property [-d \u003cdelimiter\u003e] [-e] [-f] [-q] [file key value]\n\nOptions:\n    -a      keeps the existing value and appends the new value.\n    -d      delimiter, delimits the key and the value.\n            If omitted the equal sign is assumed.\n    -e      echo the updated line of the file.\n    -f      force to append the key/value pair to the file even if the key is\n            not in the property file yet.\n    -p      keeps the existing value and prepends the new value.\n    -q      set quotes around the value when writing the value.\n\nParameters:\n    file    specifies the file that needs to be updated.\n\n    key     specifies the key in the property file.\n\n    value   specifies the value for the key.\n\nExamples:\n    update_property -f -q app.conf mykey \"new value\"\n            updates the key called \"mykey\" with the value called \"new value\"\n            with quotes around the value in the app.conf property file, and\n            creates the key/value pair if the key does not exist.\n    update_property -d ' ' -e /etc/openvpn/vpn.conf remote \"my-server-1 1194\"\n            updates the key called \"remote\" in the property file that has\n            a blank as the delimiter, it also echoes the modified line.\n```\n\n### update_bashberries\n```\nupdate_bashberries v1.2.0, Copyright 2017-2018 Johann N. Loefflmann\n\nDownloads the latest bash scripts from the bashberries project on github\nand updates any existing scripts in the directory that has been specified.\n\nUsage:\n    update_bashberries [-n] \u003cdirectory\u003e\n\nOptions:\n    -n               don't check for a new update_bashberries script\n\nParameter:\n    directory        the directory where the scripts should be stored\n\nExamples:\n    ./update_bashberries .\n                     updates the bashberries in the current working directory\n    bash \u003c(curl -Ls http://bit.ly/update-bashberries) ~/bin\n                     updates the bashberries in ~/bin with just this line\n```\n\n\n### update_tzdatabase\n\n```\nupdate_tzdatabase v1.0.2, Copyright 2017-2018 Johann N. Loefflmann\n\nDownloads the latest timezone data from iana.org, calculates the necessary\nsha256 digest by calling jacksum, and updates the timezone database of\nyour Java Runtime Environment by calling tzupdater.jar\n\nUsage:\n    update_tzdatabase [ [-h] |\n                        [-j java-binary] [-s jacksum.jar] [-t tzupdater.jar] ]\n\nOptions:\n    -h               prints this help.\n    -j java          location of the java binary.\n                     If omitted, default java is used.\n    -s jacksum.jar   location of the jacksum.jar file.\n                     If omitted, jacksum.jar is expected in the script dir.\n    -t tzupdater.jar location of the tzupdater.jar file.\n                     If omitted, tzupdater.jar is expected in the script dir.\n\nExamples:\n    update_tzdatabase\n                     updates the tzdatabase of the default JRE.\n    sudo ./update_tzdatabase -j \\$(type -P java)\n                     updates the tzdatabase of the default JRE using root\n                     permissions.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonelo%2Fbashberries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonelo%2Fbashberries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonelo%2Fbashberries/lists"}