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.

learn more… | top users | synonyms

3
votes
2answers
129 views

executing alias on variable in bash

I am a bash newbie and I came upon this strange behaviour in my bash script. #!/bin/bash V=a alias $V="echo test" echo $(a) #returns 'test' echo $($V) #returns ...'a: ...
2
votes
1answer
39 views

Is aliasing over a coreutil command a bad idea? [closed]

I frequently find myself copying large directories and then thinking "darn, I should've used rsync instead of cp for this because I can get progress updates". I'm considering adding this to my ....
0
votes
0answers
25 views

alias defined in modulefile does not work in launched shell [duplicate]

I am trying to get aliases working on my company's number crunching machine, which uses the bash shell on CentOS 7. For software management, we use GNU modules. Some case set-ups for certain ...
0
votes
2answers
44 views

aliasing command which takes argument with using pipe

I would like to create an alias in my ~/.bash_profile that will: Take two arguments $1 $2 Pass these to diff Pipe the output to less I have not found any solutions on Stack that do what I need, ...
0
votes
1answer
28 views

zsh alias with arguements

I have an alias for neovim-qt thus defined: gvim='nvim-qt --geometry 500x320 --' This allows me to call gvim foo.py ook.py and have a QT window running neovim with two tabs, one for each file. ...
0
votes
1answer
16 views

creating shortcuts in Mac OSX at command line

I run a MacBook Pro with yosemite OSX. I'm trying to create shortcuts to go to certain directories, run script files, etc. This is my first attempt at creating shortcuts/aliases. I'm asking in this ...
3
votes
2answers
784 views

Bash - “/” is a directory

This is really confusing... I currently have a Debian 8 computer, and I connect to it using PuTTY (SSH). The default console used is Bash. When I try to pass a path to an alias, it gives the ...
0
votes
0answers
18 views

How to give an arbitrary name for a register in vim

Is there any possible way to give an arbitrary name for a register in vim. I am able to use "[a-z]p while pasting. But, I would like to know, if there is anyway by which we can use arbitrary names for ...
0
votes
1answer
24 views

how to load a bash alias for graphical terminal emulator

What I'm trying to do: Load an alias The alias: alias notes='cd ~/project/notes' My system: Ubuntu 16.04 and gnome terminal 3.18.3 In my home directory there are the following bash related files: ...
12
votes
1answer
263 views

Setting temporary bash aliases when entering a folder

Sometimes I like to have very customized bash aliases and maybe keybindings when I enter on a folder (can be a project where I'm used to type lots of commands from CLI). Lets suppose when I enter a ...
1
vote
2answers
49 views

Alias in bashrc - can't get it to work [closed]

I created a shell script and wish to add it to bashrc. I opened /home/jub/bashrc and added the following to the end of the file: alias myfilesync = './/home/jub/Documents/scripts/myfilesync.sh' Then ...
4
votes
1answer
100 views

How can I test if a particular alias is defined?

I have a bash script that needs to behave differently if a particular alias is defined. Is there a way to test if a particular command is an alias in bash?
0
votes
1answer
41 views

How to save an alias of an eval $(other_comand) command

I've been using docker for a while and there's a command I write each time I boot up my docker: eval $(docker-machine env) I know eval shouldn't be used unless necessary, but it's mentioned by the ...
1
vote
1answer
34 views

bash - aliased command - use original command? [duplicate]

I have ls aliased to ls and some flags, however, I want to use the original, 'vanilla' version of ls in another alias. Is there a way for me to call the original version of ls?
1
vote
1answer
26 views

Alias that runs a command using sudo

Im always running a particular app as root because it requires more privileges. I usually just sudo it. I want to make an alias that is something similar to: alias myCmd='sudo nohup /path/to/binary &...
3
votes
1answer
83 views

Run one command after another in zsh when Ctrl-C is pressed

I have recently moved to zsh from bash (on OSX). I have an bash alias I have used to run one program then another (even if previous program exits with error) on bash. I can't work out how to ...
0
votes
1answer
37 views

set alias for a directory

I am trying to set an alias that would allow me to quickly cd to the following directories: /home/user/asreera/Aravind/sample/src /home/user/asreera/Aravind/sample2/src First I set the variable: ...
2
votes
1answer
44 views

Can I use an environment variable to define an alias?

I'm using an automation engine to run perl scripts. script_X requires a wrapper script so it's run like: wrapper_script script_X --parameters But the automation engine can't understand that ...
1
vote
2answers
82 views

forward aliases to child process

I have some aliases which are defined in /etc/zprofile (or /etc/profile for bash). Also $PATH gets manipulated there. I want to start an interactive shell from a shell which avoids the $PATH ...
2
votes
1answer
32 views

Improve existing alias to dynamically replace command line text

I have an alias in .bashrc like this: alias ylog = "yarn logs -applicationId" This works well when I do ylog application_123. Sometimes, my job names come in the form of job_123 instead of ...
1
vote
1answer
20 views

How to execute alias right after sourcing it in a one liner?

I'm trying to write a one liner that sources aliases, then calls one of those newly sourced aliases. My one liner is basically: alias startEnv sourceAliasFile;runNewAlias Since I'm using csh, I can'...
0
votes
0answers
61 views

Why alias could not be found in the shell

I was trying to set the alias for command: {cutadapt -O 24 -q 19,19 -m 30 -g TATAGAATTCGCGGCCGCTCGCGATAATACGACTCACTATAGGGCGTTTTTTTTTTTTTTTTTTTTTTTT -g ...
3
votes
3answers
57 views

Create a nickname to substitute a string without $VARIABLE, in bash cli

Is it possible to create nicknames for frequently used strings, without using the '$' in front of $variables? The string can be fixed and does not need to change for the lifetime of the shell prompt. ...
2
votes
1answer
25 views

Why is a daily .zshrc reload required using an alias containing $(date -u +%Y%m%d)? [closed]

Each morning I run the following command that tails a log file created daily: ssh -t server@55.555.55.55 tail -f development/abc/$(date -u +%Y%m%d).log This works just fine and each morning the log ...
0
votes
2answers
19 views

ZSH function to edit a file based on an input at the cli

I need to set up a function in zsh that would edit a different file based on some input at the command line. I want to simplify my aliases so I don't have multiple aliases to do the same thing but ...
1
vote
2answers
89 views

Fish-Shell Will Not Save my Aliases

I do not know why, but after making a whole bunch of fish aliases. I'm assuming I have neglected one simple step after assigning them all but I cannot seem find the solution myself. Can anyone lend ...
-1
votes
2answers
35 views

errors using alias for an awk command

I'm attempting to add this alias to my .zshrc but run into errors. I've tried escaping the ==, ", and && values and still no luck. What am I missing? alias broke="ssh -t server@5.555.555.555 ...
3
votes
1answer
77 views

When using an SSH alias, why is SSH ignoring my (valid) Kerberos ticket?

I am successfully connecting to my university's network via ssh with Kerberos ticket authentication. Normal, verbose operation (kinit a ticket, then ssh user@hostname) works fine. The Problem When ...
1
vote
2answers
32 views

how to set alias of command in bash that contains both single and double qoutes [duplicate]

I am not able to set alias of hexdump -e '/1 "%_ax) "' -e '/1 "%02X" "\n"' I have tried following methods but failed: alias analyze=\'hexdump -e '/1 "%_ax) "' -e '/1 "%02X" "\n"'\' (note the ...
1
vote
2answers
65 views

How to override option in aliased command? [duplicate]

I have a rm aliased: alias rm='rm -i' How can I override the -i option when I want to remove a large number of files and I don't want to confirm each deletion?
1
vote
1answer
15 views

Should I set PAGER environment variable, alias or symbolic link?

I noticed that when using aliases, some programs launch pager directly (either from PATH or through PAGER). I'd like to define default pager for all cases, not just when I type the command. Should I ...
2
votes
1answer
51 views

alias ? not working in zsh

I was lead to believe that there were no differences between aliases in zsh and bash, however that appears to not be the case. I had an alias that would help me familiarize myself with the command ...
-1
votes
1answer
47 views

All Aliases Stopped working suddenly (Linux Ubuntu 14.04.4 LTS) [closed]

I have been using my system with Ubuntu for almost a year now. I have been using a .bashrc file throughout this time. I have build it according to my needs. Suddenly it stopped working and none of ...
1
vote
1answer
55 views

How to disable an alias in bash for a single command? [duplicate]

Let's say you leave your terminal open and a co-worker comes along and types: alias exit='echo nope' alias unalias='echo nope' alias type='echo nope' alias builtin='echo nope' alias alias='...
4
votes
1answer
33 views

Does tcsh have an equivalent for “${a:-b}” for default variable assignment like Bash?

I want to do this in one line because I want to use it in my aliases. Can I do this similarly in tcsh ? Using “${a:-b}” for variable assignment in scripts There are some ways of doing it here but ...
-1
votes
1answer
50 views

What characters are allowed in an alias?

I am confused as which are the allowed characters to be used in alias? With a function defined as f(){ echo "yes"; } Is it possible to create an alias like: alias fé='f' ### works alias :='f'...
4
votes
4answers
189 views

show only physical disks when using df and mount

When I use df or mount, I'm most of all interested in physical disk partitions. Nowadays the output of those commands is overwhelmed by temporary and virtual filesystems, cgroups and other things I am ...
0
votes
1answer
23 views

Is it okay to add something non-TLD non-hostname as a host alias?

I added some custom (non-TLD) aliases to my /etc/hosts to get rid of IP addresses in my services configuration files. Are there any caveats/gotchas/security implications i should be aware of?
0
votes
2answers
48 views

A tricky recursive bash alias? install at first use

I wonder if this is possible, make an alias, that does a sudo apt-get to the command if it is not there already, and then realiases itself to stop making this changes. Thus I am looking for this ...
0
votes
1answer
35 views

ssh alias with localhost forwarding

Does anyone know what the best way is to create an ssh alias with a localhost argument? Everything I've searched for only includes host, hostname, etc. Such as: Host example2 Hostname example.com ...
3
votes
1answer
109 views

Why Can't I Call Two Aliases With “;”?

When I try to combine two normal commands using the ; character (eg. ls; cd) it works fine. However, I have two aliases that I've created (stopdev and startdev), and if I try to combine them: ...
1
vote
2answers
55 views

parameter aliases

For example is it possible if I could something like below. alias sd='sudo su - <parameter>' if I write like below in command prompt. $sd parameter It would sudo me to given ID as ...
1
vote
3answers
65 views

What are some of the most useful aliases and bash scripts? [closed]

I just picked up some basic bash over at Codecademy today. I was curious what some commonly-used or personal favorite aliases and bash scripts are out there to put in my bash_profile document. Is ...
0
votes
1answer
19 views

why does /var/mail/{username} = /Users/{username}?

My basic question is why do both of these paths point to home (i.e., ~)? Is it pointing to the same home or is it duplicated? I doubt it's duplicated, so if not, how does cd .. decide which directory ...
-1
votes
1answer
13 views

Creating an alias in linux to remove mutiple files

So I'm new to Linux and I'm looking for a push in the right direction with this. I have to create a couple of new aliases in a new text file, (which I did, using pico) expect for one that has been ...
0
votes
1answer
45 views

Syntax of bash alias definition

I'm using Cygwin, and have installed all the developer packages as well as most if not all of the other packages. When I provide an alias for gcc, I get the error -bash: alias: gcc: not found What ...
2
votes
3answers
277 views

How to alias rm to always confirm

When I use the command rm -rf, I want to make sure a prompt always appears before deleting a file, so I tried adding this to ~/.bashrc alias 'rm -rf'='rm -rfi' But it doesn't work. How can I fix ...
0
votes
2answers
216 views

How do I permanently remove an Alias from my Shell

When I was not near my computer some guy got it and set an Alias for ls in my root folder. He set it to 'yes NeverGonnaGiveYouUp'. So now when im in my root folder and type ls I get an infinite loop ...
2
votes
1answer
206 views

sudo: nocorrect: command not found

I am using zsh and oh-my-zsh on Arch Linux. I am not able to make directory using mkdir edward@ArchLinux ~ $ sudo mkdir -p /samba/raspberry [sudo] password for edward: sudo: nocorrect: command ...
1
vote
2answers
31 views

bash adding a filename to an alias command [duplicate]

I have an alias to a ffmpeg command to start recording a session like this: alias sreq='ffmpeg -f x11grab -r 24 -s 1024x768 -i :0.0 -qp 0 -c:v libx264 -preset veryslow' I can just type sreq ...