Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Color your Mac Terminal?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="cradom" data-source="post: 345325" data-attributes="member: 305283"><p>Thats because it's not there by default. Try the following:</p><p>Copy this:</p><p></p><p># ~/.bashrc: executed by bash(1) for non-login shells.</p><p></p><p>export PS1='\u@\h<img src="/mac_images/images/smilies/Undecided.png" class="smilie" loading="lazy" alt=":\" title="Undecided :\" data-shortname=":\" />w$ '</p><p>umask 022</p><p></p><p>##########################################</p><p>#setting up file completion</p><p>#</p><p></p><p>if [ -f ~/.bash_completion ];</p><p>then</p><p> . ~/.bash_completion;</p><p>fi</p><p></p><p></p><p>############################################</p><p># You may uncomment the following lines if you want 'ls' to be colorized:</p><p>#</p><p></p><p> export CLICOLOR='true'</p><p> export LSCOLORS="gxfxcxdxbxegedabagacad"</p><p> </p><p>###########################################</p><p># set up aliases</p><p>#</p><p> </p><p>alias ll='ls -laghF'</p><p>alias l='ls -laghF'</p><p>alias grep='grep -n'</p><p>alias netconns='netstat -a -f inet'</p><p>alias cd..='cd ..'</p><p>alias ..='cd ..'</p><p>alias cls='clear'</p><p># alias vi='vim'</p><p># alias c++='g++'</p><p># alias cc='gcc'</p><p>#</p><p># Some more alias to avoid making mistakes:</p><p># alias rm='rm -i'</p><p># alias cp='cp -i'</p><p># alias mv='mv -i'</p><p>alias ttop='top -ocpu -R -F -s 2 -n30'</p><p></p><p></p><p>Now type "pico .bashrc" (or you can use nano) without the quotes.</p><p>Paste the above into it.</p><p>Save. Quit and restart Terminal.</p><p>Your files and directories should now be in color.</p><p></p><p>You can set different colored prompts by using escape characters. Just add the codes to .bashrc. I use the one called "bash_styles". It lets you change prompts on the fly without having to restart Terminal.</p></blockquote><p></p>
[QUOTE="cradom, post: 345325, member: 305283"] Thats because it's not there by default. Try the following: Copy this: # ~/.bashrc: executed by bash(1) for non-login shells. export PS1='\u@\h:\w$ ' umask 022 ########################################## #setting up file completion # if [ -f ~/.bash_completion ]; then . ~/.bash_completion; fi ############################################ # You may uncomment the following lines if you want 'ls' to be colorized: # export CLICOLOR='true' export LSCOLORS="gxfxcxdxbxegedabagacad" ########################################### # set up aliases # alias ll='ls -laghF' alias l='ls -laghF' alias grep='grep -n' alias netconns='netstat -a -f inet' alias cd..='cd ..' alias ..='cd ..' alias cls='clear' # alias vi='vim' # alias c++='g++' # alias cc='gcc' # # Some more alias to avoid making mistakes: # alias rm='rm -i' # alias cp='cp -i' # alias mv='mv -i' alias ttop='top -ocpu -R -F -s 2 -n30' Now type "pico .bashrc" (or you can use nano) without the quotes. Paste the above into it. Save. Quit and restart Terminal. Your files and directories should now be in color. You can set different colored prompts by using escape characters. Just add the codes to .bashrc. I use the one called "bash_styles". It lets you change prompts on the fly without having to restart Terminal. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Color your Mac Terminal?
Top