.Files
These files are an accumulation of bash aliases, shortcuts and functions that i have collected over the years.
While these are Mac specific (for example, the LSCOLORS is different as compared to the GNU LS_COLORS), they can easily be ported for use on Linux.
.bash_profile
Colors
Six basic colors (blue, cyan, green, magenta, red, yellow) have been set in .bash_profile for easy use. You can use these anywhere in the terminal by wrapping the code in appropriate color tags. There is an opening tag in the format of $color_name and a closing tag $color_off at the end. For example:
echo -e "\n${color_cyan}Current date :$color_off " ; date
will echo Current date : in cyan color and then output date in
default color on the next line.
.functions
-
take ()create a dir and cd to it by taking a name -
extract ()Extract most know archives with one command -
ii ()display useful host related informaton -
getwebsite()wget a whole website -
spy()identify and search for active network connections -
sniff()sniff GET and POST traffic over http v2
.aliases
Shortcuts for directories, programs, system processes and commands.
Directories
-
deskgo to Desktop -
dlgo to Downloads -
sandboxgo to ~/Sandbox -
tmpgo to ~/Temp
Installs
-
agiApt-Get Install -y -
updateApt-Get Update -
upgradeApt-Get Update+Upgrade+Clean
Misc.
-
sltopen file with Sublime Text -
emptytrashEmpty the Trash on all mounted volumes and the main HDD -
cleanupRecursively delete .DS_Store files -
chromekillKill all the tabs in Chrome to free up memory -
afkLock the screen (when going AFK) -
reloadReload the shell (i.e. invoke as a login shell) -
treeAlways list the tree command in color coding
Smart Listings
-
lslList all (-a) files and directories in a detailed (-l), human readable (-h), color coded (-G) way. -
lfOnly list directories -
lsdOnly list directories, including hidden ones
Sudo
-
fuck,dang,please,plsrepeat the last command with sudo, basicallysudo !!equivalents
Disk Usage
-
ducksList top ten largest files/directories in current directory -
dsFind the biggest in a folder
Memory
-
wotgobblememWhat's gobbling the memory?
DNS
-
flush,flushdnsFlush DNS cache
IPs
-
ip,myipShow Public IP address -
localipShow local IP ips
Security
-
netlistenersShow active network listeners
.colors
This file has ANSI color codes saved into human readable variables. The variable names and codes have been taken from here and have been kept the same for universal recognition.
While .bash_profile has six color variables added, .colors is a more
elaborate version with eight colors and their bold, underlined,
background, high intensity, bold high intensity and high intensity
background versions.
Usage:
Wrap the code you want to color in the appropriate tags. There is an
opening tag in the format of $Name and a closing tag $Color_Off at
the end. For example
echo -e "\n${Yellow}Current date :$Color_Off " ; date
will echo Current date : in yellow color and then output date in
default color on the next line.
Resources
- Take a look at http://www.commandlinefu.com/commands/browse/sort-by-votes for some really cool aliases