Questions tagged [alias]

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

In computing, an alias is an alternate name for an object, such as a variable, file or device. With the DNS system, an alias can be used to assign multiple hostnames to a computer, on Macintosh computers, files can be aliased to allow referencing the same file by different names, and in computer programming, aliasing is a situation where a location in memory is access by different symbolic names, to give a few examples.

346 questions
164
votes
4 answers

How to use spaces in a bash 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 because (I assume) it has spaces in the alias name. Is…
sixtyfootersdude
  • 8,049
  • 16
  • 52
  • 71
115
votes
4 answers

how to expand aliases inline in bash?

Is there a way to expand aliases inline in bash? $bash>alias ll='ls -l ' $bash>ll $bash>ls -l
asdfg
  • 2,806
  • 4
  • 20
  • 23
53
votes
4 answers

How to remove zsh alias?

I have an alias which is predefined by an oh-my-zsh plugin. -> % alias gcm gcm='git checkout master' I'd like to remove it, i.e. I'd like alias | pcregrep "\bgcm\b" return 1. I've tried with alias gcm='' but after that the alias is still existent.…
Gabor Marton
  • 687
  • 1
  • 6
  • 8
46
votes
5 answers

Create permanent DOSKEY in Windows cmd

I think the title is pretty self explanatory. The question is how can I create an alias in a Windows cmd that will also work after I close and then reopen it. For example I would like an alias called ip to call the command ipconfig or an alias ls…
nick zoum
  • 535
  • 1
  • 7
  • 12
41
votes
1 answer

How can I pass an alias to sudo?

I have tried putting my aliases in ~/.bash_profile, ~/.bashrc, /etc/profile, and /etc/bashrc. I am still unable to execute the following: alias zf2="php public/index.php" and then execute: sudo zf2 orm:info The issue seems to be that I am unable…
Michael Niño
  • 605
  • 1
  • 5
  • 9
37
votes
1 answer

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 dirty with the terminal :) I use Apache as my…
Austin Hyde
  • 1,054
  • 4
  • 13
  • 22
33
votes
6 answers

Add a static IP alias to a DHCP interface on Windows 8 (and above)

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. This machine must use DHCP because the site…
Warren Young
  • 3,665
  • 3
  • 19
  • 28
30
votes
5 answers

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 alias rmvr='rm -rv'; alias cprv='cp -rv'; alias…
lisak
  • 435
  • 1
  • 4
  • 9
24
votes
1 answer

Can I "export" an alias to the SHELL that invoked a script?

I'm trying to write a utility script that defines certain aliases. My SHELL is tcsh (can't change that). I tried the following #!/bin/tcsh alias log 'less ~/logs/log.`date '+%Y%m%d'`'' Then I run it like this: ./myscript log The output I get…
RonK
  • 1,480
  • 2
  • 14
  • 27
23
votes
9 answers

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 ORACLE_HOME=/ora11gr2/app/oracle/product/11.2.0/db2 export…
Venkatesh
  • 331
  • 1
  • 2
  • 3
21
votes
10 answers

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 acts a little more like ls on Unix. (I type ls so…
Benjamin Oakes
  • 4,613
  • 5
  • 23
  • 30
21
votes
1 answer

Bash is slow to start because of this line in .bashrc. What could cause this?

My .bashrc file contains a line to this effect: alias prog="/path/to/script.sh $(find $(pwd) -name prog)" When I comment out this line, Bash starts almost instantly when I open a new terminal. With this line, there is a 4-5 second delay before my…
BBales
  • 313
  • 1
  • 2
  • 5
20
votes
5 answers

How do I alias python3 on Windows?

I want to alias python3 to python on windows. I have already removed the alias for the microsoft store as described in this answer. However python3 is still not a known alias. How to I fix this?
HerpDerpington
  • 333
  • 1
  • 3
  • 11
18
votes
1 answer

overriding user defined functions with the same name as system commands

This function exists in one of my users' ~/.bashrc: function rm() { ls $* echo "rm?" read ans if [ "$ans" == 'y' ]; then /bin/rm $* fi } In my ksh script that users are required to run, I have…
acm
  • 283
  • 1
  • 2
  • 4
17
votes
5 answers

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 the command: ifconfig eth0:0 192.168.1.11 up
Steve
  • 305
  • 1
  • 2
  • 7
1
2 3
23 24