In computing, an alias is an alternate name for an object, such as a variable, file or device.

learn more… | top users | synonyms (1)

36
votes
2answers
6k views

how to expand aliases inline in bash?

Is there a way to expand aliases inline in bash? $bash>alias ll='ls -l ' $bash>ll<tab> $bash>ls -l
33
votes
4answers
11k views

Bash: Spaces in alias name

I am trying to create an aliases in bash. What I want to do is map ls -la to ls -la | more In my .bashrc file this is what I attempted: alias 'ls -la'='ls -la | more' However it does not work ...
14
votes
9answers
10k views

Command aliases in Command Prompt?

How can I make command aliases in Windows' Command Prompt like I would with bash? I found out about doskey in a forum thread, so I can do something like: doskey ls=dir /b ...and now the command ls ...
11
votes
1answer
2k views

Vim Ignores Aliases

If I map a command in vim using something like map <f4> :! pdflatex %<cr> Vim will ignore my alias for pdflatex (something like alias pdflatex='pdflatex --temp-dir=something'). Is it ...
8
votes
1answer
12k views

How to alias a hostname on Mac OSX

In a nutshell, I would like to be able to open a browser and open local.example.com but it actually loads http://localhost/path/to/example.com/ I am using Mac OSX 10.5, and not afraid to get my hands ...
8
votes
2answers
970 views

How can I create an alias for apt-get?

I remember that on one Debian system, I used apt install package to install a package. It asked for a password afterwards and was more convenient than sudo apt-get install. Now I am not sure how I ...
8
votes
5answers
6k views

IP address alias assigned by DHCP

I would like to create several aliases to eth0, but have the addresses assigned by DHCP instead of being set to static IP's. Is this even possible? All the examples I've seen assign a static IP using ...
7
votes
1answer
3k views

Why are Mac OS X alias files so large?

On Mac OS X, I have two aliases in my Applications folder, each points to another folder. They are 1 MB each. Why so large? I've found other sources on the Internet to say that yes, alias files can ...
6
votes
1answer
239 views

I deleted my aliases file, but my aliases are still in my bash session - how can I recover them?

I had a ton of aliases defined and I use them all the time. I have a terminal session open now in which all the aliases are valid and working. However, the .bash_aliases file in which they were ...
6
votes
2answers
2k views

Console 2 command aliases

I use Console 2 and I would like to create some aliases for commands I use often. Maybe my google-fu just sucks today but I cannot figure out how to do this. Any help would be appreciated thanks.
6
votes
2answers
1k views

Silencing bash's unalias when there's nothing to unalias

I have access to a couple of remote accounts, which I mount via sshfs in subdirs of $HOME/SSHFS. In order to remind me that I'm not working with local files, I have set $PROMPT_COMMAND to a function ...
6
votes
3answers
352 views

Is there a convenient method to pull files from a server in an SSH session?

I often SSH into a cluster node for work and after processing want to pull several results back to my local machine for analysis. Typically, to do this I use a local shell to scp from the server, but ...
5
votes
1answer
4k views

Git log alias - fatal: ambiguous argument '%ad': unknown revision or path

I'm trying to use Git Immersion's log alias: [alias] hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short but Git responds with fatal: ambiguous argument '%ad': unknown ...
5
votes
1answer
1k views

What does “network” mean in the /etc/network/interfaces file?

In Linux, to define aliases, we have to modify /etc/network/interfaces.. Something like this: auto eth0:1 iface eth0:1 inet static address 192.168.1.60 netmask 255.255.255.0 network x.x.x.x ...
5
votes
2answers
1k views

How to create shortcut command in Mac

I would like to a shortcut command in Mac as I frequently call commands that are a bit long in Terminal. How can I do that?
5
votes
2answers
129 views

Aliases with numerical names

I just installed Oh My ZSH on my Mac. Everything is working great, except I can't define aliases with numerical names. If I execute alias 5="cd ~/Projects/Projectname/" 5 I get the following error ...
4
votes
3answers
473 views

How to tell bash not to expand aliases

I know there is a simple syntax for telling bash not to expand aliases. However, Google is not turning it up and I'm too lazy to read through man bash. Also, the answer should be on this website.
4
votes
2answers
2k views

Aliases in subshell / child process

I set up aliases in /etc/profile.d/alias.sh for each login shell. But if I run script.sh, I can't use that alias. How can I set alias even for subshells or child processes ? /etc/profile.d/alias.sh ...
4
votes
3answers
4k views

How to alias a hostname?

Is it possible to keep a network alias - without specifying the IP address in the hosts file? For instance, I have abcd.efgh.com but want abcd -> abcd.efgh.com so that ping and ssh work as they ...
4
votes
1answer
575 views

How to make bash alias invocation conditional on PWD?

I currently have this alias: alias cmakerel='cmake -DCMAKE_BUILD_TYPE=Release -Wno-dev ../../ && make -j4' Essentially, it will call cmake to do an out-of-source build from PWD. It works ...
4
votes
4answers
16k views

How do I create a symbolic link in Mac OSX?

I have a .sh file that I need to create a symbolic link. I would like to be able to access the file using the Terminal. The command I use is: ln -s /path/roo.sh /usr/bin/roo But when I type roo, ...
4
votes
2answers
955 views

Creating an alias containing bash history expansion

I often forget to run a command with sudo, so I find myself often typing sudo !! immediately afterwards. I tried aliasing this, but bash chokes on the !! part. Is there some way to represent this ...
4
votes
1answer
4k views

Stop sending mail to myself when choosing Reply All in Outlook

My company has set up each mail account with serveral aliases. My default account is firstL@mycompany.com. I also have: first.last@mycompany.com flast@mycompany.com first_last@mycompany.com The ...
4
votes
3answers
3k views

Can I change the “From” name and address without going into Mail.app's preferences?

Can I somehow add an editable "From" field to Mail.app, a bit like Virtual Identity for Thunderbird, just like I could change the "Reply To" address on the fly? In Mail.app, one can set up multiple ...
4
votes
1answer
2k views

Is there a aliases file for sSMTP?

I installed sSMTP for sending emails from command line. I want to create some alias for cron jobs: $ sudo vim /etc/aliases # append this line at the end myname: root $ newaliases ...
4
votes
2answers
1k views

Create an alias to a samba share from the command line

I'm currently wanting to deploy a setup to around 300 Macs. I have all of it scripted and ready to deploy, excepting that I'm having trouble creating a working alias to a samba share from the command ...
3
votes
5answers
2k views

error when using commandline as a bash alias on linux

I want to save the following commandline sequence as a bash alias: grep `date '+%d/%b/%Y'` access.logs | egrep 2765330645ae47d292c9ceac725d744e.py |awk '{print $1, $4, $5, $7, $8, $9, $10}' | sort ...
3
votes
4answers
6k views

Under Ubuntu, how can I place a shell alias command that will be global to everyone?

Under Ubuntu 9.10, where can I place an alias command that will be valid to all users, root or otherwise, and that will work with a shell under GNOME as well as an ssh session and plain console login ...
3
votes
1answer
486 views

ssh: add “-X” to default options

How do I add "-X" into my ssh default option? i.e., when I type ssh A.B.C.D, it should really do ssh -X A.B.C.D I can alias it, but is there a more "elegant" solution to do that in .ssh/config file? ...
3
votes
2answers
2k views

How do I close an OS X application from the command line using a alias defined in my .bash_profile?

I found the following shell script that can be used to tell an OS X application to quit: #!/bin/sh echo | osascript <<EOF tell application "$*" quit end tell EOF I have several simple ...
3
votes
2answers
2k views

How to undo alias, PATH=$PATH:./Test - (Unix)

1.) In a terminal when we make an alias for any command line,the life of that alias is as long as the terminal is open. alias new_command=old_command example: alias dog=cat But can we explicitly ...
3
votes
3answers
623 views

git alias for merging current branch with master

I'm trying to create a git alias that merges the currently checked out branch into the master branch. Specifically I'd want to quickly get my master branch get up to speed with what I'm working on. ...
3
votes
1answer
290 views

How to create alias for - minus sign

I want to map the - to cd - I've tried escaping it, w/ and w/o single/double quotes but neither of them seems to work. alias \-='cd -' or alias '-'='cd -' => bash: alias: -=: invalid option ...
3
votes
1answer
2k views

.bashrc loading aliases from different file

I have a .bashrc file, which I want to setup so it reads aliases from an .aliases file and sets them up. Currently I have: # User specific aliases and functions while read alias_line do echo ...
3
votes
1answer
368 views

How to pipe output of certain commands to a pager with zsh?

I am frequently working with subversion in console using its client svn. One of common tasks is viewing svn log; however its output is usually pretty massive despite of --limit option. I would like to ...
3
votes
1answer
512 views

Sending email from domain name address

hey, I've just bought a domain name and would like to send emails from blah@mydomain.com. I can use an alias from my hotmail/gmail account, but the recipient sometimes sees it as "my@hotmail.com on ...
3
votes
2answers
91 views

How do I handle multiple quotes in an alias (for bash or zsh)

I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly. So far I've got: pycalc() { ...
3
votes
3answers
3k views

Add a static IP alias to a DHCP interface on Windows 8

I have a Windows 8 machine that has only a single Ethernet port. It needs to use DHCP and also needs a static IP. Each IP is in a different subnet, and each serves a different, incompatible purpose. ...
3
votes
2answers
79 views

How enter in folder with one command?

I work a lot in two folders: /home/valter/Dropbox/Development/git/valter /home/valter/Dropbox/Development/git/company I would like to create command like: $valter and enter in ...
3
votes
2answers
129 views

Do aliases slow down a shell's start?

Sometimes my shell (zsh) takes longer to start than usual (I open the terminal, and it hangs a bit until I can input commands). I have a few aliases on my .zshrc (well, actually they're in a ...
3
votes
2answers
249 views

Aren't egrep, fgrep supposed to be aliases to grep?

Since egrep is essentially grep -E I would expect it to be an alias that calls grep with that option. However on my system file `which egrep` shows it is an executable. Also egrep as an alias only ...
3
votes
1answer
125 views

How can aliases of a folder be found using cmd?

Is it possible to find the aliases that correspond to a certain folder (and perhaps its sub-directories, too) using Windows cmd? I've tried searching, but it gives me results related to creating ...
3
votes
1answer
586 views

Define custom aliases for outlook contacts

I have a close coworker whom I email almost daily. Let's call her "Leigh Wilson". The global address book at my company has several other people with the first name "Leigh" and/or the last name ...
3
votes
1answer
707 views

OS X: alias vs. symlink

What is the difference between an "alias" and a symlink on OS X?
3
votes
1answer
2k views

In Ubuntu, routes are not added as defined in rc.local file…why?

I need to setup my ubuntu pc single nic card ip as 192.168.1.6 for internet and 10.172.170.95 and 135.10.86.100 for my lan and for another network through my 4port DSL modem.So i defined like this. ...
2
votes
5answers
2k views

bash alias for “cd directory; ls”

How do I create BASH alias for: I type in cdd directory and what that does is cd directory and then ls?
2
votes
1answer
737 views

trouble aliasing cd in bash

I'm adding a couple of aliases to my .bashrc file for some shortcuts I use often, among which are: alias .="cd /;ls" alias ..="cd ../;ls" alias cd="cd $1;ls" alias ls="clear;pwd;ls" The effective ...
2
votes
3answers
3k views

Quick Mac OS X shut-down icon

How would I create an icon on my Mac OS X desktop, to do a "shut down"? (With... or without... the "are you sure" verification.)
2
votes
1answer
247 views

On Solaris, can I alias one command to multiple possible locations?

Let's say I have a script called bob. It might be in two locations: /usr/local/bin/bob or /usr/local/bin/scripts/bob. Is there a way I can alias bob to both locations and it will stop whenever it ...
2
votes
3answers
2k views

why alias names defined in .bashrc file are not working?

I have give alias names in .bashrc file like below. But the alias names are not working. why? alias c='clear' alias l='ls -lt' alias h='history' alias d='ls -lt |grep "^d"' export ...