{"id":14062895,"url":"https://github.com/colinwilliams91/exh-cli-cmd-md","last_synced_at":"2026-02-24T07:37:54.780Z","repository":{"id":210826346,"uuid":"727537808","full_name":"colinwilliams91/exh-cli-cmd-md","owner":"colinwilliams91","description":"Catalogue of every single keyboard shortcut I have ever used as a software developer","archived":false,"fork":false,"pushed_at":"2026-02-21T20:03:57.000Z","size":2975,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T01:08:23.856Z","etag":null,"topics":["how-to","shortcuts","speed","system","tutorial"],"latest_commit_sha":null,"homepage":"https://colinwilliams91.github.io/exh-cli-cmd-md/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colinwilliams91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-05T04:02:53.000Z","updated_at":"2026-02-21T20:04:01.000Z","dependencies_parsed_at":"2023-12-22T05:25:31.013Z","dependency_job_id":"78e28d49-afe6-40fc-8421-d686262bf1e6","html_url":"https://github.com/colinwilliams91/exh-cli-cmd-md","commit_stats":null,"previous_names":["colinwilliams91/exh-cli-cmd-md"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/colinwilliams91/exh-cli-cmd-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinwilliams91%2Fexh-cli-cmd-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinwilliams91%2Fexh-cli-cmd-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinwilliams91%2Fexh-cli-cmd-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinwilliams91%2Fexh-cli-cmd-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colinwilliams91","download_url":"https://codeload.github.com/colinwilliams91/exh-cli-cmd-md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinwilliams91%2Fexh-cli-cmd-md/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29775099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"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":["how-to","shortcuts","speed","system","tutorial"],"created_at":"2024-08-13T07:02:48.461Z","updated_at":"2026-02-24T07:37:54.772Z","avatar_url":"https://github.com/colinwilliams91.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"```ts\nthis is a cataloging of commands and shortcuts i have found useful along my coding journey\n-\nctrl + f to search for the cli term you are looking for (annotated w/ keywords and descriptions)\n-\nsearch using the roman numeral indexed legend for system or technology lookup\n```\n\n| Index | Technology         | System           |\n| :---: | ------------------ | ---------------- |\n|   I   | Visual Studio Code | IDE              |\n|  II   | Visual Studio      | IDE              |\n|  III  | Bash               | Terminal         |\n|  IV   | Powershell         | Terminal         |\n|   V   | Command Prompt     | Terminal         |\n|  VI   | Oh My Zsh!         | Terminal         |\n|  VII  | Node               | Framework        |\n| VIII  | .Net               | Framework        |\n|  IX   | CSS                | Framework        |\n|   X   | Ubuntu             | Operating System |\n|  XI   | Windows            | Operating System |\n|  XII  | SQL                | DB               |\n| XIII  | Cron               | Misc.            |\n|  XIV  | Postman            | Misc.            |\n|  XV   | Tree               | Misc.            |\n|  XVI  | Git                | Misc.            |\n\n---\n---\n\n# :: IDE ::\n---\n\n# I. VSCode\n`shortcuts WHEN clause context keys`\nhttps://code.visualstudio.com/api/references/when-clause-contexts#available-context-keys\n\n`Navigate through sidebar/explorer panes`\n```TS\nctrl + q\n```\n\n`Go to last Edit`\n```TS\nctrl + K, ctrl + Q\n```\n\n`command palette`\n```ts\nctrl + shift + p\n```\n\n`Jump to Symbols (objects)`\n```TS\nctrl + p @ ... // search in file\nctrl + p # ... // search in workspace\n```\n\n`Fuzzy search workspace` (like SQL LIKE %)\n```TS\nctrl + p % ... // searches by char/string in realtime\n```\n\n`allow dotnet to find its own path`\n```powershell\n# open VSC settings\nctrl + , \n# search \"existingDotnetPath\"\n# clear out the \"Shared Existing DotNet Path\"\n# e.g. remove C:\\Program Files\\dotnet\\dotnet.exe\n```\n\n`enable psehll integrated terminal enhancements (preferences settings json)`\n```ts\n\"terminal.integrated.suggest.enabled\": true\n```\n\n`ScreenCast Mode (great for presentations)`\n```ts\nctrl + shift + p\n// type \"screencast\"\n// select Developer Toggle Screencast Mode\n```\n\n`Clear command suggestions for integrated terminal (for powershell can reduce time to activate shell from ~600ms -\u003e ~50ms`\n```ts\nctrl + shift + p\nTerminal: Clear Suggest Cache\n```\n\n`open file \"side by side\" (in new panel)`\n```ts\nctrl + \\\n```\n\n`open file in second panel`\n```ts\nctrl + enter\n```\n\n`focus file explorer panel`\n```ts\nctrl + 0 // \u003c\u003c-- 1, 2, 3 etc.. == panels\n```\n\n`search file explorer`\n```ts\nctrl + p\n```\n\n`focus terminal`\n```ts\nctrl + `\n```\n\n`focus source control view`\n```sh\nctrl + shift + g\n```\n\n`check for changed settings`\n```ts\nctrl + shift + p // cmd palette\n// search by \"@modified\"\n// this will filter only settings\n// you have made changes to\n```\n\n`inside terminal to do \"reverse lookup history\" (commands entered)`\n```ts\nctrl + r\n```\n\n`open/close sidebar`\n```ts\nctrl + b\n```\n\n`goto/go to definition`\n```ts\nfn + f12 // or ctrl + left click\n```\n\n`goto/go to references`\n```sh\nshift + fn + f12\n```\n\n`select current line`\n```sh\nctrl + l\n```\n\n`open markdown preview`\n```sh\nctrl + shift + v\n```\n\n`Side by side Markdown edit and preview`\n```sh\nctrl + k, v # ctrl + k, then release, press v\n```\n\n`change coding language` (inside text editor)\n```sh\nctrl + k, m # release ctrl + k, then press m\n```\n\n`copy file relative path`\n```ts\nctrl + k, ctrl + shift + c\n```\n\n`go to line #`\n```ts\nctrl + shift + p\n:# \n// backspace the \u003e then :number\n```\n\n`navigate history (tabs?)`\n```sh\nctrl + tab\nalt + left # navigate back\nalt + right # navigate forward\n```\n\n`navigate to specific line`\n```sh\nctrl + g\n```\n\n`add additional cursors to all occurrences`\n```sh\nctrl + shift + l\n```\n\n`replace all occurrences in the open file`\n```typescript\nctrl + h\n```\n\n`ctrl + K + M` --\u003e \"change language mode\" --\u003e JSON to format JSON stringified object grabbed from browser\n\n`JavaScript Console Debugging`\n```js\nconsole.log({object}) /* will print as console.log(\"object:\": { ... }); */  \n  \nconsole.dir(object, {depth: null}) /* will print all of the data rather than compared to console.log which only returns top level, not nested data */\n```\n\n# II. Visual Studio\n\n`run application`\n```sh\nctrl + fn + f5 # \u003c\u003c-- default run\nfn + f5 # \u003c\u003c-- debug run (slower)\n```\n\n`build project`\n```C#\nctrl + shift + b\n```\n\n`open breakpoints window`\n```C#\nctrl + alt + b\n```\n\n`open terminal (View.Terminal) shortcut added`\n```sh\nctrl + shift + t\n```\n\n`quick launch`\n```sh\nctrl + q # search commands keywords e.g: \"new\"\n```\n\n`extract code snippet to new Method`\n```C#\n// highlight target code\nctrl + r, ctrl + m\n// this will move the highlighted code to a new method with this signature:\n\n// private void NewMethod()\n// the targeted code will be the body of this new method\n```\n\n`multiline comment`\n```sh\nshift + alt + a # multi line /* */\n\nctrl + k, ctrl + / # single line (can be multi) //\n\nctrl + k, ctrl + c # alternate single line comment\nctrl + k, ctrl + u # uncomment\n```\n\n`see all references`\n```C#\nalt + 2 // \u003c\u003c-- shows where used\n```\n\n`\u003csummary\u003e\u003c/summary\u003e C#Docs`\n```C#\n/// \u003c-- will auto populate this...\n/// \u003csummary\u003e\n/// Comment goes here\n/// \u003c/summary\u003e\n\n// e.g.\n/// \u003csummary\u003e\n/// Comment goes here\n/// \u003c/summary\u003e\n///\n```\n### Create\n`create a new file in project`\n```sh\nshift + fn + f2 # with Add New File extension\n---\nctrl + shift + a\nctrl + n # alternate option\nctrl + shift + n # new project\n```\n\n`create new Class in project` (custom) (j === insert)\n```c#\nctrl + shift + j, c // release then press c\n```\n\n`create new Interface in project` (custom) (j === insert)\n```c#\nctrl + shift + j, i // release then press i\n```\n\n`link proj dependencies, link proj as reference`\n```C#\ncd \\IntoProj\ndotnet add reference ..\\ParentProj\\Proj.csproj\n// find the .csproj level to link\n// requires dotnet sln command to be complete..\n```\n\n`link VS solution files dotnet sln`\n```C#\ncd .. // cd to root or whatever .sln level you want to link to\ndotnet sln add YourProj\\WithSolution.csproj\n```\n\n`format`\n```sh\nctrl + k, ctrl + d # formats entire DOCUMENT (d = doc)\nctrl + k, ctrl + f # formats selection (f = format)\n```\n### Navigate\n\n`focus text editor`\n```sh\nesc # literally, just hit escape once...\n```\n\n`navigate tabs | close tabs`\n```sh\nctrl + tab # next tab\nctrl + shift + tab # prev tab\nctrl + fn + f4 # close active tab\nalt + w + l # close all tabs\n```\n\n`navigate to solution explorer`\n```sh\nctrl + alt + l # ctrl + tab navigate tabs here too\nctrl + ; # to solution explorer w/ search bar\n```\n\n`go to line start`\n```sh\nfn + k # k === \"home\"\nctrl + / + leftArrow # Edit.LineStart\n```\n\n`go to line end`\n```sh\nfn + , # , === \"end\"\nctrl + / + rightArrow # Edit.LineEnd\n```\n\n`go to Class(?)`\n```C#\nctrl + click // highlighted class\n```\n\n`search file name`\n```sh\nctrl + ; # type name of file to find\n```\n\n`Go To`\n```sh\nctrl + g # go to line\nfn + f12 # go to definition\nctrl + fn + f12 # go to declaration\nctrl + d # go to next (highlighted selection)\n```\n\n`Go To All` (NICE)\n```sh\nctrl + t # backspace to clear out \"symbol\"\n```\n\n`navigate back to prev window`\n```sh\nctrl + -\n```\n\n`find closing brace`\n```sh\nctrl + ]\n```\n\n`open toolbox`\n```sh\nctrl + alt + x\n```\n\n`multi cursor edit (also in Edit menu)`\n```C#\nctrl + alt + click // add 2nd caret\nctrl + alt + dbl-click // add 2nd word selection\nctrl + alt + click + drag // add 2nd selection\nshift + alt + . // add next matching text\nshift + alt + ; // add all matching text\nshift + alt + , // rm last selected occurence\nshift + alt + / // skip next matching occurence\nalt + click // add a box selection\nesc OR click // clear all selections\n```\n\n`add cursor above/below`\n```sh\nctrl + alt + upArrow\nctrl + alt + downArrow\n```\n\n`collapse/expand code blocks`\n```sh\nctrl + m, ctrl + m\n```\n\n`replace`\n```sh\nctrl + h\n```\n\n`replace all occurrences`\n```sh\nalt + a # once you have entered what you would like to sub\n```\n\n`delete to...`\n```sh\nctrl + delete # delete to start of word\nctrl + backspace # delete to end of word\n```\n\n`save all`\n```sh\nctrl + shift + s\n```\n\n`view in browser`\n```sh\nctrl + shift + w\n```\n\n`bookmark` (_a keyboard chord is multiple shortcuts in a row_)\n```sh\nctrl + k, ctrl + k\n```\n- `View \u003e\u003e Bookmark Window` to view all Bookmarks\n\n`next split pane`\n```sh\nfn + f6\n```\n\n`collapse markup element (html)`\n```C#\nctrl + m, ctrl + m\n```\n### Debugger:\n`add breakpoint (highlight line first)`\n```sh\nfn + f9 # \u003c\u003c-- press again to remove\n```\n`continue to next breakpoint (inside debugger)`\n```sh\nfn + fn5\n```\n`step over (inside debugger)`\n```sh\nfn + f10\n```\n`step into method (inside debugger)`\n```sh\nfn + f11\n```\n`step out of method (if accidentally stepped in)`\n```sh\nshift + fn + fn11\n```\n`exit debugger`\n```sh\nctrl + shift + fn + f5\n```\n\n`replace (find and replace)`\n```\nctrl + h\n```\n\n`rename all properties`\n```sh\nctrl + r, ctrl + r\n```\n\n`solution explorer (folder explorer)`\n```\nctrl + alt + l\n```\n\n`copyLinesDown (without VSCode extra mappings`\n```\nctrl + d\n```\n\n`alternate copyLinesDown option`\n```sh\n# without any selection\nctrl + e\nctrl + v\nalt + up/down # \u003c\u003c-- to move\n```\n\n`extensions with .user will not get checked-in`\n```\nhttpenv.json.user\n```\n\n`auto fix suggestions`\n```sh\nalt + enter\n```\n\n`open Test Explorer`\n```sh\nctrl + e, t\n```\n\n`run tests`\n```C#\nctrl + r, t // runs selectred\nctrl + r, a // runs all tests\nctrl + r, l // \"repeat last run\"\n```\n### Refactor\n`extract method`\n```C#\nctrl + r, ctrl + m\n```\n\n### Object Browser\n```sh\nctrl + alt + j\n```\n- `ctrl + click` on `var` or `type identifier` to open object definition, which will show all attributes and methods on datatype \"constructor\" parent object (\"`struct`\" in C#) (available methods)\n\n### Code Snippets (inside VS)\n- enter these aliases inside your IDE text editor\n`Console.WriteLine()`\n```sh\ncw # press tab twice\n```\n`public CodeSnippetExamples() { }` \"Constructor\"\n```sh\nctor # press tab twice\n```\n`public string LastName { get; set; }` \"Property\"\n```sh\nprop # press tab twice\npropfull # \u003c-- creates FULL prop w/ getter \u0026 setter\n```\n`try { } catch (Exception) { throw; }` try/catch block\n```sh\ntry # press tab twice\ntryf # try/finally block\n```\n- instantiate the Exception inside `catch (... ex)`\n`for loop`\n```sh\nfor # press tab twice\nforr # for loop decrement\n```\n`foreach loop` including collection\n```sh\nvar names = new List\u003cstring\u003e();\nforeach # press tab twice\n```\n- will output: `foreach (var name in names) { }`\n`while loop`\n```sh\nwhile # press tab twice\n```\n`do { } while (true);`\n```sh\ndo # press tab twice\n```\n\n`populate snippets from context menu`\n```sh\nctrl + k, ctrl + x\n# for example, surround With or e.g. Wrap {} w/ braces\n```\n\n### Unity in VS\n\n`view Unity Project Explorer`\n```c#\nalt + shift + e\n// filters sln/proj to unity files\n```\n\n---\n---\n\n# :: TERMINAL ::\n---\n\n# III. Bash\n`following are bash specific`\n\n**Explorer Windows File System** (so helpful connecting sub-system partition to main OS)\n`open windows file explorer GUI for WSL`\n```sh\nexplorer.exe .\n```\n##### How to `echo` or `cat` write to a file with Bash:\n```bash\ncat \u003e\u003e /path/to/existingFile.text\u003c\u003c EOF\nsome text line 1\nsome text line 2\nsome text line 3\nEOF\n```\nswitch `cat \u003e\u003e` to `cat \u003e` to create a file instead of append\n```bash\ncat \u003e /path/to/newFile.text\u003c\u003c EOF\nsome text line 1\nsome text line 2\nsome text line 3\nEOF\n```\n\n`(( expression ))` \u003c-- this will execute/perform an expression\n\n`print BASH env`\n```sh\nprintenv\n```\n\n`echo variables` (example how to access vars in BASH)\n```sh\necho $LANG # \u003c-- LANG env var (bash)\n```\n\n`$RANDOM in BASH will create a random number`\n```sh\necho $RANDOM # \u003c-- 22024 : between 0 and 32767\n```\n\n```sh\nI=0 # \u003c-- passing this in the terminal will persist a var\n(( I++ )) # \u003c-- I will now become 1 and persist\n# we don't need to prepend $ for vars in (( expression ))\n```\n\n`this will print expressions for (( expression )) operations`\n```sh\nhelp let\n```\n##### `View file \"long\" with permissions list`\n```sh\nls -l\n```\n\n`-rw-r--r--` in front of the file indicates the permissions: **`r` = read, `w` = write, `x` = execute**\n**output:** `-rwxr-xr-x` \u003c-- see **`x`** by 3 different \"users\" (all users can execute now)\n##### `Give executable permissions to a file`\n```sh\nchmod +x filename.whatever\n```\n\n`man` command is \"manual\" (like `help`)\n```sh\nman bash # \u003c-- prints manual for bash\nman sleep # \u003c-- prints manual for sleep (binary)\n```\n\n**`-e` flag needed for special characters**\n```sh\necho -e \"\\n~~ Countdown Timer ~~\\n\"\n```\n\n`lists root of the file system`\n```sh\nls /\n```\n_ls /bin will list all binaries on the file system. Bash lives here: #!/bin/bash which will use bash commands. we can access other binaries or libraries here_\n\n\n`lists bash commands`\n```sh\nhelp\n```\n\n`things we can pass to the bash TEST command (for testing true/false (for ifs or [[ EXPRESSIONS ]]))`\n```sh\nhelp test\n```\n\n```sh\n( expression ) # \u003c-- evaluates expression/returns value\n```\n\n```sh\nhelp [[ expression ]] # \u003c-- output below\n```\n\n      ( EXPRESSION )    Returns the value of EXPRESSION\n      ! EXPRESSION              True if EXPRESSION is false; else false\n      EXPR1 \u0026\u0026 EXPR2    True if both EXPR1 and EXPR2 are true; else false\n      EXPR1 || EXPR2    True if either EXPR1 or EXPR2 is true; else false\n\n    When the `==' and `!=' operators are used, the string to the right of\n    the operator is used as a pattern and pattern matching is performed.\n    When the `=~' operator is used, the string to the right of the operator\n    is matched as a regular expression.\n\n    The \u0026\u0026 and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n    determine the expression's value.\n\n    Exit Status:\n    Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n    false or an invalid argument is given.\n\n**`we can evaluate any expression in the BASH terminal or .sh script:`**\n```sh\n[[ 4 -le 5 ]] # \u003c-- `-le` === less-than-or-equal\n```\n\n`echo $?`\n```sh\necho $? # \u003c-- prints last bash command's EXIT STATUS\n0 # \u003c-- 0 === true (0 === no errors)\n\n[[ 4 -ge 5 ]]\necho $?\n1 # \u003c-- 1 === false (\u003e 0 === contains errors | \"false\")\n```\n\n```sh\n[[ 4 -ge 5 ]]; echo $? # \u003c-- run multiple comands on single line with `;`\n1 # \u003c-- output\n```\n\n**_we can think of `0` return as TRUE but it actually means `command had 0 errors`_** (***EXIT STATUS***)\n\n`check if a file exists (and output EXIT STATUS)` **`-a | -e`**\n_THIS WILL CHECK THE FOLDER FROM WHERE THE COMMAND WAS ENTERED_\n```sh\n[[ -a countdown.sh  ]]; echo $?\n0 # \u003c-- output 0 if file exists\n```\n\n`to list all variables in BASH`\n```sh\ndeclare -p\n```\n\n\n`all variables: @ | *`\n```sh\nARR=(\"a\" \"b\" \"c\")\necho ${ARR[@]}\n\ndeclare -p ARR\n# --\u003e declare -a ARR=([0]=\"a\" [1]=\"b\" [2]=\"c\")\n# --\u003e -a === array\n```\n\n`Read (capture user INPUT)`\n\n`capture user input`\n```sh\nread\n```\n\n`Return IP address of Windows Machine as seen from WSL VM`\n```sh\nip route show | grep -i default | awk '{ print $3}'\n```\n### Debugging in Bash\n\n`set -x` _at the top of a script enables debugging (printing executed commands to the terminal)_\n```bash\n#!/bin/bash\n\nset -x\n\n# Your script goes here\n```\n\n# IV. Powershell\n\n`get current path`\n```powershell\n(Get-Item .).FullName\n```\n\n`pipe to clipboard`\n```powershell\n(Get-Item .).FullName | Set-Clipboard\n```\n\n`grep (pipe results to grep)`\n```powershell\n# find errors, excluding warnings, after build\ndotnet build | Select-String \"error\" | Select-String -Pattern \"warning\" -NotMatch\n# default\ndotnet build | Select-String \"error\"\n# OR\ndotnet build | Select-String \"error|warning\"\n# Count\n(dotnet build } Select-String \"error\").Count\n# Show +/- 1 line from output for context\ndotnet build | Select-String \"error\" -Context 1,1\n\n# To search for file names (wildcard)\nGet-ChildItem *.tsx\n# And to pipe that result into a string-contents grep:\nGet=Childitem *.tsx | Select-String \"\u003cbutton\u003e\"\n```\n\n`Measure Objects`\n```C#\n# Measure-Object\nGet-Content \"c:\\your\\file\\path\\example.tsx\" | Measure-Object -Line\n# Can pass args: -Line -Word -Character -Property\n```\n\n`See System ENV K/Vs`\n```C#\nGet-ItemProperty -Path \"HKCU:\\Environment\"\n```\n\n`System Execution Policies (Windows)`\n\u003e https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.5#powershell-execution-policies\n```C#\nGet-ExecutionPolicy -List\n\n# Update Execution Policy\nSet-ExecutionPolicy -ExecutionPolicy \u003cPolicyName\u003e -Scope \u003cscope\u003e\n\n# Set back to Undefined to \"remove\" execution policy (factory defaults all to Undefinend)\nSet-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine\n```\n\n`run cmd prompt in pshell`\n```C#\ncmd  // starts cmd prompt in window\nexit // returns to pshell in window\n```\n\n```\nrun \"external commands\" like .bat or .cmd, executables (.exe) or non-native cmdlets and command-line tools (like in your PATH or full pathed)... \n```\n`\u0026` call operator\n```C#\n\u0026 notepad.exe\n\u0026 calc.exe\n\n\u0026 \"C:\\Path\\To\\SomeExecutable.exe\"\n```\n\n`run single cmd prompt command in pshell`\n```C#\ncmd /c \u003ccommand\u003e\n// e.g.\ncmd /c dir // like ls\ncmd /c set # displays your system env\ncmd /c set \u003e file_name.txt // like cat\n```\n\n`list all running processes w/ binary program names`\n```powershell\nnetstat -ba # will require elevated perm\nnetstat -ban # this will also show IPs\n```\n\n`get powershell version`\n```powershell\n$PSVersionTable.PSVersion\n```\n\n`open persistent PS profile file`\n`will create new $PROFILE if not exists`\n```powershell\ncode $PROFILE.AllUsersAllHosts\n```\n\n`put this inside your $PROFILE.ps1`\n`opens specified dir on shell launch`\n```powershell\nSet-Location C:\\Users\\User\\Dev\n```\n\n`to Set-Alias that takes params`\n```powershell\nfunction ListAll { # script block/fn\n    Get-ChildItem -Force\n}\n\nSet-Alias ls-a ListAll # create Alias/invoke\n# Set-Alias -Name list -Value cmdlet/fn\n# this above syntax only works for no params\n```\n\n`create a symbolic link shortcut to path`\n```powershell\nNew-Item -itemtype symboliclink -Path \"PathWhereYouWantToPutShortcut\" -name \"NameOfShortcut\" -value \"PathOfWhatYourTryingToLinkTo\"\n```\n\n`start transcript of entire session to local file`\n```powershell\nStart-Transcript\nStop-Transcript # stop when done\n```\n\n`find windows IPs`\n```powershell\nipconfig\n```\n\n`find WSL IPs`\n```powershell\nwsl hostname -i\nwsl hostname -I\n```\n\n`Rename directory (like bash mv)`\n```powershell\nRename-Item \"D:\\temp\\Test Test1\"\n```\n\n`open Visual Studio IDE latest version`\n```powershell\nstart devenv\n```\n\n`open Visual Studio IDE specific solution (folder or file)`\n```powershell\nstart devenv solution1.sln # file extension? solution?\n# because I have multiple VS installed on my machine, i need to include the entier absolute path to the executable in order to run from CLI\n```\n\n`open current folder in windows explorer`\n```powershell\nii . # \u003c\u003c-- alias Invoke-item\n```\n\n`create a new file`\n```powershell\nNew-Item example.txt\nni example.txt -type file\n```\n\n`append to file`\n```powershell\n\"content to add\" | add-content -path .\\README.md\n# OR\n\"content to add\" \u003e\u003e .\\README.md\n```\n\n`overwrite file contents`\n```powershell\n\"overwrite stuff\" \u003e .\\README.md\n```\n\n`string literals vs evaluation`\n```powershell\n'Hello $ man' # doesn't evaluate special characters or anything\n\"../blob/$Version\" # $Version is evaluated as a variable expression\n```\n\n`delete recursive rm -rf`\n```C#\nRemove-Item -Recurse -Force \u003cpath\u003e\n```\n\n`move item(s)`\n```powershell\nMove-Item -Path .\\whatever\\files -Destination .\\destination -force\n```\n\n`copy item(s) -recurse if folder`\n```powershell\nCopy-Item -Path .\\the\\files -Recurse -Destination .\\the\\destination -force\n```\n\n`return the IP addr of the WSL (linux distro) VM`\n```powershell\nwsl hostname -I\n```\n\n# V. Command Prompt\n\n`display directory contents`\n```C#\ndir // \u003c\u003c-- windows/cmd version of `ls`\n```\n\n`display system env`\n```C#\nset\n```\n\n`write env to file`\n```C#\nset \u003e file_name.txt\n```\n\n`pipe to clipboard`\n```C#\n// ... | clip\nwhere pip3 | clip\n```\n\n`initiate reboot (\"windows terminal\")`\n```cmd\nshutdown /r /t 0\n(this might only work in windows terminal)\n```\n\n# VI. Oh My ZSH!\n\n`runs zsh powerlvl10k setup (prompt styling)`\n```sh\np10k configure\n```\n\n---\n---\n# :: FRAMEWORKS ::\n---\n\n# VII. Node\n\n`find all running node processes`\n```\nps -ef | grep node\n```\n\n`find node process by port`\n```\nlsof -i :3000\n```\n\n`kill process`\n```\nkill -9 PROCESS_ID\n```\n# VIII. .Net\n\n`clean and build`\n```C#\n// make sure to do this in the directory with the .sln file\ndotnet clean\ndotnet build --configuration Debug\n```\n\n`restore nuget packages`\n```C#\ndotnet restore\n```\n\n`run C# program.cs (entry point)`\n```powershell\ndotnet run\n```\n\n**(VSCODE)**\n\n`generate assets for build and debug`\n```C#\nctrl + shift + p // cmd pallette\n// enter \".net: g\"\n// select \".NET: Generate Assets for Build and Debug\"\n```\n\n`designate custom output/build directory`\n```C#\nURL: https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?view=visualstudio#directorybuildprops-example\n```\n\n**(EF)**\n\u003e https://learn.microsoft.com/en-us/ef/core/cli/dotnet\n\n`project agruments`\n```C#\n// these default to the current directory\n// the ARGS should be directories (not sln or csproj files and they don't need rel or abs paths, just the names)\n// (esp. if you are in their housing dir)\n--startup-project // where EF will build and run to find things like connection string\n--project // where output files (migration and designer files) should go\n```\n\n`EF from the CLI`\n```C#\n// install, update, validate\ndotnet tool install --global dotnet-ef\ndotnet tool update --global dotnet-ef\ndotnet ef\n```\n\n`Add-Migration`\n```C#\ndotnet ef migrations add\ndotnet ef migrations add 0123456789_AddThing\n```\n\n`Update-Database`\n```C#\n// updates DB w/ latest migration (PMC: Update-Database)\ndotnet ef database update\n// or with a specific migration\ndotnet ef database update 20180904195021_InitialCreate\n// or specific DB (connection string)\ndotnet ef database update 20180904195021_InitialCreate --connection your_connection_string\n```\n\n`create new console app .NET`\n```powershell\ndotnet new console -o ./CsharpProjects/TestProject\n# pass `--use-program-main` for Program Class template\n```\n\n`push package to nuget.org`\n```C#\ndotnet nuget push \u003c.\\path\\to\\packed.1.0.0.nupkg\u003e --api-key \u003cabcdef12345\u003e --source https://api.nuget.org/v3/index.json\n```\n\n`CSS Caching with ASP.NET`\n```html\n\u003c!-- tick disable browser cache in browser dev tools... and/or... --\u003e\n\u003c!-- in html markup (razor or w/e framework working w/ .NET)... --\u003e\n\u003clink rel=\"stylesheet\" href=\"~/css/site.css\" asp-append-version=\"true\"\u003e\n\u003c!-- asp-append-version=\"true\" will append a new version ID to the css file that is compiled down... --\u003e\n \u003c!-- ...this ensures proper caching on changes to source --\u003e\n```\n\n# IX. CSS\n`copy css class declarations from web browser`\n```css\n/* When inspecting and adjusting CSS in browser dev tools... */\n/* ...highlight all class declarations you made... */\n/* ...right click and select \"copy all declarations\" */\n```\n\n---\n---\n\n# :: Operating System ::\n---\n\n# X. Ubuntu\n_WSL_\n\n`basic WSL commands docs (including all DISTROs installs)`:\nhttps://learn.microsoft.com/en-us/windows/wsl/basic-commands\n\n`containerize existing project (.devcontainer) with Docker/WSL2 (good for deployment)`:\nhttps://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers#develop-in-remote-containers-using-vs-code\n\n`check Ubuntu version`\n```sh\nlsb_release -a\n```\n\n`cross OS file access (wsl -\u003e win)`\n```sh\ncd /mnt/c\n```\n\n`access linux files w/ win File Explorer`\n```sh\n# navigate to \\\\wsl.localhost\\\n```\n\n`launch win files and programs from WSL`\n```sh\n# e.g.\npowershell.exe /c start\n```\n\n`search for software to install` `\u003capplication\u003e`\n```sh\nsudo apt search \u003caudacity\u003e\n```\n_install vGPU drivers to enable OpenGL rendering_: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps#prerequisites\n\n`install from cli`\n```sh\nsudo apt install audacity\nsudo apt install nautilus # \u003c- LINUX FILE EXPLORER GUI\n```\n\n`killall \u003c-- terminates process`\n```sh\nkillall \u003csnap-store\u003e\n```\n\n# XI. Windows\n\u003e Diagnostics Measuring Source Code (exmaples): docs/core/diagnostics/snippets/resource-monitoring\n`determine machine architecture`\n```cmd\necho %PROCESSOR_ARCHITECTURE%\n```\n\n`invalidate windows hidden icon cache (db)`\n```cmd\nie4uinit.exe -show\n```\n\n`find %UserProfile%`\n```powershell\n# access your home directory (which is typically your user profile, C:\\Users\\\u003cUserName\u003e\ncd ~\n# or you can open Windows File Explorer and enter %UserProfile% \n```\n\n`.wslconfig`\n```powershell\n# documentation: https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig\n# actual contents of .wslconfig @ %UserProfile%\n[wsl2]\nprocessors=10\nmemory=2123366400\nswap=1073741824\n[experimental]\nautoMemoryReclaim=gradual\n\n# the WSL documentation suggests finding the GUI and configuring there:\n# Start \u003e WSL Settings\n\n# the default is half of your RAM (reduce this further)\n# I think the default is all of the processors (e.g. 20) (I reduced this to 10 or 5)\n\n# blog with example .wslconfig\n# https://www.valens.dev/blog/Take-control-of-your-WSL-resources-for-smooth-development\n```\n\n`turn on/off windows features`\n```C#\nControl Panel \u003e Programs \u003e Programs and Features \u003e Turn Windows featrures on or off\n```\n\n`telnet \"allows connecting to other computers remotely\"`\n```C#\n// In \"Turn Windows features on or off\"\n// ... check the Telnet box\n[x] Telnet\n```\n\n`Use Telnet to check the port`\n```powershell\ntelnet \u003caddress\u003e \u003cport_number\u003e\ntelnet google.com 80\n```\n\n`dumbest windows shortcut ever`\n`switch entire windows dekstop`\n```C#\nctrl + win + right // next (new)\nctrl + win + left // prev (all old)\n```\n\n`inside file explorer:`\n```C#\nctrl + l   // focus address bar\ncmd        // enter cmd to open cmd in this location\npowershell // open powershell in this location\n```\n\n`anywhere, but useful inside file explorer`\n`more options include copy path, open powershell here, open linux shell here`\n```C#\nshift + right-click // opens menu with more options\n```\n\n---\n---\n# :: Databases ::\n---\n# XII. SQL\n### MS SQL Server\n\u003e extremely good resource: https://www.mssqltips.com/\n\n`CHECK IF AUTO_UPDATE_STATISTICS IS ON/OFF FOR DB`\n```SQL\nSELECT is_auto_create_stats_on, is_auto_update_stats_on\nFROM sys.databases\nWHERE name = 'YourDatabaseName';\n```\n\n`MANUALLY CREATE A SINGLE COLUMN STATISTIC`\n```SQL\nCREATE STATISTICS STATS_TableName_ColumnName ON [dbo].[TableName] (YourColumn);\n```\n\n`FIND ALL INDEXES IN TABLES (WITH INCLUDES COVERS)`\n```SQL\nSELECT \n    t.name AS TableName,\n    i.name AS IndexName,\n    i.type_desc AS IndexType,\n    STRING_AGG(c.name + CASE WHEN ic.is_included_column = 1 THEN ' (INCLUDE)' ELSE '' END, ', ') AS Columns\nFROM sys.tables t\nJOIN sys.indexes i ON t.object_id = i.object_id\nJOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id\nJOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id\nWHERE t.name IN ('TableOne', 'TableTwo', 'TableThree', 'TableFour', 'TableFive', 'TableSix')\n  AND i.type \u003e 0  -- Exclude heaps\nGROUP BY t.name, i.name, i.type_desc\nORDER BY t.name, i.name;\n```\n\n`CHECK STATISTICS FOR A COLUMN`\n```SQL\nDBCC SHOW_STATISTICS (\"[db].[schema].[table]\",YourColumn)\n```\n\n`CHECK CURRENT STATISTICS/INDEXES (age and activity)`\n```SQL\nSELECT \n    OBJECT_NAME(s.object_id) AS TableName,\n    s.name AS StatName,\n    sp.last_updated,\n    sp.rows,\n    sp.modification_counter\nFROM sys.stats s\nCROSS APPLY sys.dm_db_stats_properties(s.object_id, s.stats_id) sp\nWHERE OBJECT_NAME(s.object_id) IN (\n\t  'YourTable'\n\t, 'YourTable2'\n\t, 'YourTable3'\n\t)\nORDER BY TableName, StatName;\n```\n\n`IDENTIFY WHICH COLUMNS INVOLVED IN QUERIES ARE MISSING STATISTICS`\n```SQL\nSET SHOWPLAN_ALL ON;\n-- REMEMVER TO TURN IT OFF!\n\nSET SHOWPLAN_ALL OFF;\n-- ALL QUERY EXECUTION WILL BE DISABLED ON DB UNTIL YOU DO!\n```\n\n`FIND COLUMN in DB`\n```SQL\nSELECT * FROM information_schema.columns WHERE column_name = 'My_Column'\n```\n\n`SELF REFERENCING TABLE`\n```SQL\nSELECT a.something, b.other\nFROM mytable a, mytable b\nWHERE a.sometest val ...\nAND b.othertest val...\n```\n\n`Find SQL Server Version T-SQL`\n```SQL\nSELECT @@VERSION\n```\n\n`Find Table Constraints`\n```SQL\nSELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE\nWHERE TABLE_NAME = 'Your_Table'\n```\n\n`Find Tables Indexes`\n```SQL\nSELECT\n\tOBJECT_SCHEMA_NAME(object_id) AS SchemaName,\n\tOBJECT_NAME(object_id) AS TableName,\n\tname AS IndexName,\n\ttype_desc AS IndexType\nFROM\n\tsys.indexes\nWHERE\n\tOBJECT_SCHEMA_NAME(object_id) \u003c\u003e 'sys' -- Filter, this can be replaced with OBJECT_NAME(object_id) = 'Your_Table' to target one table\nORDER BY\n\tSchemaName, TableName, IndexName;\n```\n\n`WHEN to clean up CURSOR`\n```SQL\nIF CURSOR_STATUS('local', 'X') \u003e= -1\nBEGIN\n    CLOSE X;\n    DEALLOCATE X\nEND;\n```\n\n`list all schemas in DB`\n```SQL\nSELECT name FROM sys.schemas\n-- dbo -\u003e [dbo].table\n-- lu  -\u003e [lu].table\n-- etc\n```\n\n`Find most recent backups on SQL Server Linux Instance`\n```SQL\nSELECT a.backup_set_id, a.server_name, a.database_name, a.name, a.user_name, a.position, a.software_major_version, a.backup_start_date, backup_finish_date, a.backup_size, a.recovery_model, b.physical_device_name\nFROM msdb.dbo.backupset a join msdb.dbo.backupmediafamily b\n\tON a.media_set_id = b.media_set_id\nWHERE a.database_name = 'YOUR_DB'\nORDER BY a.backup_finish_date DESC\n```\n\n`Select * rows by distinct COLUMN (ROW_NUMBER() window function that will int++ each PARTITION`\n```SQL\nSELECT *\n\tFROM (\n\t\tSELECT *, -- select ALL and...\n\t\t\tROW_NUMBER() OVER (PARTITION BY [ColForDistinct] ORDER BY [AnyCol]) AS ROW_NUMBER -- each partition will reset on next DISTINCT\n\t\tFROM [YourTable]\n\t) AS ROWS\nWHERE ROW_NUMBER = 1 -- ensures only 1 per PARTITION\n```\n\n`Find COLUMN NAME LIKE whole DB` (search part of col)\n```SQL\nSELECT c.name AS 'ColumnName',\n\t\t(SCHEMA_NAME(t.schema_id) + '.' + t.name) AS 'TableName'\nFROM sys.columns c\nJOIN sys.tables t ON c.object_id = t.object_id\nWHERE c.name LIKE '%Keyword%' -- your search keyword\nORDER BY TableName,\n\t\tColumnName;\n```\n\n`Search ALL TABLEs, ALL COLUMNS for row that contains search_term`\n```SQL\nDECALRE @SearchTerm NVARCHAR(255) = 'your_search_term';\nDECLARE @TableName NVARCHAR(255);\nDECLARE @ColumnName NVARCHAR(255);\nDECLARE @SQL NVARCHAR(MAX);\n\nDECLARE TableCursor CURSOR FOR\nSELECT TABLE_NAME, COLUMN_NAME\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE DATA_TYPE IN ('char', 'varchar', 'text', 'nchar', 'nvarchar', 'ntext');\n\nOPEN TableCursor;\nFETCH NEXT FROM TableCursor INTO @TableName, @ColumnName;\n\nWHILE @@FETCH_STATUS = 0\nBEGIN\n\tSET @SQL = 'IF EXISTS (SELECT 1 FROM ' + @TableName + 'WHERE ' + @ColumnName + ' LIKE ''%' + @SearchTerm + '%'') ' + 'PRINT ''' + @TableName + '.' + @ColumnName + '''';\n\tEXEC sp_executesql @SQL;\n\n\tFETCH NEXT FROM TableCursor INTO @TableName, @ColumnName;\nEND;\n\nCLOSE TableCursor;\nDEALLOCATE TableCursor;\n```\n### SSMS\n`TURN ON \"INCLUDE ACTUAL EXECUTION PLAN\"`\n```SQL\nCTRL + M\n```\n\n`fix SSMS won't see new objects/tables`\n```SQL\nEdit \u003e Intellisense \u003e Refresh Local Cache\nOR\nctrl + shift + r\n```\n\n`backup db (this stays on the SQL Server instance)`\n```SQL\nObject Explorer \u003e Right click Database \u003e Tasks \u003e Back Up...\n```\n\n`make bacpac (movable dev copy) of db (can move to disk)`\n```SQL\nObject Explorer \u003e Right click Database \u003e Tasks \u003e Export Data Tier Application\n-- choose local drive\n```\n### ADS\n\n`launch sql profiler`\n```SQL\nalt + p\n-- OR right click on server and select Launch Profiler\n-- SELECT session template (Azure SQL DB only has Standard_OnPrem option)\n```\n\n`stop/restart sql profiler`\n```SQL\nalt + s\n-- THIS is a toggle, to restart press alt + s again\n```\n\n`open a saved XEL (profiler) file`\n```SQL\nctrl + shift + p (cmd palette)\n-- TYPE Profiler: Open XEL File, browse and select file\n-- THIS will open file in the viewer\n```\n\n`output retrieves inserted values`\n```SQL\nINSERT INTO [MyTable] \n(Id, UserId, thingId, IsABool, ADateOrSomething)\nOUTPUT INSERTED.UserId, INSERTED.thingId\nVALUES (...); \n```\n\n---\n---\n# :: Misc. ::\n---\n\n# XIII. Cron\n**For Ubuntu/Debian, you can find `cron`logs at:**\n```bash\n/var/log/syslog\n```\n\n# XIV. Postman\n\n`variables created/stored in \"Environments\" in postman can be passed into fields using {{}}`\n```sh\nClient ID: {{google_client_id}}\nClient Secret: {{google_client_secret}}\n```\n\n```bash\ngrep nri // \u003c--\n```\n\n`To get a list of all listening TCP ports using lsof`\n```bash\nsudo lsof -nP -iTCP -sTCP:LISTEN\n```\n\n`using ss tool (formerly netstat) to list all open ports`\n```bash\nss -tulpn\n```\n\n#  XV. Tree\n\n`tree [OPTIONS] [directory]` (\"`.`\" might not be necessary)\n`List folder structure only directories from current directory`\n```sh\ntree -d .\n```\n\n`List folder structure only directors at depth 1`\n```sh\ntree -d -L 1 .\n```\n\n`List folder structure and all hidden files`\n```sh\ntree -a .\n```\n\n# XVI. Git\n`stash files including new files`\n```bash\ngit stash -u\n```\n\n`recall specific commit from the stash`\n```bash\n# they finally got rid of the awkward @{n} syntax\ngit stash pop 1 # recalls the 2nd index of the stash\n```\n\n`stash only staged files`\n```bash\ngit stash push --staged -m \"Stash only staged changes\"\n```\n\n`tagging commits, usually for release`\n```bash\ngit tag -l # the -l (list) flag is opt\n# lists all current tags\ngit tag v1.0.0 2261e84e\n# tags a commit by sha\ngit tag v1.0.1\n# tags your current commit\ngit tag -a v1.0.2 -m \"annotate this tag\"\n# -a flag for annotate -m for message\n\ngit show v1.0.0\n# this will show associated commit\n\ngit log --pretty=oneline\n# shows all commits pretty\n\ngit push origin --tags\n# this will push all tags that aren't already on the remote up\n```\n\n`see all your commits on target branch`\n`this is good for branches which constantly merge others in`\n```bash\ngit log your-branch --since=\"YYYY-MM-DD\" --until=\"YYYY-MM-DD\" --author=\"YourGit.AuthorName\"\n-- you can find your git author name by running git log\n```\n\n`using the git stash stack`\n```sh\ngit stash # puts all workind dir changes on top of stash stack\ngit stash apply # brings back that level of the stack into working dir (un staged)\ngit stash pop # same as apply except \"pops\" that level off the stack (dropping it)\ngit stash drop # removes the top level of the stack\ngit stash list # shows the entire stack, the newest is always the lowest number\n\ngit stash -u # same as git stash --include-untracked\n# will include more than just modified and staged\ngit stash --all # similar to -u ?\n\ngit stash --patch # stash hunk at a time\n```\n\n`show part of the stash stack as diff`\n```sh\n# n == arbitrary index\ngit stash show -p 'stash@{n}\n```\n\n`git status`\n```sh\ngit status -s # short output\n```\n\n`if you have changes on your remote that you didn't mean to track:`\n`add dir and/or files to .gitignore`\n`then use this command to remove from the index (the actual location in \u003cbaseOfRepo\u003e/.git/index which is your staging area)`\n```bash\ngit rm --cached put/here/your/file.ext # for files\ngit rm --cached folder/\\* # for directory of files\n# append --dry-run # to see what will happen w/o executing\ngit push ... # to update removal and untrack to remote\n```\n`CAUTION: i have only used this on auto-generated files, so i safely know they will be recreated locally upon deletion...`\n`proceed with caution by backing up files if this is not the case for you...`\n\n`bring committed changes back to working directory (e.g. for committed files you want to stash that have not been pushed`\n```bash\ngit reset HEAD~1 --soft\n```\n\n`probably best reset option. discard 2 of 3 git areas`\n```bash\ngit reset --mixed\n# discards commit and staged changes (in the git index) but KEEPS changes in your working dir (files in IDE)\n```\n\n`show remote repo branches state compared with local branches`\n```bash\n# git remote show \u003cremote alias\u003e\ngit remote show origin\n```\n\n`git add --patch \"hunks\"`\n```bash\ngit add -p # shows hunks diff in CLI\n```\n\n`tool for giff from all commits on current branch`\n```shell\ngitk --all\n```\n\n`switch to FILE and discard changes (destructive)`\n```bash\ngit restore\n```\n\n`move between branches (replaces checkout) doesn't discard changes`\n```bash\ngit switch # only takes branch as arg\n# checkout is for switching tags and commits\n```\n#### Rebase\n`how to proceed in interactive rebase`\n```bash\n# git rebase -i or something\n# once you decide the strategy for rebasing (specific files squash, pick, reword, etc)\n# then how to continue after handling merge conflicts and whatnot\ngit add README.txt \u0026\u0026 git rebase --continue\n```\n#### Read git files\n`cat-file will decode git object blobs, binaries`\n```sh\ngit cat-file \u003c -e | -p \u003e hash\n# -e will emit zero status if object exists and non-zero if object is invalid\n# -p will print decoded contents in pretty human readable format\n\ngit cat-file -t hash # prints the git object type\n# e.g. \"tree\" or \"commit\"\n\ngit cat-file -s hash # prints the size of the git object\n# e.g. 34\n```\n\n`how to get git objects to read`\n```sh\ngit log --oneline\n# d4d8373 (HEAD -\u003e main, origin/main) commit msg\ngit cat-file -p d4d8373\n# tree 75e196aa96922bb8077c3d3b92621696c109e76f\n# author Colin Williams \u003ccolin.williams.dev@gmail.com\u003e 1743921108 -0500\n# committer Colin Williams \u003ccolin.williams.dev@gmail.com\u003e 1743921108 -0500\n\n# commit msg\ngit cat-file -p 75e196aa96922bb8077c3d3b92621696c109e76f\n# 040000 tree a232127dbaf14b5532426c58551c092e9a1d347b    .github\n# the hash i passed as the arg is the tree hash\n# .github is the dir i made in this commit\n# we can trace the a23212.. commit, and keep getting tree hashes until we get a \"blob\" hash which is the changed file\n# cat-file that hash and we see the literal file contents at the time of the commit\n# *bonus* no filename, path or metadata will exist in the blob, that data only exists in the tree object\n# (that data is inferred by the location of the object which derrives its hash via SHA-1)\n\n```\n`check out parent commit only for specific file`\n```sh\ngit checkout \u003ccommit-hash\u003e^ -- \u003cfile-path\u003e\n# stages the \"revision\" diff\n# basically like staging a cherry picked \"revert\"\n# which you can test then decide to stage the revision (like an \"undo\")\n# or toss away the staged revision, resuming current functionality\n```\n\n`get merge commits that had conflicts by date`\n```sh\ngit log --merges --since=\"2024-06-01\" --grep=\"^# Conflicts:\" --pretty=oneline\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinwilliams91%2Fexh-cli-cmd-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinwilliams91%2Fexh-cli-cmd-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinwilliams91%2Fexh-cli-cmd-md/lists"}