Skip to content

Instantly share code, notes, and snippets.

@toh82
Last active December 7, 2017 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toh82/07bf3862805100a406d689ee88b434de to your computer and use it in GitHub Desktop.
Save toh82/07bf3862805100a406d689ee88b434de to your computer and use it in GitHub Desktop.
Collection of Terminal commands

Symlinks

  • ln -sfn [linkbase] [linktarget] Makes a symbolic link and if the link already exists it creates it with the new options. This does not work for files since the n parameter stand fpr directory.

Database

  • mysqldump -u root -p [DB-NAME] | gzip > [DB-NAME].sql.gz dump a DB and gzip it.
  • zcat [DB-NAME].sql.gz | mysql -u root -p [DB-NAME] import a gzipped dumb to DB.

Git

  • git clone [repo url] --branch [branch name] to clone a repo with a specific branch
  • git rebase -i [Startpoint of changes commit/branch] leads to rebase
  • git cherry-pick [lost commit] if your Branch Label was set wrong f.e. you accidentaly killed one commit cou can checkout that branch and cherry pick the commit into

Composer

  • composer run-script post-update-cmd -vvv -- --redeploy redeploys a composer project

PHP Modules

if you're on php5.5 then it is sudo php5enmod xdebug sudo php5dismod xdebug for higher versions it is sudo phpenmod module sudo phpdismod module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment