Logesh Paul
  • Welcome
  • About
  • 📖Wiki
    • Productivity
      • My Ultimate Self Guide - For Better Living
      • Finding your Passion, Purpose of Life
      • Great Techniques To Self Mastery
      • Better Yields Best
      • Who is Driving? You (or) Your Mind
      • Goals
      • My Workdesk (Sep 2024)
      • SublimeText Plugins  —  I Use
    • Code
      • Bash
      • Regex
      • Capybara
      • Chrome
      • CSS
      • Git
      • Mac
      • Atom
      • Ruby
      • Slack
      • Husky
      • Zsh
      • Javascript
      • Best Practices
      • What is debounce?
      • Rbenv
      • Brew
      • RVM
    • Design
      • Why do we need a design system?
    • Health
      • Facts about getting fit
      • TDS and its Role in Drinking Water
      • Gut
    • Mind
      • Behaviour
      • Evolving Brain
      • The Law of Wasted Effort
    • Personal
      • Vision and Values
      • Learning From My First Startup
    • Finance
      • 5 Finance Advices From The Ancient Richest City Of The World
      • Interim Dividend
      • Cash Reserve Ratio
      • Dematerialisation
Powered by GitBook
On this page
  1. Wiki
  2. Code

Bash

General

  • pwd - shows the current directory path

  • ls - lists the files in the current path

  • touch <filename.extension> - creates a new file in the current path

  • cd <path> - checkout to the path

Terminal command - Navigate

  • ctrl + a - to move the cursor to the beginning of the line

  • ctrl + e - to move the cursor to the end of the line

Terminal command - Delete

  • ctrl + w - to delete the last word

  • ctrl + u - to delete all the way back to the start of the line

  • ctrl + k - to delete to the end of the line

Permission

  • sudo chgrp -R admin /usr/local - set write permission for admin for certain dir

  • sudo chown -R $(whoami) /usr/local - makes /usr/local writeable for the user

Port

Find port usage

 ps -ef | grep puma

Kill all processes running on a port

lsof -ti:9000 | xargs kill 

where 9000 is the port number here

Advanced

  • ctrl + r - Search through the command history (after pressing, type to search, press ctrl-r repeatedly to cycle through more matches, press Enter to execute the found command, or hit the right arrow to put the result in the current line to allow editing)

Open VSCode from the terminal

code .
PreviousCodeNextRegex

Last updated 1 year ago

📖