{"id":25489830,"url":"https://github.com/sundanc/bashcheatsheet","last_synced_at":"2026-04-29T22:33:19.076Z","repository":{"id":278150047,"uuid":"934467690","full_name":"sundanc/bashcheatsheet","owner":"sundanc","description":"CheatSheet for bash commands you need!","archived":false,"fork":false,"pushed_at":"2025-02-18T09:41:42.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T22:34:45.025Z","etag":null,"topics":["bash","bash-commands","bash-script","cheatsheet","linux"],"latest_commit_sha":null,"homepage":"","language":null,"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/sundanc.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":"2025-02-17T22:12:14.000Z","updated_at":"2025-02-18T09:41:46.000Z","dependencies_parsed_at":"2025-02-18T09:28:46.244Z","dependency_job_id":"f2ddf357-ae0f-4274-bbe3-3ae5e982e689","html_url":"https://github.com/sundanc/bashcheatsheet","commit_stats":null,"previous_names":["sundanc/bashcheatsheet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sundanc/bashcheatsheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundanc%2Fbashcheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundanc%2Fbashcheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundanc%2Fbashcheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundanc%2Fbashcheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sundanc","download_url":"https://codeload.github.com/sundanc/bashcheatsheet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sundanc%2Fbashcheatsheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32446703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-commands","bash-script","cheatsheet","linux"],"created_at":"2025-02-18T21:17:59.550Z","updated_at":"2026-04-29T22:33:19.049Z","avatar_url":"https://github.com/sundanc.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bash Commands Cheatsheet\n\n\u003e Essential bash commands. If this repo helped you in any way, consider giving it a star ⭐\n\n## Table of Contents\n- [Basic Command Structure](#basic-command-structure)\n- [File Navigation \u0026 Management](#file-navigation--management)\n- [File Viewing \u0026 Editing](#file-viewing--editing)\n- [System Information](#system-information)\n- [File Permissions](#file-permissions)\n- [Process Management](#process-management)\n- [Environment \u0026 Variables](#environment--variables)\n- [Network](#network)\n- [Package Management](#package-management-ubuntudebian)\n- [Repository Commands](#repository-commands)\n- [Useful Combinations](#useful-combinations)\n- [Script-Related](#script-related)\n- [Common Use Cases](#common-use-cases)\n- [Safety Notes](#safety-notes)\n\n## Basic Command Structure\n```bash\ncommand [options] [arguments]    # General syntax\ncommand --help                  # Get help for any command\nman command                     # Show manual page\ninfo command                   # Detailed documentation\n```\n\n## File Navigation \u0026 Management\n```bash\npwd                            # print working directory\nls -la                         # list all files with details\ncd /path/to/dir               # change directory\nmkdir -p dir1/dir2            # create nested directories\nrm -rf dir                    # remove directory recursively (use with caution!)\ncp -r src/ dest/              # copy directories recursively\nmv old_name new_name          # move/rename files\ntouch file.txt                # create empty file\nfind . -name \"*.py\"           # find files by pattern\ntree                          # display directory structure\n```\n\n## File Viewing \u0026 Editing\n```bash\ncat file.txt                  # display file content\nless file.txt                 # view file with pagination\nhead -n 5 file.txt           # show first 5 lines\ntail -f file.log             # follow log file updates\ngrep \"pattern\" file          # search text in file\nnano file.txt                # simple text editor\nvim file.txt                 # advanced text editor\ndiff file1 file2             # compare files\n```\n\n## System Information \n```bash\ntop                          # process viewer\nhtop                         # enhanced process viewer\ndf -h                        # disk space usage\nfree -h                      # memory usage \nps aux | grep python        # find python processes\nwhich python3               # locate command\nuname -a                    # system information\nlsb_release -a             # distribution info\nuptime                     # system uptime\nlscpu                      # CPU information\n```\n\n## File Permissions \n```bash\nchmod +x script.sh          # make script executable\nchmod 755 file             # set permissions (rwxr-xr-x)\nchown user:group file      # change file owner\nchmod -R 644 dir          # recursively change files\nchmod -R 755 dir          # recursively change directories\nstat file                 # display file status\n```\n\n## Process Management \n```bash\nps aux                     # list all processes\nkill -9 PID               # force kill process\nbg                        # send process to background\nfg                        # bring process to foreground\nnohup command \u0026           # run command after terminal closes\njobs                      # list background jobs\npgrep process_name        # find process ID\npkill process_name        # kill process by name\n```\n\n## Environment \u0026 Variables\n```bash\nexport PATH=$PATH:/dir    # add to PATH\necho $HOME               # print environment variable\nsource ~/.bashrc         # reload bash configuration\nenv                      # show all environment vars\nprintenv                 # print environment\nset                      # show all shell variables\n```\n\n## Network\n```bash\nping google.com          # test connectivity\ncurl http://site.com     # http request\nwget http://site.com     # download file\nsudo netstat -tulpn      # show active ports\nssh user@hostname        # ssh connection\nifconfig                 # network interface config\nip addr                  # modern interface config\ndig domain.com          # DNS lookup\ntraceroute domain.com   # trace packet route\n```\n\n## Package Management (Ubuntu/Debian)\n```bash\nsudo apt update          # update package list \nsudo apt upgrade         # upgrade installed packages\nsudo apt install pkg     # install package\nsudo apt remove pkg      # remove package\nsudo apt autoremove      # clean unused packages\napt search pkg           # search for package\napt show pkg            # show package details\n```\n\n## Repository Commands\n```bash\ngit init                 # initialize repository\ngit clone url           # clone repository\ngit status              # check status\ngit add .               # stage all changes\ngit commit -m \"msg\"     # commit with message\ngit push origin main    # push to remote\ngit pull               # update local repository\n```\n\n## Useful Combinations\n```bash\ncommand1 | command2      # pipe output\ncommand \u003e file.txt       # redirect output to file\ncommand \u003e\u003e file.txt      # append output to file\ncommand1 \u0026\u0026 command2     # run if previous succeeds\ncommand1 || command2     # run if previous fails\ntime command            # measure execution time\n```\n\n## Script-Related\n```bash\n#!/bin/bash             # shebang line\nset -e                  # exit on error\nset -x                  # debug mode\n$1, $2                  # script arguments\n$?                      # last command exit status\n$#                      # number of arguments\n$$                      # process ID of the script\n$@                      # all arguments\n$0                      # script name\n```\n\n## Common Use Cases\n```bash\n# Find and replace in files\nfind . -type f -name \"*.txt\" -exec sed -i 's/old/new/g' {} +\n\n# Monitor system resources\nwatch -n 1 'free -h; echo; df -h'\n\n# Search command history\nhistory | grep \"command\"\n\n# Compress/Extract\ntar -czf archive.tar.gz dir/    # compress\ntar -xzf archive.tar.gz         # extract\n\n# Find large files\nfind / -type f -size +100M -exec ls -lh {} \\;\n```\n\n## Safety Notes\n- Always double-check before using `rm -rf`\n- Use `rm -i` for interactive deletion\n- Back up important files before using `chmod -R` or `chown -R`\n- Test scripts in isolated environment first\n- Use `sudo` with caution\n- Create backup before system changes: `cp file{,.bak}`\n- Use `--dry-run` when available to test commands\n\n## License\n\nMIT License - Feel free to share and modify with attribution.\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\nPlease ensure your PR:\n- Follows consistent formatting\n- Includes clear descriptions\n- Tests all commands\n- Updates Table of Contents if needed\n\nFeel free to submit issues and enhancement requests!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsundanc%2Fbashcheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsundanc%2Fbashcheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsundanc%2Fbashcheatsheet/lists"}