Linked Questions
60 questions linked to/from In Bash, when to alias, when to script and when to write a function?
44
votes
1
answer
13k
views
Aliases vs functions vs scripts [duplicate]
This site says, "Shell functions are faster [than aliases]. Aliases are looked up after functions and thus resolving is slower. While aliases are easier to understand, shell functions are preferred ...
3
votes
2
answers
3k
views
How to create an alias for a sequence of commands? [duplicate]
I know it for one command but how to work with a sequence?
-2
votes
2
answers
4k
views
alias for killing all processes of a grep hit [duplicate]
I am trying to make a superkill alias that kills all process that hit a grep match. I'd like to do:
superkill ruby
And have it kill all processes that match 'ruby'
In my .bashrc, I've added this
...
2
votes
2
answers
4k
views
Using xfreerdp with variable IP/hostname [duplicate]
I got a very simple alias on my bash:
alias xfreerdpp='xfreerdp /v:ip_address /u:username /d:domain /p:password /size:1024x768 /clipboard /cert-ignore &'
All I want to do is to make the ...
2
votes
2
answers
2k
views
cd in bash script without alias, function, source [duplicate]
I've written a bash script which should cd me to a directory.
My problem is that only the directory in the subshell changes.
I've read of many similar problems to this, but I want to know if there ...
4
votes
1
answer
808
views
Alias in .bashrc doesn't seem to accept an argument [duplicate]
Possible Duplicate:
In Bash, when to alias, when to script, and when to write a function?
I'm trying to setup an alias in my .bashrc file, but it's not working as expected.
I have this alias ...
0
votes
1
answer
743
views
create unix alias for "ssh username@", and I would like to use it for any ipaddress. [duplicate]
create unix alias for "ssh username@", and I would like to use it for any ip address.
for example,
alias go="username@"
usecase:
$go 10.1.1.1 ; implement => ssh [email protected]
Currently if i do ...
-1
votes
2
answers
467
views
alias the find function and use it with sudo [duplicate]
I'm having trouble creating an alias so I can run find in "silent mode" (without all the Permission denied messages). my bash skills are pretty bad so I'm not sure how to fix this
here's my alias in ~...
-2
votes
2
answers
255
views
What am I doing wrong with my own alias in ~/.bash_aliases? [duplicate]
~/.bashrc
My ~/.bashrc contains the following (by default):
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
~/.bash_aliases
My ~/.bash_aliases contains the following (my definition):
...
0
votes
1
answer
961
views
how to make a bash alias to a script in folder [duplicate]
i have a pyton script that execute with python script.py when you are in the same folder.
I want to know if it's possible to make a bash alias like alias script='command' to execute the script also ...
1
vote
1
answer
334
views
A substitue for Bash aliases (something that behaves basically like an alias but isn't an alias) [duplicate]
I need a A substitue for Bash aliases (something that behaves basically like an alias but isn't an alias).
The reason I need such a substitute is because scripts cannot utilize aliases. That is to ...
0
votes
2
answers
340
views
Add something at the end of every typed command [duplicate]
Is there a possibility to add some text at the end of every command i type in the terminal? For example i type "ps" and after pressing enter, it becomes "ps -a", I type "ls" and it's "ls -a"
0
votes
1
answer
162
views
shortcut for commands [duplicate]
I use following commands very often, and they're too long.
sudo /etc/init.d/kerio-kvc start
sudo /etc/init.d/kerio-kvc stop
how can I create a shortcut command for them? something like sudo kerio ...
1
vote
1
answer
121
views
Aliasing a command with special parameters [duplicate]
I would like to have an alias for the following code:-
g++ *.cc -o * `pkg-config gtkmm-3.0 --cflags --libs`;
but I want that when I enter the alias it should be followed by the file name *.cc and ...
0
votes
0
answers
218
views
Why does alias to move into usr/local/bin fails [duplicate]
I am trying to have an alias to move binaries into a folder on my path.
Currently I have:
alias addapp='sudo mv $1 /usr/local/bin'