Linked Questions

37
votes
1answer
8k 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 ...
2
votes
2answers
2k 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?
-1
votes
2answers
1k 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 ...
4
votes
1answer
568 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 ...
1
vote
2answers
1k 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 ...
2
votes
2answers
467 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 ...
0
votes
1answer
463 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
1answer
71 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 ...
1
vote
1answer
83 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
1answer
65 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 username@10.1.1.1 Currently if i do ...
0
votes
2answers
53 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
1answer
39 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 ...
0
votes
0answers
45 views

How do I decide whether to make a command a shell script or an alias? [duplicate]

Possible Duplicate: In Bash, when to alias, when to script, and when to write a function? If I want to make a command like gsb that will expand to something like git show-branch -a | more or ...
1
vote
0answers
32 views

sticky alias command [duplicate]

I want to have the alias inst to be used instead of installpkg /tmp/ and then install packages by inst <pkg name>. But in normal alias define, We can not stick alias name to the package name and ...
1
vote
0answers
29 views

how to remove leading space in command line argument [duplicate]

I am losing my mind here.. have tried every combination of functions that strip whitespace but I can't get rid of this particular whitespace I want to write a convenience alias so that typing runit ...

15 30 50 per page