Questions tagged [alias]

An alias is an alternative name. In computer science, the most common contexts are command aliases in shells, column aliases in databases, or variable references in languages like C++.

For bash aliases use the tag.

4406 questions
20
votes
3 answers

How to add an Alias to Android (Java) Keystore

It is easy to create a new Java Keystore in Android-Studio. But I'd like to add a second Alias to this Keystore. For a second app for the same client. How do I do that? Or, if it is a not-so-good idea, what would be a better way? edit: I do not…
20
votes
2 answers

In Git is it possible to refer an alias from another alias

Let say I have an alias like this in my .gitconfig: alias.showlog = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' and now I want a similar alias like this: alias.sl = showlog…
рüффп
  • 5,172
  • 34
  • 67
  • 113
20
votes
1 answer

git alias for shell command to cd into git root not working as expected

I'm trying to define an alias to cd me into the git root directory using git rev-parse --show-toplevel. Currently I have it as an alias in my .bashrc, which works fine: alias gitroot='cd "$(git rev-parse --show-toplevel)"' But I know that you can…
3cheesewheel
  • 9,133
  • 9
  • 39
  • 59
20
votes
4 answers

How do I alias a database in MySQL?

I'm looking for a way to alias a database in MySQL. The reason is to be able to rename a live, production database without bringing the system down. I figure I can alias the database to the new name, change and deploy the code connecting to it at…
Schwern
  • 153,029
  • 25
  • 195
  • 336
19
votes
3 answers

Alias for table name in SQL insert statement

Is it possible to specify an alias name for the table I am inserting values into? I want to specify a condition inside a nested query and the table is too verbose... Something like turning this: INSERT INTO my_table_with_a_very_long_name (col_a,…
fortran
  • 74,053
  • 25
  • 135
  • 175
19
votes
2 answers

BASH blank alias to 'cd'

I am a happy BASH user. I do not want to switch to another shell (in this case ZSH). ZSH has this ability to change a directory without necessarily typing: cd /to/a/directory What would be the correct alias (or maybe BASH function) to change…
alfredodeza
  • 5,058
  • 4
  • 35
  • 44
19
votes
5 answers

Linux alias chain commands (can recursion be avoided?)

I've been looking around for ways to alias clear and ls into one command. Currently I've defined command x: alias x="clear;ls" Now is there any walkaround to avoid recursion and define: alias ls='clear;ls'
GoTTimw
  • 2,330
  • 6
  • 26
  • 34
19
votes
1 answer

How to escape whitespace in a bash alias?

Tried to set some aliases in my .bashrc file. This one... export alias umusic="/Volumes/180 gram/Uncompressed/" ...gets the following error... -bash: cd: /Volumes/180: No such file or directory ...when I try "cd $umusic". I've tried various…
parisminton
  • 401
  • 1
  • 6
  • 13
19
votes
2 answers

Best way to define "conditional" aliases in shell

What's the best way to define an alias if, let's say, "ag" executable is found? if (( $+commands[ag] )) ; then alias grep='ag'; fi or [[ -s $(which ag) ]] && alias grep='ag' or if $(which ag >& /dev/null); then alias grep='ag'; fi or ...? By…
user3341592
  • 1,419
  • 1
  • 17
  • 36
19
votes
5 answers

Filter based on an aliased column name

I'm using SqlServer 2005 and I have a column that I named. The query is something like: SELECT id, CASE WHEN END AS myAlias FROM myTable WHERE myAlias IS NOT NULL However, this gives me the error: "Invalid column…
Nathan Koop
  • 24,803
  • 25
  • 90
  • 125
19
votes
9 answers

Make "make" default to "make -j 8"

Is there a way that I can make $ make default to: $ make -j 8 ?
anon
  • 41,035
  • 53
  • 197
  • 293
18
votes
4 answers

Using aliases with nohup

Why doesn't the following work? $ alias sayHello='/bin/echo "Hello world!"' $ sayHello Hello world! $ nohup sayHello nohup: appending output to `nohup.out' nohup: cannot run command `sayHello': No such file or directory (the reason I…
asf107
  • 1,118
  • 7
  • 22
18
votes
2 answers

eslint import/order breaks down when using typescript aliases

I am using typescript path aliases in a large react project. So for example, in my tsconfig.json, I specify some path aliases: { "baseUrl": "./src", "paths": { "@common/*": ["common/*"], "@settings/*": ["settings/*"], //…
Seth Lutske
  • 9,154
  • 5
  • 29
  • 78
18
votes
9 answers

creating an alias for a function name in C#

I want to create an alias for a funcion name in C#. Is there any way but function overloading? public class Test { public void A() { ... } } I want to call B replace A same below. var test = new Test(); test.B();
Ghooti Farangi
  • 19,926
  • 15
  • 46
  • 61
18
votes
2 answers

How to implement deprecation in python with argument alias

We are developing a python library and would like to change the way some function arguments are named in some functions. We would like to keep backward compatibility and thus we would like to find a way to create alias for function arguments. Here…
Jonathan DEKHTIAR
  • 3,456
  • 1
  • 21
  • 42