i only ever use bash on my terminals because using powershell makes me want to kill myself. i use git bash for windows alongside bash in WSL ubuntu.
i'm new to all this so i've explained some things from how i understand them. feel free to e-mail me if i got something wrong though 
overall
clear- clears the terminal screen.touch [filename]- creates a file.cd [dirname]- moves where you are.cd -gets you to the directory you were previously at.mkdir [dirname]- makes a directory / folder.exit- exit terminal.history- gives you a history of your inputs. tip: you can use a command again by typing an ! and the line number directly by it.help- more info.start [filename]- opens a file.mv [source file] [destination directory or renaming]- for renaming / moving filespwd- shows you where you currently arewhich [program-name]- tells you the location path the terminal is using to locate the program.ls- lists files of the directory you're currently in.ls -lfor a more detailed listing.ls -ato show hidden files.ls --helphelp!!!rm- remove a file.echo- outputs whatever you give it.cat [filename]- outputs the contents of that file in the terminalscp [source file] [destination directory]- lets you copy files between different computers with sshcp [filename1] [newfile]- copies a files. you can also achieve the same withcat <[filename1]> [newfile]find -name '*[search]*'- searches for files with that word.sudo- run things as a superuserwinget- package manager for windowsCTRL+clets you quit / terminate anything that's happening on your terminalwc [filename]- gives you the amount of lines, words, and bytes a file has[command] > file.txtwill output the display of that command into the file.txt, overwriting it.[command] >> file.txtwill output the display of that command into the file.txt, appending it (does not overwrite it).
editors
nano [filename]- opens the file in the terminal with nano! should already be in your terminalnotepad [filename]- opens file on notepad
operators
&&- logical and. it will execute two or more commands at once. i use this combo a lot when compiling and running C++ programs:gcc -o main file.cpp && ./main|- pipe. it will what's on the left as input and feed it to whatever command is on the right.>- output redirection. mostly use it to save terminal outputs on a txt file:git status > git-status.txt>>output append. same as above but instead of overwriting a file, it appends to the file
notes
- when using ! in file or directory names, bash needs to escape it using the backslash. if i have a folder called !g/ then you would write
\!g/on the terminal. - files with spaces need to be closed with single or double quotes like this
'folder 1' - use
qto quit some scripts - under
~/.profile,~/.bashrc, or~/.bash_profileyou can set up variables for paths you frequently use. img of my .profile, you can use them in the terminal as variables using this$symbol. example:cd $DOQMEATwill take me to the path i assigned the variable "DOQMEAT" to. - i love customizing my terminal with oh-my-posh. here's how my git bash looks like
programs
you have to download this stuff in order to use them!
tldr [command]- gives you briefs explanations of what that command does
node.js / npm
npx http-server -o [filepath]- local http server for you to preview your site!-oopens the browsers upon executing the command
git
git help- help for git commands.git init- initializes a repogit status- list changesgit restore [filename]- restores a filegit add [files] [dirs]- things to stage for agit commit. you can also usegit add -pand it will ask you to yes or no every change before adding it. you can also dogit add .to add all changes made to that current directory.git diff [filename]- shows you the changes of that filegit commit -m "[your message here!]"- commits changes while also adding a message to them.git push- pushes the code out there.git fetch- fetches code.git pull- pulls code for any changes.git diff --stat --cached [remote/branch]- shows you commits that are about to be pushed. remote/branch is usuallyorigin/mainfor me.git show- show changes madegit log- previous commitsrm -rf .git- deletes the .git folder, if you don't want git in your directory then do this.