Questions tagged [alias]
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 at the command-line and avoid having to remember complex combinations of commands and options.
901
questions
1
vote
2
answers
109
views
like history and fc but for a personalized list of useful commands
I have spent a few hours trying to get an easy access to my most useful commands I have to use in a certain environment, I have the "incredible" idea of using history for that purpose, to ...
0
votes
0
answers
55
views
Korn shell (ksh) omits closing quote when displaying aliases
When displaying aliases in Korn shell (ksh) the closing quote is omitted.
This happens with both predefined and user-defined aliases:
>> alias type r l ltr
type='whence -v
r='hist -s
l='pwd; ls
...
0
votes
2
answers
2k
views
How to pass stdin to python script
I'd like to pass input from a shell command over to a python script in an alias that uses a shell command.
test.py:
import sys
print(sys.argv)
the alias
alias foo='echo $(python test.py $1)'
since $ ...
1
vote
1
answer
170
views
How to send output to next input line?
This my snippet alias hst="history 1 -1 | cut -c 8- | uniq | fzf ".
when I run hst
The output is
$ ~ hst
(the output from hst)
$
This is what I want
$ ~ hst
$ (the output from hst)
Example
...
0
votes
2
answers
150
views
How to get 'man gfind' when I enter 'man find'?
On my new-ish mac os/Darwin system, my find tool is an 11-year-old BSD version. I have used MacPorts to install a more current version: GNU's find, which MacPorts has named gfind, and placed in /opt/...
1
vote
1
answer
141
views
Bash Alias with Multiple Quotes [duplicate]
As part of my workflow, I tend to ll (alias ll='ls -l') into a directory to see if the files I need are there, and after that, I cd into the same dir to do whatever I had to do.
I would like to add an ...
0
votes
0
answers
354
views
Alias added to /etc/bash.bashrc does not work for Debian 11
I have a Debian docker. In one line I define an alias in Dockerfile:
RUN echo alias Kill="ps -ef | grep 'dotnet' | grep -v grep | awk '{print $2}' | xargs -r kill -9" >> /etc/bash....
0
votes
1
answer
352
views
Bash alias with a loop, a sudo, pipes, flags, single quotes and double quotes
I want to make a bash alias of the following command, which works typed out on the command line but all my attempts at making an alias have failed. My only diagnosis is that all those nested quotes ...
-1
votes
1
answer
846
views
New Fish-Shell Aliases are ignored
as explained in https://stackoverflow.com/a/2763014/2891692
i created for days many alias in my config file ~/.config/fish/config.fish
and it works.
every new alias i add today don't work.
Example of ...
0
votes
0
answers
202
views
using 2 alias together in cshell terminal
lets say I have 2 aliases, each having multiple arguments.
It looks somewhat like below example
alias s1 "command1 -a -b -c"
alias s2 "command2 -d -e -f"
now if I run :s1 s2 in ...
0
votes
1
answer
1k
views
alias in ash - limitation, syntax issue?
I'm running OpenWRT in a NAS (WD-MBL) and putting together a set of aliases to make maintenance easier via the command line.
These work as expected:
alias shutdown='sync && wait && ...
0
votes
1
answer
147
views
Replace text in terminal
I am using secure copy to copy some data from a server to a folder (let's say: scp [email protected]:/project1/data/ data1/).
My question is if it is possible to save the address of the server (in the ...
0
votes
1
answer
193
views
Usig zsh glob variable not expanding inside alias
I want to list and sort by time, all the files matching a certain pattern and then get only the first 20:
ls -laths *.txt | head -20
This works well, for example if I create two files:
touch 1.txt
...
1
vote
0
answers
791
views
When does /usr/share/zsh/vendor-completions get loaded?
As far as I can tell, my .zshrc doesn't manually source anything in /usr/share/zsh/vendor-completions. If I try to write, in my .zshrc, an alias for a command that has completions set up in /usr/share/...
-1
votes
1
answer
944
views
bashrc + why source not refresh the .bashrc file
we add the following line to bashrc file
alias reboot="echo you not allowed to do reboot on this machine - sorry"
so we get
more ~/.bashrc
# .bashrc
# User specific aliases and functions
...