<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.saruman.biz/saruwiki/index.php?action=history&amp;feed=atom&amp;title=Aliases_in_every_profile</id>
	<title>Aliases in every profile - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.saruman.biz/saruwiki/index.php?action=history&amp;feed=atom&amp;title=Aliases_in_every_profile"/>
	<link rel="alternate" type="text/html" href="https://www.saruman.biz/saruwiki/index.php?title=Aliases_in_every_profile&amp;action=history"/>
	<updated>2026-05-02T12:26:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.saruman.biz/saruwiki/index.php?title=Aliases_in_every_profile&amp;diff=2431&amp;oldid=prev</id>
		<title>212.238.151.172: finished up profiles</title>
		<link rel="alternate" type="text/html" href="https://www.saruman.biz/saruwiki/index.php?title=Aliases_in_every_profile&amp;diff=2431&amp;oldid=prev"/>
		<updated>2009-07-26T11:59:00Z</updated>

		<summary type="html">&lt;p&gt;finished up profiles&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:59, 26 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Aliases in profiles==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Aliases in profiles==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Every time you set an alias, it is known only in that particular shell. Once you exit that shell, the aliases you&#039;ve so carefully set are gone forever and ever! Of course, there is a way to preserve your work: set the aliases in one of your profile files.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Every time you set an alias, it is known only in that particular shell. Once you exit that shell, the aliases you&#039;ve so carefully set are gone forever and ever! Of course, there is a way to preserve your work: set the aliases in one of your profile files &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&#039;&#039;~/.bash_profile&#039;&#039;, &#039;&#039;~/.profile&#039;&#039; et cetera). However, you can also put aliases in one of the system-wide profile files: &#039;&#039;/etc/profile&#039;&#039; or &#039;&#039;/etc/bash.bashrc&#039;&#039;. Especially the latter is suitable, as it is meant to hold functions and aliases. However, if you also want to have the aliases available when you log in remotely, you should either put the aliases in &#039;&#039;/etc/profile&#039;&#039;, or have &#039;&#039;/etc/bash.bashrc&#039;&#039; sourced from &#039;&#039;/etc/profile&#039;&#039;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Our favorite aliases==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Our favorite aliases==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a list of the aliases that we like so much that we put them on every one of our boxes, at the end of &#039;&#039;/etc/profile&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a list of the aliases that we like so much that we put them on every one of our boxes, at the end of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;/etc/bash.bashrc&#039;&#039; (which we have sourced from &lt;/ins&gt;&#039;&#039;/etc/profile&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;):&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  eval &amp;quot;`dircolors`&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  eval &amp;quot;`dircolors`&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  alias l=&amp;#039;ls $LS_OPTIONS -lAF&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  alias l=&amp;#039;ls $LS_OPTIONS -lAF&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>212.238.151.172</name></author>
	</entry>
	<entry>
		<id>https://www.saruman.biz/saruwiki/index.php?title=Aliases_in_every_profile&amp;diff=2430&amp;oldid=prev</id>
		<title>Saruman!: page started</title>
		<link rel="alternate" type="text/html" href="https://www.saruman.biz/saruwiki/index.php?title=Aliases_in_every_profile&amp;diff=2430&amp;oldid=prev"/>
		<updated>2009-07-26T11:00:43Z</updated>

		<summary type="html">&lt;p&gt;page started&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Aliases in general==&lt;br /&gt;
One of the fun little things of Linux is the ability to create your own aliases for commands that you often need. You can set an alias like this:&lt;br /&gt;
 alias more=&amp;#039;less&amp;#039;&lt;br /&gt;
This has the effect of intercepting any command entries for &amp;#039;&amp;#039;more&amp;#039;&amp;#039;, substituting &amp;#039;&amp;#039;less&amp;#039;&amp;#039;. Thus the alias makes sure that when you type &amp;#039;&amp;#039;more&amp;#039;&amp;#039;, you get the &amp;#039;&amp;#039;less&amp;#039;&amp;#039; command executed instead. This works because the shell keeps the list of aliases at hand, and substitutes your specified aliases at execution time.&amp;lt;br&amp;gt;&lt;br /&gt;
Note: if you also have the &amp;#039;&amp;#039;more&amp;#039;&amp;#039; command installed, then you cannot get to the &amp;#039;&amp;#039;more&amp;#039;&amp;#039; command any more. And note that - in a completely opposite fashion - your aliases are local to your shell, and are not passed down to programs or to other shells. Thus, a script that needs to run &amp;#039;&amp;#039;more&amp;#039;&amp;#039; will not get confused by your alias - it will not use &amp;#039;&amp;#039;less&amp;#039;&amp;#039; instead.&lt;br /&gt;
&lt;br /&gt;
Should you want to know which aliases are in effect, simply run&lt;br /&gt;
 alias&lt;br /&gt;
Should you want to know what commands you have stored under a particular alias, just run that:&lt;br /&gt;
 alias more&lt;br /&gt;
&lt;br /&gt;
The above use of aliases is very trivial; it gets better if you add parameters to the alias. And to top it off, you can also use (environment) variables. For example:&lt;br /&gt;
 alias ls=&amp;#039;ls $LS_OPTIONS -lAF&amp;#039;&lt;br /&gt;
will make command &amp;#039;&amp;#039;ls&amp;#039;&amp;#039; use bot the value of $LS_OPTIONS (usually something like &amp;#039;&amp;#039;--color=auto&amp;#039;&amp;#039;) and the &amp;#039;&amp;#039;-lAF&amp;#039;&amp;#039; parameters.&lt;br /&gt;
&lt;br /&gt;
Finally, you can have a single alias run multiple commands, separated with semicolons, pipes et cetera. Suppose you often want to know what processes are running with the credentials of web-user &amp;#039;&amp;#039;www-data&amp;#039;&amp;#039;:&lt;br /&gt;
 alias psw=&amp;#039;ps -ef | grep www-data&amp;#039;&lt;br /&gt;
Try it :-)&lt;br /&gt;
&lt;br /&gt;
==Aliases in profiles==&lt;br /&gt;
Every time you set an alias, it is known only in that particular shell. Once you exit that shell, the aliases you&amp;#039;ve so carefully set are gone forever and ever! Of course, there is a way to preserve your work: set the aliases in one of your profile files.&lt;br /&gt;
&lt;br /&gt;
==Our favorite aliases==&lt;br /&gt;
This is a list of the aliases that we like so much that we put them on every one of our boxes, at the end of &amp;#039;&amp;#039;/etc/profile&amp;#039;&amp;#039;&lt;br /&gt;
 eval &amp;quot;`dircolors`&amp;quot;&lt;br /&gt;
 alias l=&amp;#039;ls $LS_OPTIONS -lAF&amp;#039;&lt;br /&gt;
 alias ts=&amp;#039;multitail /var/log/syslog&amp;#039;&lt;br /&gt;
 alias tf=&amp;#039;tail -fn40 /var/log/ulog/syslogemu.log | ccze&amp;#039;&lt;br /&gt;
 alias tm=&amp;#039;tail -fn40 /var/appslog/mail/mail.log | ccze&amp;#039;&lt;br /&gt;
You can probably guess the meaning of the aliases from their commands, but in case not:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;l&amp;#039;&amp;#039;&amp;#039; - list in our favorite output form&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ts&amp;#039;&amp;#039;&amp;#039; - tail syslog&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tf&amp;#039;&amp;#039;&amp;#039; - tail firewall log&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;tm&amp;#039;&amp;#039;&amp;#039; = tail mail log&lt;/div&gt;</summary>
		<author><name>Saruman!</name></author>
	</entry>
</feed>