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
24
votes
2 answers

Two word alias in zsh

It's easy to do a one word alias in ZSH. alias ll='ls -lah' Is there a way to do two word aliases with Zsh, so that both words are parsed as part of the same alias? I'd mostly like to use it for typo fixes. alias 'gits t'='git st'
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
24
votes
2 answers

Is alias_method_chain synonymous with alias_method?

If these two methods are simply synonyms, why do people go to the trouble of writing the additional characters "_chain"?
John Owens
  • 273
  • 1
  • 3
  • 7
23
votes
5 answers

Django Static File Hosting an Apache

I'm trying to move a Django site I have been working on out of the dev server stage and into a real hosting environment. For the time being, I'm just hosting on my personal machine. I already have Apache and mod-wsgi installed, but I'm having issues…
themaestro
  • 13,750
  • 20
  • 56
  • 75
23
votes
5 answers

List all aliases available in fish/bash shell

Is there a way to list all aliases, something like: $ ls-aliases .. "cd .." la "ls -Gla" gs "git stash" etc... Also is it possible to add human readable descriptions to aliases ? I'm on a MacOSX
Labithiotis
  • 3,519
  • 7
  • 27
  • 47
23
votes
8 answers

Bash alias: command not found

I'm trying to setup a simple alias to move me into my Developer folder on my machine. However, after setting it up, I get a weird error: -bash: dv: command not found I setup my alias in .bashrc like so: alias dv='cd Developer/' I use it by just…
Bill L
  • 2,576
  • 4
  • 28
  • 55
23
votes
6 answers

Linq with alias

I have the following line in c#: var name = (from x in db.authors where fullName == "Jean Paul Olvera" orderby x.surname select new { x.id_author, fullName= String.Concat(x.name," ",…
Jean Paul Olvera
  • 379
  • 1
  • 4
  • 9
23
votes
2 answers

SSH config file paragraph to open a specific directory on remote server

Is there a way to specifically ssh into a particular directory in remote location, specifically using the local ssh config file (not terminal)? Something like Dir option in the paragraph below, for example, Host remote_dir Hostname…
Jay
  • 611
  • 1
  • 4
  • 9
22
votes
7 answers

Is there a way to define C# strongly-typed aliases of existing primitive types like `string` or `int`?

Perhaps I am demonstrating my ignorance of some oft-used feautre of C# or the .NET framework, but I would like to know if there is a natively-supported way to create a type alias like EmailAddress which aliases string but such that I can extend it…
James Dunne
  • 3,607
  • 3
  • 24
  • 29
21
votes
2 answers

Method/Sub Binding In Raku

I'd like to find out if there is a way to bind a method and/or a sub to another method/sub name in Raku. I've seen how you can bind a variable to a method/sub, but that's not quite what I'm looking for. I know how to do it in Perl 5: sub sub1 { …
JustThisGuy
  • 1,109
  • 5
  • 10
21
votes
5 answers

Can I alias expressions inside Python list comprehensions to prevent them being evaluated multiple times?

I find myself often wanting to write Python list comprehensions like this: nearbyPoints = [(n, delta(n,x)) for n in allPoints if delta(n,x)<=radius] That hopefully gives some context as to why I would want to do this, but there are also cases where…
krashalot
  • 1,091
  • 1
  • 12
  • 12
21
votes
4 answers

Ruby (Rails) Delegate attributes to another model's method?

-EDIT- After reading about the Delegate method from the first answer, my question is this, is it possible to delegate two different methods to another single method. IE: I currently have: @photo.attachment.file.url, and @photo.attachment.height, and…
Andrew
  • 42,517
  • 51
  • 181
  • 281
21
votes
5 answers

Why doesn't JavaScript function aliasing work?

I have some Firebug console function calls that I wanted to disable when Firebug wasn't enabled, e.g. console isn't defined. This works fine in IE6 and FF3, but not in Chrome: var log; if(console){ log = console.log; }else{ log = function(){…
qodeninja
  • 10,946
  • 30
  • 98
  • 152
21
votes
1 answer

How do I include parameters in a bash alias?

Trying to create: alias mcd="mkdir $1; cd $1" Getting: $ mcd foo usage: mkdir [-pv] [-m mode] directory ... -bash: foo: command not found What am I doing wrong?
Andrey Fedorov
  • 9,148
  • 20
  • 67
  • 99
21
votes
2 answers

source multiple files in .zshrc with wildcard

I use z shell via "oh my zsh". I'd like to source multiple alias files from within my .zshrc file so I can keep things well organized. I've prefixed the alias files with .alias_ so I can wildcard load them. But, a call to source ~/.alias_* only…
cborgia
  • 1,399
  • 1
  • 10
  • 10
21
votes
1 answer

Cannot edit bash_profile on Mac OsX

I am using MacOSX Snow Leopard 10.6.8.... I am the only user on this machine and I should be admin. I trying to edit my bash_profile to give it this simple alias: alias server=' open http://localhost:8000 && python -m SimpleHTTPServer' however when…
accraze
  • 1,522
  • 7
  • 20
  • 46