Linux commands

# Find directory or files recursively
find . -type d -name ".idea" -print
find . -type f -name "*.iml" -print

# List the directories starting with "."
ls -ld .*?

# Extract to a folder
tar -xvf file.tar.gz -C directory/

# Change the ownership
chown -R admin:admin directory/

Docker commands

# Install docker and enable on startup
sudo yum install -y docker
sudo usermod -a -G docker admin-user
sudo systemctl enable docker
sudo chkconfig docker on
sudo systemctl start docker

# Delete the docker images and containers
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -aq)
docker system prune --volumes -f
docker system prune -a

Install packages

pip install <package-name>
npm install -g <package-name>
brew install <package-name>

# Install sdkman
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk version
sdk list java
sdk current         # Show current installed
sdk install java <IDENTIFIER>
sdk upgrade         # Upgrade the defaults installed, if any
sdk update          # Get new candidates, if any

Upgrade packages

# --user : Installs to the user directory
# --upgrade : Upgrades to the newest available version
pip install <package-name> --upgrade --user

# Installs the latest npm package
npm i -g <package-name>

# Updates and upgrades all the packages installed via Homebrew
brew update
brew upgrade

# Verifies if sym links and installs are proper
brew doctor

# Unlink and downgrade version
node -v
brew unlink node
brew install node@14
brew link node@14
node -v

List all global packages of pip, npm and brew

npm list -g --depth 0
pip list
brew list
brew leaves

Delete packages

# Deleting the packages installed from pip
pip freeze > requirements.txt
pip uninstall -r requirements.txt -y