Command Line Snippets do you keep handy?

Judith - May 12 '20 - - Dev Community

Here are a few commands I keep handy:

Bash
// root login ssh
ssh root@my-ip-here

// find PID
sudo lsof -i :

// kill port
sudo kill -9

// To remove a directory that contains other files or directories
rm -r mydir

// don't receive a prompt for each file being removed
rm -rf mydir

Brew
brew update && brew upgrade && brew cleanup && brew doctor

Git
// remove a repo
find . -type f | grep -i ".git" | xargs rm
cd ..
rm -rf

//sets your name and email for commit messages
git config --global user.name 'John Doe'
git config --global user.email johndoe@example.com

// helps recover from mess ups! a log of your last few actions

git reflog

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player