The alias tag has no wiki summary.
2
votes
1answer
31 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
13 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 ...
0
votes
2answers
34 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
31 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
99 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 ...
0
votes
0answers
77 views
Create a virtual directory without IIS
My projectgroup is working on a project that has an upload dir. We ofcourse exclude the upload dir from our SVN. This means that we don't share these files. We do share the DB since it's stored on the ...
2
votes
1answer
33 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
45 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
61 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
0answers
108 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
...
1
vote
1answer
17 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 ...
1
vote
1answer
38 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 ...
1
vote
2answers
37 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
29 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 ...
0
votes
1answer
368 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 [ ...
0
votes
4answers
87 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, it ...
2
votes
1answer
79 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
47 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
66 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
...
1
vote
1answer
56 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 ...
1
vote
2answers
113 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
100 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
176 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, ...
1
vote
1answer
101 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 ...
3
votes
2answers
281 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 ...
0
votes
1answer
67 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
1answer
51 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 ...
2
votes
1answer
201 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.
1
vote
1answer
315 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 ...
0
votes
4answers
257 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
88 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
2answers
125 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 ...
0
votes
1answer
168 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
112 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 ...
2
votes
1answer
460 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
260 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
219 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 ...
1
vote
1answer
79 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 ...
1
vote
1answer
178 views
Mac alias/symbolic link question
If I create a symbolic link or alias pointing to $HOME/Desktop and place it in a .dmg disk image, then distribute the dmg, will the link still point to the Desktop for the end user?
0
votes
3answers
336 views
Launch application from bash terminal then kill terminal while leaving application running
I would like to use the following scenario for my favorite applications under Linux (Ubuntu 10.10) in order to save grabbing the mouse and clicking them:
Open a terminal (Ctrl-Alt-D)
Type my alias ...
0
votes
2answers
193 views
Symlink to Files & Dirs in Dropbox
I just installed Dropbox on my Mac, so now I have this Dropbox folder in my home directory.
I only have the free plan (2 GB), so I can't just throw all my files & directories in there.
I ...
6
votes
2answers
686 views
how to expand aliases inline in bash?
Is there a way to expand aliases inline in bash?
$bash>alias ll='ls -l '
$bash>ll<tab>
$bash>ls -l
1
vote
2answers
88 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"
...
5
votes
3answers
172 views
Is there a convenient method to pull files from a server in an SSH session?
I often SSH into a cluster node for work and after processing want to pull several results back to my local machine for analysis. Typically, to do this I use a local shell to scp from the server, but ...
0
votes
4answers
96 views
Is there a way to alias a multi-worded command in Unix?
I am trying to alias the command sudo shutdown but in my .profile I can't just do alias "sudo shutdown"="my command". Is there another way to alias multi-worded commands in Unix?
0
votes
1answer
110 views
How to pipe output of certain commands to a pager with zsh?
I am frequently working with subversion in console using its client svn. One of common tasks is viewing svn log; however its output is usually pretty massive despite of --limit option. I would like to ...
2
votes
2answers
369 views
Creating an alias containing bash history expansion
I often forget to run a command with sudo, so I find myself often typing sudo !! immediately afterwards.
I tried aliasing this, but bash chokes on the !! part. Is there some way to represent this ...
2
votes
2answers
350 views
How do I close an OS X application from the command line using a alias defined in my .bash_profile?
I found the following shell script that can be used to tell an OS X application to quit:
#!/bin/sh
echo | osascript <<EOF
tell application "$*"
quit
end tell
EOF
I have several simple ...
3
votes
3answers
276 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
882 views
Why are Mac OS X alias files so large?
On Mac OS X, I have two aliases in my Applications folder, each points to another folder. They are 1 MB each. Why so large?
I've found other sources on the Internet to say that yes, alias files can ...