- Mac add alias terminal how to#
- Mac add alias terminal install#
- Mac add alias terminal update#
- Mac add alias terminal mac#
Reload the bash profile, In Terminal, run: source ~/.
Press ESC key, Type :wq, and hit Enter to save and exit.
Mac add alias terminal update#
alias poweroff= 'sudo /sbin/shutdown -h now ' # All other aliases alias ls= 'ls -aFhlG ' alias ll= 'ls -l ' alias search=grepĪlias ports= 'sudo lsof -iTCP -sTCP:LISTEN -P ' # Run second instance of Skype (Good for using multiple accounts) alias ss= 'sudo /Applications/Skype.app/Contents/MacOS/Skype /secondary ' # Get OS X Software Updates, update Homebrew itself, and upgrade installed Homebrew packages alias update= "sudo softwareupdate -i -a brew update brew upgrade " # Speed-up Terminal load time by clearing system logs alias speedup= "sudo rm -rf /private/var/log/asl/* " # Empty the Trash on all mounted volumes and the main HDD # Also, clear Apple’s System Logs to improve shell startup speed alias emptytrash= "sudo rm -rfv /Volumes/*/.Trashes sudo rm -rfv ~/.Trash speedup " # IP addresses # To get my external IP alias myip= 'curl ' # Other IP / Method alias ip= "dig +short " alias localip= "ifconfig en0 inet | grep 'inet ' | awk ' ' " alias ips= "ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ & print $1' " # Enhanced WHOIS lookups alias whois= "whois -h " # Show Hidden files in Finder alias finder_s= 'defaults write AppleShowAllFiles TRUE killAll Finder ' # Hide Hidden files in Finder alias finder_h= 'defaults write AppleShowAllFiles FALSE killAll Finder '
Mac add alias terminal mac#
~/.bash_profile ' # Mac get stuck very often and are extremely slow and unstable on shutdowns. name *.DS_Store -type f -delete ' # An alias to start my custom MySQL installation instead of the default one alias mysql= '/usr/local/mysql-5.5.25-osx10.6-x86_64/bin/mysql -u root ' # This alias reloads this file alias reload_profile= '. DS_Store files in the folder I am currently in alias killDS= 'find.
Mac add alias terminal install#
/./././ ' # Flush DNS (Mac OS X Moutain Lion or Lion) alias dnsflush= 'sudo killall -HUP mDNSResponder ' # To clear terminal alias c= 'clear ' # To exit terminal alias e= 'exit ' # See alias sudo= 'sudo ' # This helps me edit files that my user isn't the owner of alias edit= 'SUDO_EDITOR="open -FWne" sudo -e ' # The alias that takes me here - to editing these very aliases alias edit_profile= 'open -e ~/.bash_profile ' # I do a lot of web development, so I need to edit these non-owned files fairly often alias edit_hosts= 'edit /etc/hosts ' alias edit_httpd= 'edit /etc/apache2/nf ' alias edit_php= 'edit /etc/php.ini ' alias edit_vhosts= 'edit /etc/apache2/extra/nf ' # Some of my goto commands, including one to open the php extension folder for when I need to install custom extensions alias goto_web= 'cd ~/Sites ' alias goto_phpext= 'sudo open /usr/lib/php/extensions/no-debug-non-zts-20100525 ' # Go to MAMP/htdocs alias goto_htdocs= 'cd /Applications/MAMP/htdocs ' # This alias recursively destroys all. Have fun.# Laravel Artisan alias art= 'php artisan ' # Open file with Sublime Text 2 $ st /folder/example.php alias st= 'open -a "Sublime Text 2" ' # Jump back n directories at a time alias. You can find yours by just running a straight ifconfig to see what IP's you need to strip out.Īlso, I found some of the commands on the Web, some I created. One note, the Local IP info string strips out the loopback IP and my VMware fusion IP's. The shortcut is the word after alias and before the =. Once done, you can just use "src" in the future (the first alias) to reload the profile after you make additional changes. Then you’ll drag your new alias onto the right side of your Dock. The commands won't work right off the bat, you'll need to load/reload the profile. How do I add an alias to my Mac Dock What you’ll do first is create an alias of the folder by right-clicking on it and picking from the contextual menu (or by pressing Command-L when it’s selected). # Get local IP info - removes loopback and static VMware fusionĪlias ip='ifconfig | grep "inet " | grep -v 127.0.0.1 | grep -v 192.168.223.1 | grep -v 192.168.210.1'Īlias vrt="netstat -rn | grep utun | grep UGSc" bash_profileĪdd the following commands in to the file.Īlias flush="sudo killall -HUP mDNSResponder" I like vi but if you don't know what it is, don't use it. In order to edit the file, you need to open a text editor of some sort. That character between -al and grep is the pipe. bash_profile? If yes, then you can just edit that, if not it needs to be created. This lists all the files starting with.
Mac add alias terminal how to#
If you don't know how to open terminal, close the browser, go get some ice cream and don't come back. If you've installed things like MacPorts then one may have been created already. A default Mac build likely doesn't have a. In order to use a terminal alias, you need a. Alias commands allow for quick shortcuts to longer commands that you may want run in the terminal. You can add user-defined aliases to /.bashrc file.
Use alias command to display a list of all defined aliases. The alias command allows the user to launch any command or group of commands (including options and filenames) by entering a single word. One of the little things I enjoyed on Linux was using alias commands on the terminal. A n bash shell alias is nothing but the shortcut to commands.