My full.bash_profile is below, feel free to take whatever you find useful and put it to good use. There is a hidden file in your Mac’s user directory named.bash_profile. This file is loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for.
Export PATH export HISTTIMEFORMAT= '%F%T ' HISTSIZE= 100000 # history size use big motherfucker size HISTFILESIZE= 1000 # file log size HISTCONTROL=erasedups # dont dublucate HISTCONTROL=ignorespace #ignorepsaces DATA= ` date ` # variable for `date` HISTFILE= /.bashhistory. $DATA # histfile will look.bashhistori + command `date` export PATH export HISTTIMEFORMAT='%F%T ' HISTSIZE=100000 # history size use big motherfucker size HISTFILESIZE=1000 # file log size HISTCONTROL=erasedups # dont dublucate HISTCONTROL=ignorespace #ignorepsaces DATA=`date` # variable for `date` HISTFILE=/.bashhistory.$DATA # histfile will look.bashhistori + command `date` Here is something very useful for me and i put it in my.bashrc 1. Random pass generator 2.
Simple console calculator 3. Easy access servers with alias. 14: 21 vhristev @hristev:$ genpasswd nHwl.W8Yp4vT-whmn2 14: 21 vhristev @hristev:$ calc 54- 4 50 14: 21 vhristev @hristev:$ ps aux grep nginx root 1920 0.0 0.2? Ss Mar10 0:00 nginx: master process /usr /sbin /nginx www-data 1921 0.0 0.4? S Mar10 0:01 nginx: worker process www-data 1922 0.0 0.4?
S Mar10 0:01 nginx: worker process www-data 1925 0.0 0.4? S Mar10 0:02 nginx: worker process www-data 1926 0.0 0.4? S Mar10 0:02 nginx: worker process 14: 22 vhristev @hristev:$ 14:21vhristev@hristev:$ genpasswd nHwl.W8Yp4vT-whmn2 14:21vhristev@hristev:$ calc 54-4 50 14:21vhristev@hristev:$ ps aux grep nginx root 1920 0.0 0.2? Ss Mar10 0:00 nginx: master process /usr/sbin/nginx www-data 1921 0.0 0.4? S Mar10 0:01 nginx: worker process www-data 1922 0.0 0.4? S Mar10 0:01 nginx: worker process www-data 1925 0.0 0.4?
![Best Best](http://cdn.osxdaily.com/wp-content/uploads/2013/02/better-looking-terminal-mac-os-x.jpg)
S Mar10 0:02 nginx: worker process www-data 1926 0.0 0.4? S Mar10 0:02 nginx: worker process 14:22vhristev@hristev:$ Why I need put colors in my prompt? – We are humans and make mistakes.I remember one day how I execute command on different server and in fact it was not so big deal but if it was???
– If you have 1-2 machines its not so useful but if you have 10 or more you may want to put some RED or YELLOW color in your prompt to identify your important servers. A – the current time in 24-hour HH:MM format 3300;31m – RED 3301;32m – Yellow.
I've spent years curating a collection of Mac bash aliases and shortcuts to make my life easier. My full.bashprofile is below, feel free to take whatever you find useful and put it to good use. A (very) quick primer on.bashprofile for Mac Users There is a hidden file in your Mac’s user directory named.bashprofile.
This file is loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for your command line interface. Within it you can change your terminal prompt, change the colors of text, add aliases to functions you use all the time, and so much more. This file is often called a ‘dot file’ because the ‘.’ at the beginning of it’s name makes it invisible in the Mac Finder. You can view all invisible files in the Terminal by typing ls -al in any directory. How to edit your.bashprofile For the newly initiated, here’s how you can edit the.bashprofile on your Mac. Step 1: Fire up Terminal.app Step 2: Type nano.bashprofile – This command will open the.bashprofile document (or create it if it doesn’t already exist) in the easiest to use text editor in Terminal – Nano. Step 3: Now you can make a simple change to the file.
Paste these lines of code to change your Terminal prompt. Export PS1 = ' w @ h ( u ) n = ' export PS2 = ' = ' Step 4: Now save your changes by typing ctrl +o Hit return to save. Then exit Nano by typing ctrl+x Step 5: Now we need to.activate your changes.
Type source.bashprofile and watch your prompt change. My.bashprofile I have been compiling my own set of aliases and configurations for years in which time I have borrowed copiously from others who have made their aliases available online. I can claim credit for very little of what follows. I recently became aware of, a site making sharing BASH aliases easy. Check it out. Update: Due to popular demand, my bash profile is now for your forking pleasure. Without further ado, here is my.bashprofile.