Skip to content

Instantly share code, notes, and snippets.

@salarmehr
Created July 24, 2021 18:42
Show Gist options
  • Save salarmehr/375f01869250d5bd45e5f7a8a212c605 to your computer and use it in GitHub Desktop.
Save salarmehr/375f01869250d5bd45e5f7a8a212c605 to your computer and use it in GitHub Desktop.
.bashrc
# Directories
alias ll='ls -FGlAhp'
alias lz='ls --human-readable --size -1 -S --classify' #Sort by file size
alias left='ls -t -1' #Sort by modification time
alias ..="cd ../"
alias ...="cd ../../"
alias ....="cd ../../../"
alias .....="cd ../../../../"
alias df="df -h" #disk usage
alias fu="du -ch" # folder usage
alias tfu="du -sh" #total folder usage
# PHP
alias composer='composer'
alias composerd='composer dumpautoload'
alias composero='composer outdated --direct'
alias composerr='composer require'
alias composeru='composer update'
alias art='php artisan'
alias tinker="php artisan tinker"
alias y='yarn'
alias yr='yarn run'
alias test='vendor/bin/phpunit'
# Functions
function mcd () # mkdir "cd"
{
mkdir -p -- "$1" &&
cd -P -- "$1"
}
function cl() # cd ls
{
DIR="$*";
# if no DIR given, go home
if [ $# -lt 1 ]; then
DIR=$HOME;
fi;
builtin cd "${DIR}" && \
# use your preferred ls command
ls -F --color=auto
}
@salarmehr
Copy link
Author

Links and credits:

https://opensource.com/article/19/7/bash-aliases

To add to a docker image type this in the Dockerfile:

COPY .bashrc /tmp
RUN cat /tmp/.bashrc >> /root/.bashrc

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