redoules.github.io/linux/bashrc.html
Guillaume 44f740504b added an article
about uploading data to a sharepoint site
2020-07-20 20:20:09 +02:00

325 lines
20 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Data Science for Political and Social Phenomena">
<meta name="author" content="Guillaume Redoulès">
<link rel="icon" href="../favicon.ico">
<title>What's inside my .bashrc ? - Linux</title>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="../theme/js/jquery.min.js"><\/script>')
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="../theme/css/bootstrap.css" />
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="../theme/css/ie10-viewport-bug-workaround.css" />
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="../theme/css/style.css" />
<link rel="stylesheet" type="text/css" href="../theme/css/notebooks.css" />
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700|Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="tags" content="Bash" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="..">Guillaume Redoulès</a>
</div>
<div class="navbar-collapse collapse" id="searchbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../pages/about.html">About Guillaume</a></li>
<li><a href="https://github.com/redoules">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/guillaume-redoul%C3%A8s-33923860/">LinkedIn</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Science<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="..#Blog">Blog</a></li>
<li><a href="..#Python">Python</a></li>
<li><a href="..#Bash">Bash</a></li>
<li><a href="..#SQL">SQL</a></li>
<li><a href="..#Mathematics">Mathematics</a></li>
<li><a href="..#Machine_Learning">Machine Learning</a></li>
<li><a href="..#Projects">Projects</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Projects<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/redoules/redoules.github.io">Notes (Github)</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a href="../feeds/blog.rss.xml">Blog RSS</a>
</li>-->
</ul>
<form class="navbar-form" action="../search.html" onsubmit="return validateForm(this.elements['q'].value);">
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<input class="form-control search-query" name="q" id="tipue_search_input" placeholder="e.g. scikit KNN, pandas merge" required autocomplete="off" type="text">
</div>
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- end of header section -->
<div class="container">
<!-- <div class="alert alert-warning" role="alert">
Did you find this page useful? Please do me a quick favor and <a href="#" class="alert-link">endorse me for data science on LinkedIn</a>.
</div> -->
<section id="content" class="body">
<header>
<h1>
What's inside my .bashrc ?
</h1>
<ol class="breadcrumb">
<li>
<time class="published" datetime="2018-08-22T22:22:00+02:00">
22 août 2018
</time>
</li>
<li>Linux</li>
<li>Bash</li>
</ol>
</header>
<div class='article_content'>
<div class="highlight"><pre><span></span><span class="c1"># ~/.bashrc: executed by bash(1) for non-login shells.</span>
<span class="c1"># see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)</span>
<span class="c1"># for examples</span>
<span class="c1"># If not running interactively, don&#39;t do anything</span>
<span class="k">case</span> <span class="nv">$-</span> in
*i*<span class="o">)</span> <span class="p">;;</span>
*<span class="o">)</span> <span class="k">return</span><span class="p">;;</span>
<span class="k">esac</span>
<span class="c1"># don&#39;t put duplicate lines or lines starting with space in the history.</span>
<span class="c1"># See bash(1) for more options</span>
<span class="nv">HISTCONTROL</span><span class="o">=</span>ignoreboth
<span class="c1"># append to the history file, don&#39;t overwrite it</span>
<span class="nb">shopt</span> -s histappend
<span class="c1"># for setting history length see HISTSIZE and HISTFILESIZE in bash(1)</span>
<span class="nv">HISTSIZE</span><span class="o">=</span><span class="m">1000</span>
<span class="nv">HISTFILESIZE</span><span class="o">=</span><span class="m">2000</span>
<span class="c1"># check the window size after each command and, if necessary,</span>
<span class="c1"># update the values of LINES and COLUMNS.</span>
<span class="nb">shopt</span> -s checkwinsize
<span class="c1"># If set, the pattern &quot;**&quot; used in a pathname expansion context will</span>
<span class="c1"># match all files and zero or more directories and subdirectories.</span>
<span class="c1">#shopt -s globstar</span>
<span class="c1"># make less more friendly for non-text input files, see lesspipe(1)</span>
<span class="o">[</span> -x /usr/bin/lesspipe <span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="nb">eval</span> <span class="s2">&quot;</span><span class="k">$(</span><span class="nv">SHELL</span><span class="o">=</span>/bin/sh lesspipe<span class="k">)</span><span class="s2">&quot;</span>
<span class="c1"># set variable identifying the chroot you work in (used in the prompt below)</span>
<span class="k">if</span> <span class="o">[</span> -z <span class="s2">&quot;</span><span class="si">${</span><span class="nv">debian_chroot</span><span class="k">:-</span><span class="si">}</span><span class="s2">&quot;</span> <span class="o">]</span> <span class="o">&amp;&amp;</span> <span class="o">[</span> -r /etc/debian_chroot <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nv">debian_chroot</span><span class="o">=</span><span class="k">$(</span>cat /etc/debian_chroot<span class="k">)</span>
<span class="k">fi</span>
<span class="c1"># set a fancy prompt (non-color, unless we know we &quot;want&quot; color)</span>
<span class="k">case</span> <span class="s2">&quot;</span><span class="nv">$TERM</span><span class="s2">&quot;</span> in
xterm-color<span class="p">|</span>*-256color<span class="o">)</span> <span class="nv">color_prompt</span><span class="o">=</span>yes<span class="p">;;</span>
<span class="k">esac</span>
<span class="c1"># uncomment for a colored prompt, if the terminal has the capability; turned</span>
<span class="c1"># off by default to not distract the user: the focus in a terminal window</span>
<span class="c1"># should be on the output of commands, not on the prompt</span>
<span class="nv">force_color_prompt</span><span class="o">=</span>yes
<span class="k">if</span> <span class="o">[</span> -n <span class="s2">&quot;</span><span class="nv">$force_color_prompt</span><span class="s2">&quot;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="k">if</span> <span class="o">[</span> -x /usr/bin/tput <span class="o">]</span> <span class="o">&amp;&amp;</span> tput setaf <span class="m">1</span> &gt;<span class="p">&amp;</span>/dev/null<span class="p">;</span> <span class="k">then</span>
<span class="c1"># We have color support; assume it&#39;s compliant with Ecma-48</span>
<span class="c1"># (ISO/IEC-6429). (Lack of such support is extremely rare, and such</span>
<span class="c1"># a case would tend to support setf rather than setaf.)</span>
<span class="nv">color_prompt</span><span class="o">=</span>yes
<span class="k">else</span>
<span class="nv">color_prompt</span><span class="o">=</span>
<span class="k">fi</span>
<span class="k">fi</span>
<span class="k">if</span> <span class="o">[</span> <span class="s2">&quot;</span><span class="nv">$color_prompt</span><span class="s2">&quot;</span> <span class="o">=</span> yes <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nv">PS1</span><span class="o">=</span><span class="s1">&#39;${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ &#39;</span>
<span class="k">else</span>
<span class="nv">PS1</span><span class="o">=</span><span class="s1">&#39;${debian_chroot:+($debian_chroot)}\u@\h:\w\$ &#39;</span>
<span class="k">fi</span>
<span class="nb">unset</span> color_prompt force_color_prompt
<span class="c1"># If this is an xterm set the title to user@host:dir</span>
<span class="k">case</span> <span class="s2">&quot;</span><span class="nv">$TERM</span><span class="s2">&quot;</span> in
xterm*<span class="p">|</span>rxvt*<span class="o">)</span>
<span class="nv">PS1</span><span class="o">=</span><span class="s2">&quot;\[\e]0;</span><span class="si">${</span><span class="nv">debian_chroot</span><span class="p">:+(</span><span class="nv">$debian_chroot</span><span class="p">)</span><span class="si">}</span><span class="s2">\u@\h: \w\a\]</span><span class="nv">$PS1</span><span class="s2">&quot;</span>
<span class="p">;;</span>
*<span class="o">)</span>
<span class="p">;;</span>
<span class="k">esac</span>
<span class="c1"># enable color support of ls and also add handy aliases</span>
<span class="k">if</span> <span class="o">[</span> -x /usr/bin/dircolors <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">test</span> -r ~/.dircolors <span class="o">&amp;&amp;</span> <span class="nb">eval</span> <span class="s2">&quot;</span><span class="k">$(</span>dircolors -b ~/.dircolors<span class="k">)</span><span class="s2">&quot;</span> <span class="o">||</span> <span class="nb">eval</span> <span class="s2">&quot;</span><span class="k">$(</span>dircolors -b<span class="k">)</span><span class="s2">&quot;</span>
<span class="nb">alias</span> <span class="nv">ls</span><span class="o">=</span><span class="s1">&#39;ls --color=auto&#39;</span>
<span class="c1">#alias dir=&#39;dir --color=auto&#39;</span>
<span class="c1">#alias vdir=&#39;vdir --color=auto&#39;</span>
<span class="nb">alias</span> <span class="nv">grep</span><span class="o">=</span><span class="s1">&#39;grep --color=auto&#39;</span>
<span class="nb">alias</span> <span class="nv">fgrep</span><span class="o">=</span><span class="s1">&#39;fgrep --color=auto&#39;</span>
<span class="nb">alias</span> <span class="nv">egrep</span><span class="o">=</span><span class="s1">&#39;egrep --color=auto&#39;</span>
<span class="k">fi</span>
<span class="c1"># colored GCC warnings and errors</span>
<span class="c1">#export GCC_COLORS=&#39;error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01&#39;</span>
<span class="c1"># some more ls aliases</span>
<span class="nb">alias</span> <span class="nv">ll</span><span class="o">=</span><span class="s1">&#39;ls -alF&#39;</span>
<span class="nb">alias</span> <span class="nv">la</span><span class="o">=</span><span class="s1">&#39;ls -A&#39;</span>
<span class="nb">alias</span> <span class="nv">l</span><span class="o">=</span><span class="s1">&#39;ls -CF&#39;</span>
<span class="c1"># Add an &quot;alert&quot; alias for long running commands. Use like so:</span>
<span class="c1"># sleep 10; alert</span>
<span class="nb">alias</span> <span class="nv">alert</span><span class="o">=</span><span class="s1">&#39;notify-send --urgency=low -i &quot;$([ $? = 0 ] &amp;&amp; echo terminal || echo error)&quot; &quot;$(history|tail -n1|sed -e &#39;</span><span class="se">\&#39;</span><span class="s1">&#39;s/^\s*[0-9]\+\s*//;s/[;&amp;|]\s*alert$//&#39;</span><span class="se">\&#39;</span><span class="s1">&#39;)&quot;&#39;</span>
<span class="c1"># Alias definitions.</span>
<span class="c1"># You may want to put all your additions into a separate file like</span>
<span class="c1"># ~/.bash_aliases, instead of adding them here directly.</span>
<span class="c1"># See /usr/share/doc/bash-doc/examples in the bash-doc package.</span>
<span class="k">if</span> <span class="o">[</span> -f ~/.bash_aliases <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
. ~/.bash_aliases
<span class="k">fi</span>
<span class="c1"># enable programmable completion features (you don&#39;t need to enable</span>
<span class="c1"># this, if it&#39;s already enabled in /etc/bash.bashrc and /etc/profile</span>
<span class="c1"># sources /etc/bash.bashrc).</span>
<span class="k">if</span> ! <span class="nb">shopt</span> -oq posix<span class="p">;</span> <span class="k">then</span>
<span class="k">if</span> <span class="o">[</span> -f /usr/share/bash-completion/bash_completion <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
. /usr/share/bash-completion/bash_completion
<span class="k">elif</span> <span class="o">[</span> -f /etc/bash_completion <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
. /etc/bash_completion
<span class="k">fi</span>
<span class="k">fi</span>
<span class="c1"># export PATH=&quot;/home/guillaume/anaconda3/bin:$PATH&quot; # commented out by conda initialize</span>
<span class="c1">#source activate base</span>
<span class="c1"># &gt;&gt;&gt; conda initialize &gt;&gt;&gt;</span>
<span class="c1"># !! Contents within this block are managed by &#39;conda init&#39; !!</span>
<span class="nv">__conda_setup</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span><span class="s1">&#39;/home/guillaume/anaconda3/bin/conda&#39;</span> <span class="s1">&#39;shell.bash&#39;</span> <span class="s1">&#39;hook&#39;</span> <span class="m">2</span>&gt; /dev/null<span class="k">)</span><span class="s2">&quot;</span>
<span class="k">if</span> <span class="o">[</span> <span class="nv">$?</span> -eq <span class="m">0</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">eval</span> <span class="s2">&quot;</span><span class="nv">$__conda_setup</span><span class="s2">&quot;</span>
<span class="k">else</span>
<span class="k">if</span> <span class="o">[</span> -f <span class="s2">&quot;/home/guillaume/anaconda3/etc/profile.d/conda.sh&quot;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
. <span class="s2">&quot;/home/guillaume/anaconda3/etc/profile.d/conda.sh&quot;</span>
<span class="k">else</span>
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="s2">&quot;/home/guillaume/anaconda3/bin:</span><span class="nv">$PATH</span><span class="s2">&quot;</span>
<span class="k">fi</span>
<span class="k">fi</span>
<span class="nb">unset</span> __conda_setup
<span class="c1"># &lt;&lt;&lt; conda initialize &lt;&lt;&lt;</span>
<span class="nb">source</span> activate base
</pre></div>
</div>
<aside>
<div class="bug-reporting__panel">
<h3>Find an error or bug? Have a suggestion?</h3>
<p>Everything on this site is avaliable on GitHub. Head on over and <a href='https://github.com/redoules/redoules.github.io/issues/new'>submit an issue.</a> You can also message me directly by <a href='mailto:guillaume.redoules@gadz.org'>email</a>.</p>
</div>
</aside>
</section>
</div>
<!-- start of footer section -->
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 119 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.
</center>
</p>
</div>
</footer>
<!-- This jQuery line finds any span that contains code highlighting classes and then selects the parent <pre> tag and adds a border. This is done as a workaround to visually distinguish the code inputs and outputs -->
<script>
$( ".hll, .n, .c, .err, .k, .o, .cm, .cp, .c1, .cs, .gd, .ge, .gr, .gh, .gi, .go, .gp, .gs, .gu, .gt, .kc, .kd, .kn, .kp, .kr, .kt, .m, .s, .na, .nb, .nc, .no, .nd, .ni, .ne, .nf, .nl, .nn, .nt, .nv, .ow, .w, .mf, .mh, .mi, .mo, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .bp, .vc, .vg, .vi, .il" ).parent( "pre" ).css( "border", "1px solid #DEDEDE" );
</script>
<!-- Load Google Analytics -->
<script>
/*
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-66582-32', 'auto');
ga('send', 'pageview');
*/
</script>
<!-- End of Google Analytics -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../theme/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../theme/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>