All Questions
68 questions
0
votes
2
answers
67
views
append newline to bash alias
Im finding great difficulty in adding a new line character to my bash alias in my ~/.bashrc file
alias mip="curl ifconfig.me/ip"
I want a newline to be inserted after the above script, so ...
3
votes
1
answer
248
views
How to overload / customize bash (or any other shell) commands handler?
When in bash some non existing command is run, corresponding error message appears:
$ non-existent-command
non-existent-command: command not found
Is it possible to customize this behavior?
I would ...
0
votes
1
answer
336
views
How to use alias command with a paramiko SSHClient connection?
I am trying to execute the following, with no success getting either the 'py3start' or the 'py3test' alias commands recognized - (I introduced the 'py3test' for testing purposes to check if setting ...
1
vote
1
answer
153
views
use aliases in bash script
I use aliases in my code, it works the first time and shows the current time, but the second time, when I call it shows past time(time showed before instead of current time)
GNU nano 6.2 ...
5
votes
3
answers
4k
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
2
answers
245
views
How do I convert this script into an alias (MacOS, ZSH) [duplicate]
This script works fine when directly typed into the console:
N | find . -type f -iname "*.aac" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -acodec libmp3lame "${...
0
votes
1
answer
2k
views
Using alias by executing command remotely with ssh
shopt -s expand_aliases
ttmp="SUCCESS"
alias aliased_command='echo $ttmp'
I can use alias remotely by adding the above lines to .bashrc file.
[USER@REMOTESERVER ~]$ ssh MYSERVER ...
35
votes
6
answers
4k
views
Are there any single character bash aliases to be avoided?
Often I find my self making single character aliases, because after all, they exist to save input time. I'm curious if this should be avoided. I do not know of any conflicts.
1
vote
1
answer
104
views
My multiple variables in a function do not get expressed as aliases. I think my syntax is faulty
In bashrc, I have this alarm function which can take 3 variables:
a () {
local $1="${1:-3600}"
local $2="${2:-paa}"
local $3="${3:-alarm}"
sleep "$1" && $2 && $3
}
alias ...
0
votes
3
answers
4k
views
Create shortcut to folder for use in shell
I’d like to make a shortcut to a folder and be able to manipulate it.
For example I have the folder:
/media/Music
And the folder:
/media/Downloads
I’d like to move the contents from downloads to ...
-2
votes
2
answers
230
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
277
views
dot (.) causing alias to break
I am trying to create an alias for the command -
rsync -avh --omit-dir-times --delete --filter='protect .sync' /media/blueray/Data/_Work/ /media/blueray/Data/_CloudYandex/
The command I am using to ...
0
votes
4
answers
679
views
using aliases in function?
I have a script yummy.sh
#!/bin/bash
alias yumy='yum install -y '
yumprovision() {
yumy
}
When I run this script got this
bash: yumy: command not found
why it's not loading alias in function?
0
votes
2
answers
2k
views
Can't I define aliases (using `export`) that are in my current directory? Doing so gives a `not found` message
TLDR: have to define an alias/variable using the export command, I can't use the full path and using a relative path (i.e. defining the alias while in the directory directly above what I want to ...
1
vote
2
answers
753
views
alias: backup & and edit file
I need to backup files (usually images) before editing (and overwrite) them.
Currently I do it by:
cp file.jpg ~/BACKUP/file.jpg
exiv2 BLABLABLA file.jpg
How can I do it with a single command?
e.g.
...