Categories
Linux

Linux ubuntu terminal Cheatsheet

Well – we all now how easy commands get lost – this is my list of command I sometimes need to lean on.

Crontab

crontab -eShow / modify user’s cronjobs

Git

git add .Add all changes files to commit.
git checkout <branch>Checkout <branch>.
git clone <url>Clone Repository
git commitCommit Changes.
git pull origin masterPull from master branch.
git push origin masterPush to master branch.
git stashStash current changes.

Laravel

php artisan key:generateGenerate Application Key.
php artisan make:factory <Factoryname> –model=<Modelname>Make new factory for Model.
php artisan make:model <modelname> -cmrMake model and include Controller, Migration & Ressource.
php artisan migrateMigrate tables.
php artisan migrate:rollbackUndo last migration.
php artisan serve –port=<port>Serve Application on <Port>.
php artisan tinkerstart new tinker session.

Logs

grep CRON /var/log/syslognpm run watchCheck Cronjob log

npm

npm run watchwatch files and auto compile on change.

mysql

GRANT ALL PRIVILEGES ON *.* TO ‘<username>’@’localhost’ IDENTIFIED BY ‘<password>’;Give new user all permissions for all tables in used database.
REVOKE ALL PRIVILEGES, GRANT OPTION FROM ‘<username>’@’localhost’;Revoke all rights from user
use <dbname>Change database.
CREATE DATABASE ;Create database with

Virtualbox

VBoxManage startvm "<vmName>" --type headlessStart headless virtual box from Terminal

Basic Ubuntu OS Setup

sudo apt-get update;
sudo add-apt-repository ppa:phoerious/keepassxc;
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -;
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list;
sudo apt-get update;
sudo apt-get install sublime-text git-core mysql-server mysql-client libmysqlclient-dev apache2 php php7.2-mbstring php7.2-xml php7.2-soap composer filezilla keepassxc;
git config --global user.name "{{Username}}";
git config --global user.email "{{Email}}";

Bash Alias

alias gc='git commit -m'
alias gps='git push origin'
alias gpl='git pull origin'
alias gl='git log'
alias gst='git status'
alias gsh='git stash'
alias npmrw='npm run watch'
alias gb='git branch'
alias gch='git checkout'

PHP

sudo update-alternatives –config phpSwitch PHP Shell Version

Dualboot System

sudo ntfsfix /dev/sdb1Fix Drive ntfs permission issues for ubuntu / win10 dualboots

Leave a Reply

Your email address will not be published. Required fields are marked *