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

learn more… | top users | synonyms (1)

2
votes
8answers
981 views

Command to search programs in Linux

Do you have any easy idea to define some alias in .bashrc for finding some command that you want to search (when you forgot its name) in your machine, visiting all "bin" directories, maybe using ...
2
votes
1answer
132 views

Create an alias - in Bash?

How can I create an alias named - in Bash? None of the following works: alias -='cd -' alias \-='cd -' alias '-'='cd -' with error: bash: alias: -=: invalid option alias: usage: alias [-p] ...
2
votes
5answers
423 views

Multiple-command alias enters bash shell but fails to navigate to path

I have this alias defined to run bash then navigate to a certain folder but when I run it, it only runs bash and stays in the current path/directory/folder. I've defined them in two different ways in ...
2
votes
2answers
345 views

How to make an alias from a statement with many : " and many : '

How to make this an alias in zsh? svn status | grep "^?" | awk -F " " '{print $2}' | tr "\n" "\0" | xargs -0 svn add I know it should be something along the lines: alias sall = "the command" ...
2
votes
4answers
2k views

Linux: aliases when using `screen`

I'm using screen, and I have several aliases in my ~/.bash_profile, for example python=python-2.6. But for some reasons these aliases don't work when I work in screen. How can I make them work?
2
votes
1answer
2k views

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 ...
2
votes
2answers
1k views

Bash alias with piping

I'm not exactly sure what I'm doing wrong with this one. I'm trying to run the command alias localip='ip -4 -o addr show eth0 | egrep -o '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}' | head -n 1' If I ...
2
votes
2answers
87 views

Is there a way to tell the shell (zsh preferably) about a command?

I defined an alias: alias school="cd ~/School/3BaFys/" to quickly go to the folder 3BaFys which contains all of the directories I need this year. Is there a way to tell zsh that when I do: ...
2
votes
2answers
147 views

Is this alias any useful?

I am going through and old .cshrc file and it contains the following alias: alias pwd 'echo $cwd' How is that useful? I used to think that this is how pwd might have been implemented. But looks ...
2
votes
4answers
155 views

Using standard unix commands, how do you grab a bunch of lines?

I have several text files with this format: name: john address: bay area phone: 6505561234 image: /work/myimage.png name: stark dob: 5AD shirt color: red physical address: Westros phone model: S2 ...
2
votes
3answers
1k views

Where are aliases set in CentOS?

There is a typo which causes an error message upon logon (someone typed lias instead of alias). I have checked /etc/bashrc as well as ~/.bashrc and /etc/profile as well as ~/.bash_profile for ...
2
votes
2answers
275 views

Working shell command doesn't alias

I can run, svn status |grep -v .jasper$ |cut -d ' ' -f8 |sed '/.*\..*/!d' |xargs ls -altr --color=auto just fine. But when I go to add this as an alias (alias svtr="...") I get an error saying... ...
2
votes
2answers
2k views

How to change default vi alias in Fedora 14?

In my laptop, if I type below $ which vi alias vi='vim' /usr/bin/vim Now I want to change the vi alias to another bin, e.g. vim_wrapper a script created in /usr/bin/, I type this line: alias ...
2
votes
1answer
926 views

How does \cp work?

I know that if you have some alias with the name cp, you can bypass it using \cp. Is this unix syntax? Are there any other uses of this syntax?
2
votes
1answer
74 views

Trying to create bash function which collects and quotes all arguments, but it doesn't work if args contain brackets or single quotes

I saw the following shortcut for "git commit" suggested somewhere: function gc { git commit -m "$*" } This is supposed to allow you to write the commit message inline in the shell, without quotes ...
2
votes
3answers
164 views

In Power SHell set alias cp to cp -v

I have cp for power shell. But I want to use cp in verbose mode without writing -v. So cp should be aliased to "cp -v" command. How to alias cp to "cp -v" in power shell?
2
votes
1answer
485 views

How to expand aliases on any invocation of /bin/bash

Any of you know a way to expand an alias whenever a new shell is invoked (from any place)? For example, my alias is: alias ls='ls -F' Now if I invoke it in grep -l ramesh | xargs ls … here I ...
2
votes
1answer
563 views

In Powershell on Windows7, how do I automatically set aliases (or run scripts) when powershell loads?

I have created a powershell cmdlet and assigned it to an Alias. How do I do this automatically every time powershell launches? (i.e. so I don't have to re-assign the alias every time)
2
votes
1answer
178 views

How to make an alias to a part of a block device

Is it possible to make a part of a block device to be seen as a separate block device (in a similar way block 'devices' are created for partitions)? Unfortunately, I can't mount it through loop device ...
2
votes
1answer
575 views

Bash alias history substitution similar to \!* in csh

My question is very similar to that of this old post. I would like to do something similar: place in an alias the last argument(s) typed on the current command line. This would be equivalent to the ...
2
votes
1answer
680 views

How to make alias shortcuts for terminal work as root or as exec?

Let's say I have an alias like this: alias findip='wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'' the output would look like this: matthew@ubuntu:~$ findip ...
2
votes
1answer
2k views

How to set alias permanently using command?

Dear Folks I don't have access to home directory. So I can't access .bashrc or .profile file. So the only option (I guess) is using the command for setting alias. Is there any way to add alias ...
2
votes
1answer
717 views

Overwrite ls in .bash_profile

I'm new to bash and unix. I'm trying to create an alias for ls. In my .bash_profile I have the following: alias ls="ls -lhHG" This doesn't work at all. If I change it to: alias la="ls -lhHG" ...
2
votes
1answer
85 views

What's the rule on using the word “git” as an alias?

I used to keep my git aliases in a file outside of my .gitconfig file, in the normal format of: alias gb="git branch --verbose" which worked great. But, after looking around at others' dotfiles, I ...
2
votes
2answers
59 views

alias or function for emacs command?

So I'm on my first day at my new job, and on the server we use, the default emacs is X-windows based. I much prefer using it in the good old terminal, and I'd like to be able to make the command ...
2
votes
1answer
355 views

OS X: is there an application that can check for broken aliases in Finder?

I use a lot of aliases in my file system. Many original documents are placed in global repositories and I access them by aliases grouped in "tag" folders. Therefore, when I need to delete such a ...
2
votes
1answer
530 views

How do I create a PowerShell alias (or function) that contains an option?

I'm learning PowerShell, so I'm doing stuff like this a lot: Get-Command | Out-String -Stream | ss child (ss is an alias for select-string). I'm getting tired of typing Out-string -Stream all the ...
2
votes
2answers
479 views

How can I set up an alias or shortcut to do the *nix find command?

When at the command line, I find that I have to type out this command very often: find . -iname "*php" -exec grep -H query {} \; I'd love to set up an alias, script, or shortcut to make it work ...
2
votes
1answer
204 views

Can I use the first page of a PDF document as its alias icon in OS X?

Is there a painless method for using the first page of a PDF as its alias icon in OS X? The operating system does this for PDF documents on the desktop, and I'd like to replicate the behavior for ...
2
votes
3answers
295 views

How do I make a bash alias that outputs file names in a format I can pipe to vim?

When rebasing with git, I'm interested to open the files that have merge conflicts. I can do this with: vi `git diff --name-status --diff-filter=U | awk '{print $2}'` but if I alias that: alias ...
2
votes
1answer
6k views

How to create an alias in Apache 2 that points to a network share?

I am trying to create an Alias directive with Apache 2.2, to point to a shared folder on other computer. Apache is running on machine M1 at IP 192.168.0.103, the other machine M2, with the shared ...
1
vote
3answers
478 views

On a Mac, how can I group together commands I want run into a alias?

In my .bash_profile I have created alias to commands that I run often. What if I want to group together multiple commands together, and they should run in serial one after the other. How would I do ...
1
vote
4answers
2k views

Ubuntu - Create a link to a specified directory so I can easily change to that directory

Is it possible to create a symlink to a directory, like /var/lib/tomcat6/webapps/MyWar that I can access from everywhere? I want to be able to say cd myapp from anywhere in the directory tree and go ...
1
vote
1answer
448 views

My alias isn't working anymore, not sure what happened

I created an alias so that when I type la it does ls -la. When I fire up terminal on my Mac, I get: -bash: alias: la: not found -bash: alias: =ls -la: not found Why would this be? My ...
1
vote
1answer
515 views

how to put my arguments into a Bash alias command?

i usually have the following simple alias in my bashrc: alias g="grep --color=always --exclude-dir=\*.svn\*" but now i have to work on systems that only have GNU grep 2.5, hence no --exclude-dir ...
1
vote
1answer
171 views

Unix: Overloading Aliases

What happens if I have this in my bashrc: alias ls="ls -l" alias ls="ls -a" when I type ls they will both match. Is the last one kept or both?
1
vote
2answers
497 views

Why does an alias work in the Terminal, but not when called from a script?

I've added the following to my ~/.bash_profile # opens "flashlog.txt" in Console alias trace='open -a /Applications/Utilities/Console.app/ ~/Library/Preferences/Macromedia/Flash\ ...
1
vote
1answer
44 views

Echoing aliases to .bashrc

I want to echo an alias straight into my .bashrc file. Here is what I am using: echo alias cdear='cd | clear' >> .bashrc However, the new line in .bashrc does not contain the quote marks. I ...
1
vote
3answers
153 views

How to write alias to use first parameter or * if parameter is blank?

I want to write an alias command for 'ls', so that if I pass in a parameter, then the alias will use it, but if I do not, then it would use '*' instead. This is the alias I have today: alias lsd='ls ...
1
vote
2answers
2k views

What is the correct way to alias applications in OS X through bash?

In my ~/.bashrc, I have several aliases like: alias emacs='/Applications/Aquamacs.app/Contents/MacOS/Aquamacs' alias octave='/Applications/Octave.app/Contents/Resources/bin/octave' alias ...
1
vote
1answer
2k views

Alias for multiple sequential commands?

How do I create an alias c that will cd and then immediately ls? alias c='cd; ls' Is there some kind of way to insert a special variable that represents the input? Or is that not the way that alias ...
1
vote
2answers
23k views

How do I set an alias name in the hosts file?

I have a production server, on which three different application are running. I need to configure aliases for that server, according to which application needs to be accessed by the user. How do I ...
1
vote
1answer
379 views

How to add an application to Mac Applications folder

I'm looking to add software installed elsewhere (eg. home or opt) to the Mac's (10.8) Applications folder. The goal here is to get all the benefits like the application listing in the launcher and ...
1
vote
1answer
307 views

Alias defined in .bashrc not working after pipe

I'm stuck with the following problem. I've defined an alias in .bashrc (and .bash_profile): alias echo2="echo" This works well: $ echo2 "test" test However, if I try to use it after a redirect, ...
1
vote
2answers
986 views

get value of an alias in bash

I recently switched from tcsh to bash, and I'm used to being able to do things like sudo `alias netstat` but since alias gives name=value in bash, I can't do this anymore. Is there an equivalent in ...
1
vote
3answers
200 views

What is the return value of a complex alias in bash?

When I execute a command that has been alias to a series of commands, what value gets returned back to the shell? Also, assuming I have an alias defined like this: alias doit 'cd ~/some/dir; ...
1
vote
1answer
918 views

Create alias (desktop shortcut) of an application installed by Macports

I just installed Dia using macports. Now, I need to place the shortcut in the Apps folder and also make the executable available in the Spotlight search. How can I do that?
1
vote
2answers
64 views

Alias for directory using a symbol

I'm looking to set up an alias for my work directory, which can change as I change context, and I was trying to find something that was short enough to stand in as a replacement for ~. I'd be tickled ...
1
vote
1answer
105 views

Alias for viewing logs with todays date

I want to create an alias: alias readFile='ls file1.todaysdate' where todaysdate is in format 130714. How would i do this?
1
vote
2answers
433 views

Linux: How to automatically detect display and set up default editor accordingly

I am relatively new to linux. I am connecting to a remote linux machine sometimes via telnet and sometimes via NX client for windows. When I connect via telent I would like the default editor to be ...