Skip to main content

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.

0 votes
2 answers
3k views

How can I set an alias for a specific ssh command? [duplicate]

I'm a beginner in Linux, using Ubuntu. I want to make it easier to login to a server using ssh. In my institute, our login command is ssh -Y -p 4022 [email protected]. How can I make an alias for this?
HyungJoe Kwon's user avatar
2 votes
2 answers
401 views

create an alias on ZSH but need to type it twice

I'm trying to create an alias on ZSH. The aim of the alias is to activate a python virtualenv. I've put a line in my .zshrc alias SOU="source /home/andykw/.zshrc && source $(setopt ...
Andy K's user avatar
  • 179
0 votes
1 answer
5k views

Why bash aliases commands are not working?

I am facing a problem with bash alias in Kali linux. Let me tell from the beginning. I want to set some command to save time from writing it again and again. So, I used nano /.bash_aliases and set a ...
AK9's user avatar
  • 1
2 votes
2 answers
9k views

Update `.bashrc` and reload

I have a script that inserts some lines to the bottom of my .bashrc, is there a way to source the .bashrc from within the script so that these changes remain once the script has finished? Here's an ...
Michael Barrowman's user avatar
1 vote
1 answer
244 views

fish - Maximum recursion depth reached with tab-complete

With my fish shell, I have defined the alias alias black='command black -l 110' When I type black in my shell and start to tab-complete, I get the error complete: maximum recursion depth reached ...
Daniel Walker's user avatar
0 votes
1 answer
368 views

Cannot use awk in alias command chain

I'd like to add this command chain to alias to have a shorthand: tail -10000 /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -10 However, as alias it does not work as ...
blnks's user avatar
  • 219
0 votes
1 answer
9k views

How to set python 3 as default interpreter in Linux

I have python 2.x and 3.x installed on my Linux box. but to run the python 3.x I have to type command python3 <cmd> . But i want to update the alias python to point python3 so I don't have to ...
user1591156's user avatar
0 votes
0 answers
236 views

Using aliases in bash scripts

I have a bash file with a number of functions, which I source from my .bashrc. Have a print_text function to print some text to which I associate an alias ptx. The alias is used in a number of ...
Vera's user avatar
  • 1
2 votes
4 answers
1k views

fish shell alias only in specific directory

I am using fish and am working on a project with a script that's frequently invoked for build tasks called x.py. I'd like to create an alias that maps x to ./x.py. However, I only want this to apply ...
cameron1024's user avatar
1 vote
1 answer
303 views

!!: command not found

Recently, I was getting a bit frustrated about not running commands as admin, and started using sudo !! a lot. I decided that, for ease of use, I'd create an alias ffs for that exact line. I added the ...
Dion's user avatar
  • 113
0 votes
2 answers
406 views

Finding duplicate aliases and functions in a script (.bashrc etc)

This site says that functions are faster than aliases, but he rightly points out that aliases are easier to understand - when you want something very simple and do not need to consider passing ...
YorSubs's user avatar
  • 641
1 vote
2 answers
206 views

bash, pass an argument to the 'history' command

I do the following to make history more sensible (i.e. seeing when a command is run can be fairly critical when troubleshooting) shopt -s histappend; # Append commands to the bash history (~/....
YorSubs's user avatar
  • 641
0 votes
1 answer
1k views

alias for podman docker-compose -H unix:///run/user/$UID/podman/podman.sock up -d

This command runs containers using podman rootless with docker-compose. Is it possible to create an alias for this? docker-compose -H unix:///run/user/$UID/podman/podman.sock up -d
m0ng00se's user avatar
1 vote
1 answer
91 views

Can I define an alias in bashrc in an incremental way?

In my .bashrc, at the moment, I have something like this: if [ -x /usr/bin/dircolors ]; then # ... alias ls='ls --color=auto -F' # ... fi # xxx alias ll='ls -AltF' Now let's say that I ...
Enlico's user avatar
  • 1,677
11 votes
1 answer
9k views

Multi-word aliases in bash

I'm trying to add a multi-word alias in my .bashrc. More specifically, I want apt update to be sudo apt update -y. But I can't figure out how to specify a multi-word alias. I've tried the following, ...
Gagan's user avatar
  • 670

15 30 50 per page
1
7 8
9
10 11
61