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
0
votes
1
answer
2k
views
error using scp in alias: not a regular file
I know questions regarding this error have been asked before - but I can't seem to figure out why this isn't working in this case: for aliases.
I have the following
alias scpip='scp $1 [email protected]:~'
...
0
votes
2
answers
1k
views
How do I create a command prefix for bash with an alias?
I'm trying to create a bash alias that would act as a prefix, and could be parsed without needing to use a space. Basically, I have a set of commands that all start with the same first few characters, ...
5
votes
1
answer
1k
views
bash_aliases and "if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi" meaning
There's a short section in my .bashrc file that I don't understand and I'd like to ask what it means and some syntax explanation.
# Alias definitions.
# You may want to put all your additions into a ...
3
votes
1
answer
213
views
Making simple backup alias / function?
OK, so all I really want to do is backup single files as a time in the current directory with '.bak' extension.
Here is my current function that does this (jsyk, using Rocky Linux):
function backup { ...
4
votes
3
answers
3k
views
Paths as bash aliases only work in parent directories?
Can bash aliases be paths?
Hi and sorry in advance for the noob question. I noticed a strange behavior when using bash aliases.
My goal
is to use short bash aliases for often used paths, to make ...
0
votes
0
answers
105
views
How to run only a single command in linux?
I want to execute a single command with .bashrc or dotfile support.
For eg: Opening Firefox browser by typing firefox.
I don't want to open terminal, then execute the command and then exit the ...
0
votes
1
answer
718
views
change rm alias to mv
Reference: how to change `rm` to as a command like `mv ~/ .trash`
I would like to implement recycle bin utility in UNIX since UNIX not has one.
In .bashrc file I change alias rm='move.sh"
as per ...
-1
votes
1
answer
150
views
Escape character(single-quotes) not working in Linux alias
I was trying to play around with escape characters in aliases.
Here's a simple example :
I want to create an alias for
echo 'Hello'
So I wrote the alias like below :
alias sample 'echo \'Hello\' '
But ...
0
votes
2
answers
64
views
How to extend a wild card option to include js and ts
I have an alias set as follows:
alias ppp='prettier --write "**/*.js"'
I want it also to do all my .ts files. I'm quite inept at wild card expressions sadly.
0
votes
1
answer
427
views
Variable sleep bash alias [duplicate]
So, I'm trying to create an alias which will run a command after sleeping x seconds.
alias ls_sleep="sleep $1 && ls"
The problem is, $1 is being passed as string and things like $(($...
0
votes
2
answers
327
views
Should echo be aliased to printf?
I'm not quite versed on the terminal, but the few things I've known and read lead me to believe that printf is much more powerful and confortable than echo but work for similar (if not same) purposes. ...
0
votes
0
answers
197
views
Why doesn't creating file with echo work for remote directories in this script?
I aliased the following script:
#!/usr/bin/bash
if [[ -d "template.html" ]]; then
:
else
cp -n /home/$(whoami)/CS/Software/Pollen/template.html .
fi
/usr/bin/echo "#lang pollen
[...
0
votes
1
answer
71
views
How to nest arguments into calling another alias'
I have two alias' (obviously obscured):
alias ki='kinit -kt ~/.keytab alexdodd@box'
alias pt='function _pritunl() {/Applications/Pritunl.app/Contents/Resources/pritunl-client start ...
1
vote
0
answers
21
views
Unable to iterate over files using ZSH alias [duplicate]
I have simple command to iterate JPG files
for f in *.JPG;do echo "Processing $f";done
The terminal output is as follows:
Processing IMG_0316.JPG
Processing IMG_0317.JPG
Processing IMG_0318....
1
vote
1
answer
274
views
How to call many shell functions from sudo?
I have a huge alias file sourced by ~/.bashrc or ~/.zshrc which contains both simple aliases and more functions for more complex stuff:
# example aliases
alias "sudo=sudo "
alias "...