Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [alias]

In shells, an alias is an alternate name for a command. For instance, "ll" is an alias for "ls -l" on many systems.

Filter by
Sorted by
Tagged with
3 votes
1 answer
32 views

Condense multiple similar alias

I have been working on creating new alias to use at work and noticed my .csh file filling with similar alias that go to different sub-directories but everything else is the same. I am newer at ...
Michael's user avatar
  • 31
9 votes
2 answers
1k views

Show Shell Function in Ubuntu Terminal

Over the years I've moved away from using aliases to defining functions in a .functions file that I source at the time of launching the shell. This works fine, but one feature of alias that I miss is ...
Tex's user avatar
  • 145
0 votes
1 answer
61 views

changing grep command --color from red to another color [duplicate]

I'm searching from the file using grep command with particular pattern, sysadmin@localhost:~$ grep bash /etc/passwd which return the output like below root:x:0:0:root:/root:/bin/bash ...
SpiderMan's user avatar
0 votes
1 answer
40 views

Custom alias to run and compile .c file [duplicate]

I'm trying to create custom alias to to compile and run my .c files in one command. I tried to add this line in /.bashrc_aliases alias runc='gcc $1 -lm && ./a.out' however I get an error and ...
Jáchym Šmíd's user avatar
7 votes
2 answers
1k views

Should I put functions in .bashrc, .bash_aliases or .profile

I have read this thread about where to put aliases. Now, let's suppose that my custom command is quite elaborate (takes arguments in input, is composed of several commands run one after the other, I ...
Tms91's user avatar
  • 395
0 votes
1 answer
107 views

Starting an appimage

This may seem like a simple question but I am attempting to create a function in my .bash_aliases that would chmod the appimage as executable then start the appimage. The function that I have written ...
Charles Henington's user avatar
3 votes
3 answers
733 views

Alias for git commands

Most of the time, I use these git commands : git add src/ package.json git commit -m "custom message" git push origin "name_of_the_branch" So I want to make a single alias ...
Abhishek Kamal's user avatar
1 vote
1 answer
204 views

Create alias of a command with sudo

I would like to create an alias of the below command with sudo like below. alias /usr/bin/vmstat='sudo /usr/bin/vmstat' is it possible to create something like that for a user?
Mirza Sajawal Baig's user avatar
1 vote
1 answer
198 views

Create a bash function with parameters to use as an alias

I have realised that my folders follow a specific structure and wanted to access them with cd faster, so I tried to make this alias / function that would behave like this: cdc glm 03 would be ...
Uladzimir Treihis's user avatar
0 votes
0 answers
10 views

Create a alias using ls | grep | xargs xdg-open [duplicate]

I'm trying to create a alias combining ls | grep | and xargs xdg-open. This is what I've tried so far. Not sure why it is not working. alias lso='ls | grep "$1" | xargs -I {} xdg-open {}' ...
Zergwest's user avatar
0 votes
0 answers
217 views

apache2 The Alias directive in /etc/apache2/conf-enabled/autoindex.conf at line 21 will probably never match because it overlaps an earlier Alias

As delivered on 22.04, in the apache2 package, there is a duplicate alias definitions for /usr/share/httpd/icons. The alias of /icons/ is found in both mods-available/alias.conf and conf-available/...
Ed Greenberg's user avatar
2 votes
1 answer
624 views

how to add alias to bashrc and load content with sudo?

I need to run my script with sudo, because it includes commands for installing programs with apt. So I do this: sudo ./myscript.sh With content: #!/bin/bash # add alias .bashrc (work) echo "...
acgbox's user avatar
  • 2,210
4 votes
2 answers
697 views

How to printf "`" and "%" character inside array on aliasses?

I have some issues with the button on the keyboard, I have already replaced my keyboard 3 times. I use printf for some text editors temporarily. I need to printf "`" and "%" ...
abu-ahmed al-khatiri's user avatar
-1 votes
1 answer
139 views

Can alias be part of the string I type on the command line?

Can I make an alias in the way that it is part of the string I type on the command line? In addition to that, I'd like that alias to have more than one value. For example, if I enter any of the ...
user1696453's user avatar
0 votes
1 answer
353 views

What overwrites an alias created by a file in /etc/profile.d? (environment variables)

I executed the following command to create an alias file in CentOS 7.9: echo 'alias ll="ls -alhF --color=auto"' > /etc/profile.d/alias-ll.sh Then once I restarted the shell, "type ...
Tristan's user avatar
  • 103
1 vote
1 answer
303 views

How to list aliases (“alias” command) from within a script

I’d like to execute the “alias” command from within a script. It’s under the “Settings” area for the user. I can execute “env” but would like to follow that with their set aliases that they/I would ...
Matthew Morrow's user avatar
0 votes
2 answers
205 views

Alias path not found on Ubuntu

I installed kind from kubeflow kind and save it under my $HOME/kubeflow/kind To run kind from any path, I create an alias in my ~/.bashrc as following: alias kind="./$HOME/kubeflow/kind" ...
BetterEnglish's user avatar
0 votes
2 answers
335 views

Create alias with variable input?

So I've seen a similar question to this, but using fish. I though am using vanilla ubuntu 20 terminal. What I have is an alias for a directory 1dir='cd such/and/such/and/such', and another for running ...
user20982182's user avatar
4 votes
2 answers
2k views

How to create an alias for a "cat" file usable in a path

I have two huge files (150G each) and I need to use a tool for which I should supply them as a single file (since the tool only accepts one file). However, I do not want to merge these files for ...
ashenflower's user avatar
1 vote
1 answer
711 views

Can't Create a Permanent Alias In Fish Shell

I'm trying to create a permanent alias. I've created one long ago, but I don't remember if I did anything differently than what I'm doing now. Be as it may, it isn't working! I start by opening the ...
Rich Hard Fine Man's user avatar
2 votes
1 answer
1k views

Create an executable that is an alias for another command

I've downloaded Open Video Downloader which is a gui to youtube-dl (which is kinda dead) I've replaced it with yt-dlp (youtube-dl fork which is working) My problem is that yt-dlp needs python 3.7+ to ...
Enrique's user avatar
  • 339
0 votes
1 answer
100 views

sudo -s -H and aliases

I often use sudo -s -H, but want to have aliases after executing it How to? Explanation: I log in server as user1 (which is in sudoers). This user has aliases in .bash_aliases: alias rm='rm -i' now I ...
Tomasz Brzezina's user avatar
-1 votes
1 answer
380 views

Alias to create a Python package

Wondering how to create an alias for creating a Python package. A Python package is nothing more than a folder with an empty __init__.py file inside it. So basically I need something like alias pydir=&...
Gabriel Tkacz's user avatar
1 vote
1 answer
1k views

System doesn't remember alias

Somewhat of a novice here. I recently installed the flatpak Brave browser and since it's tedious to write flatpak run com.brave.Browser every time to run it from the terminal, I tried to create an ...
Uncle Woods's user avatar
0 votes
0 answers
23 views

nohup in alias has problem "nohup: missing operand" [duplicate]

Hi I was trying to create an alias to run a shell script in background: alias inj=nohup ~/software/idea-IU/bin/idea.sh in my ~/.bashrc But as I type inj in terminal, I got nohup: missing operand error....
wayne's user avatar
  • 101
1 vote
0 answers
199 views

Setup alias to work immediately when created as root without a restart

I have created a Shell script to install some software which runs as root. As part of this process it sets up an alias to point at a shell script to make it easier to run for the user. It does the by ...
saltedlolly's user avatar
2 votes
3 answers
12k views

How to give docker-compose alias to the new docker compose (v2) command?

I noticed that docker-compose 1.x is gently being dropped in favor of the new v2: https://www.docker.com/blog/announcing-compose-v2-general-availability/ So I then removed my docker-compose v1.x ...
s.k's user avatar
  • 1,310
0 votes
1 answer
529 views

XAMPP is not working on Ubuntu 20.04.4 LTS

I have been using XAMPP to work on personnal project using PHP. XAMPP used to work before when I first installed it but now there seems to be an issue that I can't seem to resolve. Here's what happens:...
Harpartap S C's user avatar
1 vote
1 answer
1k views

How to run an alias inside an alias in fish?

I aliased sudo to please with a space: $ alias please='sudo ' $ please ll I have tried this in Fish, but it doesn't work: $ alias please='sudo ' $ please ll sudo: ll: command not found
Octopus's user avatar
  • 53
0 votes
3 answers
256 views

How can I edit a command? [duplicate]

I'm trying to edit the clear command. I've tried going into the bin directory then doing: "gedit clear" but it ended in failure because I can't edit the file without potentially corrupting ...
UnderSc0r3's user avatar
-1 votes
2 answers
559 views

Sudo aliased to please; how do i make please see aliases?

I made sudo see aliases with alias sudo='sudo '. I aliased sudo to please (alias please=sudo), and with please it didn't worked: alias please='please '. please still didn't see my aliases. How to make ...
user avatar
2 votes
2 answers
482 views

Is there any way to alias ";;" to "ll"?

I am a huge fan of aliases. this feature REALLY makes my life easier. I have the following alias set: alias ll="ls-lah" However, I frequently fatfinger ll to ;; As a solution, I attempted to ...
iTestStuff's user avatar
4 votes
2 answers
569 views

How to edit the aliases with which a program in Ubuntu is associated (and therefore will be returned in the search menu)

Pardon for for not having the correct terminology yet. When I press the Meta button, Ubuntu lets me search for programs. When I, e.g., search for 'sound' it shows me a list of settings, programs, etc. ...
DataScience's user avatar
0 votes
2 answers
1k views

Is it possible to allow NOPASSWD on an alias of a command requiring sudo?

I added this alias: alias shutdown2h='sudo shutdown -h +120' which I would like to run without having to enter the password but also without adding NOPASSWD for the whole shutdown command. Is it ...
Alin Anca's user avatar
0 votes
1 answer
55 views

Is there a way call an alias without separating it from previous characters?

Super new to all of this. Trying to do the overthewire wargames to learn and thought it was a bit tedious to log in to each level, and wanted to make some shortcuts. I made an alias that can take the ...
apep11's user avatar
  • 1
2 votes
1 answer
2k views

my .bashrc has a typo and I do not know how to fix it

I was trying to create an alias for a command, I added the alias to the bottom of .bashrc file but when I try to run source .bashrc I get: .bashrc (line 6): 'case' builtin not inside of switch block ...
Hasan Aga's user avatar
  • 255
0 votes
1 answer
249 views

Failing to connect apache2 with ScriptAlias

I'm trying to set up a ScriptAlias on an apache2 server, but when I try to connect to it using the alias, I get a Forbidden error: This is my /etc/apache2/apache.conf: cgi.load is enabled on /etc/...
dNyrM's user avatar
  • 113
16 votes
2 answers
3k views

Why doesn't the "watch" command work on an alias?

I made my customized alias command and tried to use it with alias, but my alias was not recognized while concatenated with the watch command. So I tried to make a thread of it and fortunately, this ...
YoloWex's user avatar
  • 320
0 votes
2 answers
910 views

I can't find my alias file

Some time ago I created an alias which is still working (base) Mac-mini ~ % type Iridis Iridis is an alias for ssh ... I want to modify this alias but when I go to nano ~/.bashrc the file is empty. ...
Manuel Dominguez Becerra's user avatar
2 votes
1 answer
1k views

how to define a variable in .bashrc so i can use it as path

Hi ( sorry for my bad English ) I just learned how to permanently set a key for a specific value using alias: .bashrc alias please='sudo' alias go='cd' alias destroy='rm -rf' And it works perfectly ...
YoloWex's user avatar
  • 320
0 votes
1 answer
106 views

Bash Function/Alias name collision causes seg fault

The problem in this post also happened to me. mkdir crashes bash I couldn't comment there because no reputation. Can anyone elucidate why this happens? It happens at runtime Not when the function is ...
Zaira's user avatar
  • 1
1 vote
1 answer
306 views

Issues setting up bash autocomplete for Python3 alias

I've got an alias for python3, 'py' - it's set up as you might expect in my .bashrc file. alias py='python3' complete -F _python py The issue is that complete will only work if I try to complete with ...
Miku Tatukua's user avatar
8 votes
1 answer
2k views

How can I make a shell alias work immediately?

Defining and using an alias in the same line does not seem to work: $ alias x=ls; x x: command not found How can I "escape" x in the second call so that it is recognized as an alias?
bers's user avatar
  • 181
1 vote
1 answer
109 views

defining an alias is not recognized in other terminals [duplicate]

I was playing around with the command "alias" and I noticed that when I define an alias for copy to be c ( alias c="copy" ) it only work on that terminal, if I switch to another ...
moe_'s user avatar
  • 111
0 votes
1 answer
2k views

Why is my alias from .bashrc not working?

I've written a line in .bashrc alias untar='sudo tar –xvzf' Now, when I use "untar" in bash I get the error: untar filename.tar.gz tar: invalid option -- '�' Try 'tar --help' or 'tar --...
Mark Rensen's user avatar
7 votes
3 answers
4k views

How to make alias to systemctl with autocomplete

I tried alias sct='systemctl' complete -F _systemctl sct But the function _systemctl is not found until I run the original command systemctl in the session. This function loads dynamically or somehow ...
tehkonst's user avatar
  • 343
6 votes
4 answers
5k views

is it possible to alias a port number?

I want to run a service on a custom port (e.g. jenkins on 8080) and I prefer to access it via browser with a name I can remember, e.g. http://localhost:jenkins which will be an alias for http://...
CIsForCookies's user avatar
2 votes
4 answers
5k views

How I can run application from anywhere in the terminal without being in the full path

I have an application that I can run while I am in the file location as the below: -$ cd home/myApps/app -$ ./run.sh I want to call the run.sh from anywhere in my terminal without being in the full ...
MindC3ll's user avatar
0 votes
0 answers
27 views

I just installed Quixel and Nuke, how can I create an alias for them in Ubuntu? [duplicate]

I just installed Quixel Bridge and Nuke. They are not found in the application list so I have no way to drag them to desktop favorite. Nor did they like Google Chrome that could be started in terminal ...
Wendy's user avatar
  • 1
1 vote
1 answer
89 views

Handy command for editing previously executed mistyped command and overwriting history entry with the fixed one

until recently I was pretty sure that fc command opens previously executed command in the default editor, executes submitted changes and overwrites last entry from the bash history. However, seems ...
zeko868's user avatar
  • 31

1
2 3 4 5
9