Terminal & Dev Tricks
Command-line and developer tricks most people never learn.
ok so i used python m http.server to move photos from my PC to my phone on the same Wi Fi 😭 Started the server in the folder, opened my PC's local IP address with :8000 on the phone, and downloaded them from teh listing. No cables, no cloud. But then I…
wttr.in tricks: 1. curl wttr.in: forecast for your location. 2. curl wttr.in/Paris: a specific city. 3. curl wttr.in/Moon: moon phase. 4. curl "wttr.in/Paris?format=3": one line output. 5. curl wttr.in/:help: all options. Works with PowerShells curl.exe on…
ctrl+R in steps: 1. Press Ctrl+R. 2 👍 Type part of a previous command. 3 🤦 Ctrl+R again for older matches. 4. Enter to run, or arrow key to edit first. 5. Ctrl+G (bash) or Ctrl+C to cancel. tip: bash keeps a limited history by default, set HISTSIZE and…
ugh. i was jumping between a deep project folder and /var/log over and over, typing teh full paths each time. then I learned cd . It takes you back to the previous directory, and running it again takes you back again. It toggles between two places. then i…
DevTools tricks that saved me time this week: 1 :D Ctrl+Shift+P: command menu, try "screenshot" or "dark". 2. $0: currently selected element in the cnosole. 3. copy(something): copies any value to teh clipboard. 4. document.designMode = "on": makes teh page…
Today i learned i can keep a command out of bash history by starting it with a space, as long as HISTCONTROL includes ignorespace or ignoreboth. Ubuntu's default .bashrc uses ignoreboth, so it probably already works for many people. also, history grep was…
guys pls help i type git status about a hundred times a day :) Then i learned Git supports aliases. One command: git config global alias.st status now git st works. my favorite is a pretty log: git config global alias.lg "log oneline graph decorate all".…
im literally losing my mind here a coworker told me to run telnet towel.blinkenlights.nl and I didnt believe what happened. A version of Star Wars: A New Hope started playing as ASCII art animation right in my terminal. Its a fan project thats been aronud…
im literally losing my mind here git rescue in steps: 1. Don't panic, and don't run git gc. 2, run git reflog to see recent HEAD positions. 3, find teh entry from before teh mistake (reset, rebase, checkout). 4. Create a branch there: git branch rescue <hash…
so annoyed rn i just learned that !! in bash means "previous command", so sudo !! reruns teh last command as root, i also found Alt+... which pastes the last argument of teh previous command where my cursor is... press it repeatedly to go back through…