An alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence. This can save a great deal of typing in the command-line and avoid having to remember complex combinations of commands and options. Use this tag for questions about ...

learn more… | top users | synonyms

0
votes
0answers
25 views

how to shorten git to g by using a alias

I am running git 2.7.2.windows.1 and I have edited my .bashrc file to have this line alias g='git' but when I type g status I get an error bash: g: command not found I even tried editing my ...
0
votes
1answer
28 views

Alias to attempt mounting multiple times doesn't work correctly

I have the following in my .bashrc alias ext='sudo mount /dev/sd'{b..d}'1 /ext/hdd || sudo' I intended the alias to mount my external hard drive without having to worry about the semi-random ...
0
votes
1answer
18 views

Why are spaces not allowed while setting up aliases in .bashrc

Coming from the Windows world, I tend to type cls to clear the console. I wanted to set up an alias so cls would still work. I read an article online that mentioned you cannot have spaces between the ...
1
vote
1answer
24 views

Bash alias/function to precede every “git diff” with “clear”

Every time I do git diff I'd like my bash to do clear & git diff instead. I tried to tweak an answer at "Bash: Spaces in alias name" like this: git() { if [[ $@ == "diff" ]]; then ...
0
votes
1answer
281 views

Bash autocomplete behaviour in Debian 8

On a new install of Debian 8 (Jessie) I have found that the autocompletion in bash, using the tab key, has changed. The test I did was: Open a terminal (in my case Konsole). Above the prompt it ...
0
votes
1answer
58 views

Is there a standard place to put my Aliases? bashhrc vs. bash_aliases

Is there a standard place to put custom aliases? If not, what are the benefits and disadvantages of .bash_aliases, .bashhrc, and .bash_profile?
0
votes
1answer
25 views

Distribute session-only git configuration on ssh login

I have a bunch of development servers (linux) that I connect to via SSH from linux workstation. On most of these servers I want to use the Git command line interface. I use a set of Git aliases that I ...
1
vote
0answers
59 views

How to automatically log-in to remote MySQL instance via ssh behind another host?

I have an alias set up to ssh to a remote machine through a proxy ... alias sshcmd='ssh -t davea@proxy ssh destmachine' but I want to set up an alias where I ssh into the remote machine and then ...
2
votes
2answers
53 views

One-line code in bashrc to edit pdf

I would like to have a one-line code in bashrc, for removing the first page of a pdf. The command to be typed in the bash prompt could of the form: cut name.pdf This command should remove the ...
0
votes
1answer
171 views

Alias to connect to AWS instance via SSH not working

I made an alias to make it easier to connect to my AWS EC2 instance. Although there is an error. Here is the code in ~/.bash_profile: alias aws_connect=‘ssh -i /path/to/keyfile.pem ec2-user@xx.xxx....
0
votes
1answer
42 views

exiting current terminal in a script

I have made alias for running certain program and i have put it in .bashrc file. I want to close current terminal inside the script. I've tried this but it is not working. alias mp='java -jar ...
-1
votes
1answer
207 views

how to escape '$' in an awk statement in shell alias

I'm trying to write an alias that will kill all running php processes.. this is the command i got in my ~/.bash_profile alias killphp="ps aux | g [p]hp | awk '{print $3}' | xargs kill -9" this ...
0
votes
1answer
56 views

Alias not working

I have an alias that does an ssh into a machine and executes 1 line of code as following: alias posts-update= 'ssh user@host.com "cd /var/www/blog/posts && git pull"' This works perfectly ...
1
vote
2answers
1k views

Sudo doesn't work on Aliases [duplicate]

I have added alias ll='ls -la' in /etc/bash.bashrc but sudo ll is not working. Is there a way to "source" bash.bashrc? In a related post, another user suggesting creating an alias for sudo with a ...
0
votes
1answer
64 views

Trouble 'generating' bash aliases

In my ~/.shortcuts, I have symlinks to some frequently used directories. In .bashrc (OS X), I am doing this: ls -1 ~/.shortcuts | xargs -I {} alias {}="'cd -P ~/.shortcuts/{}'" When I run alias in ...
0
votes
2answers
431 views

Run bash_aliases on start

I have a separate file .bash_aliases , in the same directory as .bashrc, that I wish to be ran on start, I've added the lines: if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi to my .bashrc ...
1
vote
1answer
417 views

Where is virtualenv's deactivate defined?

Virtualenv defines an alias for the command deactivate as seen in yourvirtualenv/bin/activate.csh. What I'm curious about is where deactivate resides, because when I issue an alias command deactivate ...
32
votes
7answers
77k views

How can I use a bash like shell on windows

I use Linux and a Mac. I'll be teaching some command line stuff soon. What can I install on Windows to give me a terminal window most similar to a basic mac/linux bash shell. Would like to be able to ...
1
vote
1answer
2k views

Terminal not working: -bash: exit: with: numeric argument required what to do?

I was trying to install F# compiler and interactive on my Mac, and part of the installation process required providing aliases in the bash profile file. I suspect that I messed something up here, ...
3
votes
1answer
1k views

Bash LS Options ~ Group Directories First

Locally I'm running Debian stable ~ bash -version 4.1.5 ... Remotely my server is running Centos 5-8.el5 bash -version 3.2.25 ... I have a .bash_alias file on both distros containing an alias 'll' ...
1
vote
1answer
334 views

Advanced alias in zsh shell

I'm using the zsh shell on ArchLinux and I want to know if there's an easy way to make "advanced" aliases. Normal aliases work just fine. However I can't find a way to create an alias for a ...
0
votes
3answers
83 views

Alias to add .mylongwebsiteaddress to end of lines in cygwin

I have a server called someserver and a website called mylongwebsiteaddress.com. Basically I always type $./somecommand.sh someserver.mylongwebsiteaddress.com in cygwin when doing updates to servers. ...
2
votes
9answers
2k 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 regex?...
2
votes
1answer
157 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] [name[=...
0
votes
1answer
178 views

Alias settings not “sticking” when running Fedora in Parallels

Recently set up a Fedora 15 installation using the latest version of Parallels. Everything seems to be working fine, save for a particularly odd quirk. Whenever I set up an alias using something like ...
2
votes
2answers
313 views

Alias that allows to edit ~/.bashrc and then “sources” it automatically - Why it doesn't work?

I use MacBook Air with OSX 10.7.2. I would like to create an alias that does the following: Opens TextMate with ~/.bashrc and allows me to edit it Once I close TextMate, "sources" ~/.bashrc (so if ...
1
vote
2answers
264 views

append text to file including multiple quotes

I want to do this: echo alias get_python_lib='python -c "from distutils.sysconfig import get_python_lib; print get_python_lib();"' >> ~/.bash_aliases The result in my ~/.bash_aliases file is: ...
2
votes
3answers
386 views

Autocompleteable alias (or similar) in bash?

I have a CentOS host in my local network that I daily use to open SSH connections to many (over 40) other hosts in both Internet and the local network. I have set up RSA keypairs to skip the ...
2
votes
4answers
5k views

Aliases in .bash_profile do not work

I have added some cd blah blah commands as alias in my .bash_login so as to ease changing directories.It was working fine .Suddenly though none of the aliases in there work .It says command not found ....
0
votes
2answers
602 views

Set emacs to always run in background

In my bash terminal I have emacs set to run in XWindows. I prefer this to not freeze my terminal session so I run: emacs filename & Is there anyway to alias this? I have tried: xemacs='...
16
votes
3answers
7k views

Is it possible to override the command line's built in “cd” command?

Just about every time I 'cd' to a different directory on my machine (in this case, running Mac OS X 10.6.7) via the command line (which is bash), I immediately type 'ls' to get the list of contents in ...
1
vote
1answer
865 views

Creating an alias or function, need to be able to pass in a parameter

I want to wrap 3 lines of execution into an alias, but I also need to pass a parameter when I call it in terminal. Do I need to create a function for this? I'm new to this, but I know there are ...
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 ...
6
votes
2answers
1k 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 ...
3
votes
3answers
184 views

How can I create two identical aliases in bash?

I want to create two different aliases to the same command without repeating myself. How can I do it in bash? For example, I want listlong and longlist to both be aliases to "ls -al".
3
votes
1answer
417 views

Bash Alias to perform Alt+1?

Using Ubuntu I can create a terminal with two tabs: gnome-terminal --tab --tab However, by default it goes to the last created tab. Using Alt + 1 I can make it go to the first, but I want to avoid ...
7
votes
4answers
3k views

Unable to use scp with a bash alias

This code does not work: scp ~/Desktop/favicon.ico nameOfBashAlias:/public_html/mySite/templates/blog/ The alias is: alias nameOfBashAlias='ssh myUsername@11.11.11.111' How do I solve this ...