{"id":30078556,"url":"https://github.com/karl-horning/bash-notebook","last_synced_at":"2025-08-08T17:27:45.601Z","repository":{"id":306995630,"uuid":"1022016392","full_name":"Karl-Horning/bash-notebook","owner":"Karl-Horning","description":"A personal collection of Bash scripts and notes for learning, automation, and quick reference. Includes file utilities, folder flatteners, and a growing cheatsheet for common shell tasks.","archived":false,"fork":false,"pushed_at":"2025-07-28T20:45:45.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T22:28:30.299Z","etag":null,"topics":["automation","bash","cheatsheet","cli-tools","command-line","learning-resources","linux","macos","scripting","shell","shell-scripts","utilities"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Karl-Horning.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,"zenodo":null}},"created_at":"2025-07-18T10:08:33.000Z","updated_at":"2025-07-28T20:45:49.000Z","dependencies_parsed_at":"2025-07-28T22:28:33.263Z","dependency_job_id":"47714b61-ade3-4a13-88d3-4ad784056aef","html_url":"https://github.com/Karl-Horning/bash-notebook","commit_stats":null,"previous_names":["karl-horning/bash-notebook"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Karl-Horning/bash-notebook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Karl-Horning%2Fbash-notebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Karl-Horning%2Fbash-notebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Karl-Horning%2Fbash-notebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Karl-Horning%2Fbash-notebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Karl-Horning","download_url":"https://codeload.github.com/Karl-Horning/bash-notebook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Karl-Horning%2Fbash-notebook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269458769,"owners_count":24420475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"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":["automation","bash","cheatsheet","cli-tools","command-line","learning-resources","linux","macos","scripting","shell","shell-scripts","utilities"],"created_at":"2025-08-08T17:27:41.824Z","updated_at":"2025-08-08T17:27:45.591Z","avatar_url":"https://github.com/Karl-Horning.png","language":"Shell","readme":"# Bash Notebook Cheatsheet\n\n---\n\n## 📖 Table of Contents\n\n- [Bash Notebook Cheatsheet](#bash-notebook-cheatsheet)\n  - [📖 Table of Contents](#-table-of-contents)\n  - [🤓 Overview](#-overview)\n  - [📁 Basic Navigation](#-basic-navigation)\n  - [📄 File \\\u0026 Directory Operations](#-file--directory-operations)\n  - [⚙️ Variables](#️-variables)\n  - [🧠 Conditionals](#-conditionals)\n  - [🔁 Loops](#-loops)\n  - [📦 Functions](#-functions)\n  - [🧪 Test Operators](#-test-operators)\n  - [🧹 Useful One-Liners](#-useful-one-liners)\n  - [🧪 Exit Codes](#-exit-codes)\n  - [🔗 Script Template](#-script-template)\n  - [📄 Licence](#-licence)\n  - [👤 Author](#-author)\n\n---\n\n## 🤓 Overview\n\nA collection of handy Bash syntax, commands, and examples. For learning, quick reference, and scripting!\n\n---\n\n## 📁 Basic Navigation\n\n```bash\npwd              # Print working directory\nls               # List files\nls -la           # Long format with hidden files\ncd foldername    # Change directory\ncd ..            # Go up one directory\n```\n\n---\n\n## 📄 File \u0026 Directory Operations\n\n```bash\ntouch file.txt                 # Create an empty file\nmkdir myfolder                 # Create a directory\nrm file.txt                    # Delete a file\nrm -r folder                   # Delete a directory and contents\ncp file.txt backup.txt         # Copy file\nmv old.txt new.txt             # Rename or move file\n```\n\n---\n\n## ⚙️ Variables\n\n```bash\nname=\"Karl\"\necho \"Hello $name\"\n```\n\n---\n\n## 🧠 Conditionals\n\n```bash\nif [ \"$name\" == \"Karl\" ]; then\n  echo \"Hi Karl\"\nelse\n  echo \"Who are you?\"\nfi\n```\n\n---\n\n## 🔁 Loops\n\n```bash\n# For loop\nfor i in {1..5}; do\n  echo \"Loop $i\"\ndone\n\n# While loop\ncount=1\nwhile [ $count -le 5 ]; do\n  echo \"Count is $count\"\n  ((count++))\ndone\n```\n\n---\n\n## 📦 Functions\n\n```bash\ngreet() {\n  echo \"Hello, $1!\"\n}\n\ngreet \"Karl\"\n```\n\n---\n\n## 🧪 Test Operators\n\n```bash\n[ -f file.txt ]     # File exists\n[ -d mydir ]        # Directory exists\n[ -z \"$var\" ]       # String is empty\n[ \"$a\" -eq \"$b\" ]   # Numbers equal\n```\n\n---\n\n## 🧹 Useful One-Liners\n\n```bash\ngrep \"word\" file.txt           # Search for \"word\"\ncat file.txt | less            # Page through a file\nfind . -name \"*.sh\"            # Find all .sh files\nchmod +x script.sh             # Make script executable\nhead -n 10 file.txt            # First 10 lines\ntail -f logs.txt               # Follow file live\n```\n\n---\n\n## 🧪 Exit Codes\n\n```bash\necho $?   # Shows the exit code of the last command\n```\n\n---\n\n## 🔗 Script Template\n\n```bash\n#!/bin/bash\n\n# Script to greet the user\nname=\"$1\"\necho \"Hello, $name!\"\n```\n\nMake it executable:\n\n```bash\nchmod +x myscript.sh\n./myscript.sh Karl\n```\n\n---\n\n## 📄 Licence\n\nMIT © 2025 Karl Horning\n\n---\n\n## 👤 Author\n\nMade with ❤️ by [Karl Horning](https://github.com/Karl-Horning)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarl-horning%2Fbash-notebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarl-horning%2Fbash-notebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarl-horning%2Fbash-notebook/lists"}