Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Last active December 4, 2017 18:00
Show Gist options
  • Save darth-veitcher/8165ef25b7b473ef9fa5d88dab83b1c0 to your computer and use it in GitHub Desktop.
Save darth-veitcher/8165ef25b7b473ef9fa5d88dab83b1c0 to your computer and use it in GitHub Desktop.
random useful terminal commands

Get the lastest version of a git repository

# Initialise empty repo and set remote
# (this way we can only download tags not whole repo)
git init
git remote add origin https://github.com/my/repo.git

# Get new tags from the remote
git fetch --tags

# Get the latest tag name
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)

Get codename (e.g. Jessie) for Ubuntu / Debian

lsb_release -cs

Find all folders in subdirectories with a certain name and show their size (basically prove a find with an exec at end)

find . -type d -name "Plex Versions" -exec du -sh {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment