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

learn more… | top users | synonyms (1)

0
votes
3answers
565 views

How to make an alias for a folder on a mounted drive?

I use parallels to run a windows machine and would love to make an alias in my .profile to make a shortcut to my project folder, but the following alias below dosn't seem to work. alias ...
0
votes
1answer
1k views

Creating IP aliases upon server reboot

I have a server running RHEL 6, and have created multiple IP aliases on it. However, when I restart the server, the IP aliases are gone. I tried to edit the /etc/rc.d/rc.local file to include ...
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 ...
0
votes
0answers
363 views

How to set an alias which will automatically ssh to another server

I often use this command to connect to another server with x forwarding: [myuser@server1]$: ssh -Y 10.32.45.123 (10.32.45.123 is server2) myuser@10.32.45.123's password: [$myuser@server2]:$ I ...
0
votes
2answers
326 views

Alias for recursive case insensitive search in current directory

How do I set an alias, such as "mysearch", which will search for a string recursively in the directory I'm standing in. It should be as below: mysearch "this table..." = find -type f -exec grep ...
1
vote
1answer
621 views

In MacOS X is there a way to create a shortcut to a folder on a readonly drive?

I have a partitioned drive with a different OS on my Mac. I can access this drive in readonly mode, but not write mode. There is a folder on this partition drive that I often open, and therefore I ...
3
votes
1answer
488 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? ...
1
vote
1answer
3k views

iptables trouble: nat with ip alias (virtual interface) not working

I'm setting up an Ubuntu 11.10 server to act as firewall for a network running several different SSL websites. The idea is fairly common: have all public IP's for each site aliased to the public ...
2
votes
8answers
983 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 ...
1
vote
1answer
146 views

Accessing your bash profile and history anywhere - via the internet

I'm curious if anyone has tried to tackle the task of having non-sensitive parts of their bash (or other shell) profile made available anywhere they go. I worked for a company for a time that did ...
0
votes
1answer
242 views

How to pass arguments to an alias?

I'd like to set up an alias push, which would translate into git push origin ARG1:ARG1. For instance, from the command line, i'd like to push A B and get that translated to git push origin A:B How ...
1
vote
1answer
3k views

Some CSS not working correctly when using an alias to enter website

I have built an intranet for my company, but when I access the site using an alias (DrewNett) so of the styling in IE is incorrect. It's only in IE, and the source is exactly the same and when I go do ...
2
votes
1answer
576 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
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] ...
0
votes
1answer
56 views

How can I check whether Vim has the -p (tabs) option or not?

I would like to figure out in my .bashrc (or one of the files it sources) whether Vim has the -p option available and if so create an alias. Now, that same .bashrc is used on numerous systems ...
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 ...
0
votes
2answers
163 views

command line alias versus .bash_profile alias

when I create this alias from the command line everything works fine alias ejecta='for I in 1 2 3; do /usr/sbin/diskutil unmountDisk disk$I;done' When the same alias is created in .bash_profile. the ...
1
vote
2answers
987 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 ...
4
votes
1answer
576 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 ...
0
votes
2answers
247 views

What is a simple standard command line way of getting 'ls' to produce file permission in octal?

Any know a standard way, other than 'stat' to produce octal output for file permission from 'ls'? Standard way of using stat (on OSX) is: stat -f '%A %a %N' * where * can be any file pattern that ...
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 ...
1
vote
1answer
1k views

sh alias: command not found

I have written a very simple script like this: function apply_to_dev { echo "Applying scripts to DEV..." alias ISQL="isql -Uuser -Ppwd -SDEV -DDATA -I ~/bin/interfaces" shopt -s nullglob ...
3
votes
1answer
589 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 ...
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
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
5answers
425 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 ...
1
vote
1answer
5k views

How to Create a Permanent Alias in Mac OS X Lion Terminal?

I've googled the heck out of this. The typical methods of adding the alias to ~/.bashrc or ~/.bash_profile just aren't working for me. Help please? Thanks! Here's my current ~/.bash_profile if [ ...
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, ...
2
votes
1answer
487 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 ...
0
votes
2answers
137 views

On mac, how to copy a networked folder from a Windows machine?

I can see the (XP) shared folder on my Mac (10.6.8). If I try and drag/drop the folder in finder, I get an alias to it. How do I copy the folder itself?
2
votes
1answer
681 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 ...
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 ...
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 ...
0
votes
2answers
807 views

OSX: Automagically creating a list of the files/folders on external hard drives, to see what's on them when they're disconnected

I want to be able to see a list of the files and folders on my external hard drives, without having to plug them in first. A program that scans external drives when they're plugged in and keeps a ...
1
vote
1answer
1k views

Hostname Aliases in XP Pro

In XP Pro how can I create a local alias for hostnames of some other computers on the domain? When I created an entry in any of hosts, lmhosts, or lmhosts.sam, I can ping a computer with the alias, ...
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 ...
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 ...
1
vote
1answer
416 views

Setting alias in Windows PowerShell

In PowerShell, I type: PS C:> sal cdp "cd 'C:\Users\ec\Documents\Visual Studio 2010\Projects'" I get no error from this, and PS C:> gal cdp shows definition as: cd 'C:\Users\ec\Documents\Visual ...
0
votes
2answers
648 views

make an alias to move files to a tmp directory

I am trying to create an alias to move files and directories to the tmp directory. This is what I've tried: alias rm='/bin/mv *.* /tmp' The problem is that when I type rm filename, I get an error ...
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.
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
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?
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 ...
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 ...
1
vote
1answer
859 views

csh cd alias: how to eliminate error when no parameter is supplied

I am familiar with bash, but my works require csh. in my .cshrc, I created this alias: alias cd 'cd \!:1; ls -l' It works very well except for one case: when I cd without any parameter: cd In ...
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 ...
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 ...
1
vote
0answers
623 views

Running Windows XP Command Line from CMD.exe does not load autorun processor batch file

I have a batch file set to load up when the Windows XP command line (cmd.exe) starts (using the registry key Command Processor as detailed). Unexpectedly, the batch file only runs under certain ...
0
votes
2answers
708 views

MacVim behaving strangely with my aliases (even setting shell=/bin/bash\ -l)

I wanted to write some scripts and have MacVim call some bash commands. I have some aliases and wanted vim to be able to call them, so I knew I needed a login shell, just didn't know how to make vim ...
2
votes
2answers
480 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 ...