2022 Developer Survey is open! Take survey.

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
0 votes
2 answers
45 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 ...
user avatar
  • 670
0 votes
1 answer
22 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:...
user avatar
0 votes
1 answer
54 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
user avatar
  • 23
0 votes
3 answers
49 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 ...
user avatar
0 votes
2 answers
85 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
51 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 ...
user avatar
4 votes
2 answers
148 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. ...
user avatar
0 votes
1 answer
56 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 ...
user avatar
0 votes
1 answer
28 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 ...
user avatar
  • 1
1 vote
1 answer
107 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 ...
user avatar
  • 206
0 votes
1 answer
21 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/...
user avatar
  • 113
11 votes
2 answers
1k views

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

So I've 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, ...
user avatar
  • 172
0 votes
2 answers
85 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. ...
user avatar
3 votes
1 answer
332 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 ...
user avatar
  • 172
0 votes
1 answer
39 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 ...
user avatar
  • 1
1 vote
1 answer
73 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 ...
user avatar
8 votes
1 answer
678 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?
user avatar
  • 182
1 vote
1 answer
30 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 ...
user avatar
  • 11
0 votes
1 answer
322 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 --...
user avatar
5 votes
3 answers
528 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 ...
user avatar
  • 153
5 votes
4 answers
2k 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://...
user avatar
1 vote
4 answers
740 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 ...
user avatar
0 votes
0 answers
21 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 ...
user avatar
  • 1
1 vote
1 answer
37 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 ...
user avatar
  • 31
1 vote
2 answers
177 views

alias settings nor working at logon

Newly installed hirsute = 21.04. Installed out of the package, created my own personal account, the default .bashrc is present in my homedir and to make sure there is a .bash_aliases too. Both mention ...
user avatar
3 votes
2 answers
482 views

How to append date and text to a file as an alias?

I want to create an alias to append a dated note to a file. (The use case I want to reproduce : Sebastian Daschner - How to do effective note taking as developer. So far I was able to append the date, ...
user avatar
3 votes
2 answers
231 views

How do I find the package providing an alias?

Using apt-file I am able to find the packages providing certain executables like this for example: sudo apt-file search {/bin,/sbin,/usr/bin/,/usr/sbin}/wget Well actually: sudo apt-file search {/bin,...
user avatar
  • 318
0 votes
2 answers
52 views

How to excute several commands with one command [duplicate]

Usually I need to exceute several commands every time Im at work, start local server, start docker bash, run frontend service...and I wish I could do all those stuff with one single command. I tried ...
user avatar
-1 votes
1 answer
140 views

Alias with input [closed]

pretty new to linux and trying to create an alias that runs a python file here's how it goes. alias search=("cd /home/SET && python3 /home/SET/search.py") The only problem is that &...
user avatar
0 votes
1 answer
289 views

Alias fails when defined in .bash_aliases on Ubuntu 20.04.2 over ssh with jump server

Spun up an AWS Ubuntu 20.04.2 server. This server sits behind a jump server. Once the server spun up, I ran: sudo update sudo upgrade As well as rebooted the server. After that, created an ~/....
user avatar
4 votes
1 answer
244 views

Set parameters for Ubuntu's alias

I have an example command as follows: g++ main.cpp -o main -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -I/usr/local/include/opencv4 Running the entire above command will create ...
user avatar
0 votes
1 answer
45 views

alias not working as expected [closed]

I am trying to get file types using an alias. I am using: alias file-types="find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u" However, it is not working: When I type the ...
user avatar
0 votes
0 answers
17 views

Create an alias that takes a file name as a paremeter, removes the extension of the parameter and creates a new extension [duplicate]

I want to create an alias in my ~/.bashrc file that takes a file as a parameter, removes the extension of that file, and adds a new extension. For instance, instead of doing cp file.txt file.bak, I ...
user avatar
  • 1
0 votes
0 answers
427 views

Problem updating snaps on 20.04

A few days ago I tried to change my default python3 path from /usr/local/bin/python3 to /usr/bin/python3 on my Ubuntu 20.04 (Desktop Env => Gnome 3.36) by - creating a symlink to the desired path ...
user avatar
0 votes
1 answer
462 views

How to input a password when using an alias

I am using sshpass in order to perform a scp command inside a pretty long script to run and I would like to be able to input a password in advance for this. It's pretty easy to use the password as a ...
user avatar
0 votes
0 answers
47 views

aliases are not supported

I have been trying to figure out what this error is even referring to. I thought at first it was because I accidentally changed my ethernet adapter ID in the config file. but I checked it and it was ...
user avatar
0 votes
2 answers
113 views

bash, get part of file limited by 2 strings based on grep

Here is input file (3 parts divided by ##). ## some info 1 aaa bbb ccc ## some info 2 ddd eee fff ## some info 3 ggg hhh iii I need get one or more parts of file based on search words based on ...
user avatar
  • 768
1 vote
0 answers
256 views

After update to 21.04 my alias in bashrc no longer works

I have appended this alias in my .bashrc file: alias libreoffice="flatpak run org.libreoffice.LibreOffice/x86_64/stable" Prior to the update (from Kubuntu 20.10 to Kubuntu 21.04) this alias ...
user avatar
  • 9,537
3 votes
2 answers
263 views

How to create a CLI alias for a web search with W3M?

I would like to create an alias with the function to perform a DuckDuckGo search with W3M via the Command Line Interface (CLI). I have already created the alias and the DuckDuckGo search engine is ...
user avatar
  • 144
0 votes
1 answer
169 views

Aliasing cd && echo doesn't work properly

I'm trying to create an alias that changes the directory and prints some content. I've wrote this line: alias test="cd ~/Documents/MyDir && echo 'content'" The result is: content ~$:...
user avatar
0 votes
1 answer
296 views

How can I make a file with alias's on it, put it on usb stick, and make the alias's accesible when I insert the usb drive

Hi Im very new to ubuntu and linux, I know how to create the file and put alias's on it, I was wondering how do I make this file accesible only when I insert the usb drive,meaning the alias's would ...
user avatar
0 votes
1 answer
216 views

Changing alias or PATH when in certain directories

Is there a way to alter an alias or my PATH variable when I cd into a particular folder (and vice versa, change the alias back/restore the PATH when I change out of it)? Right now, I have an alias dc=&...
user avatar
  • 101
0 votes
1 answer
861 views

How to create an alias for an ip address on a network on ubuntu?

I created a nodejs service (webserver) on a LAN. Now people can only access by typing an IP. We want to type an alias such as "webserver" on the browser instead. Is this something to set up ...
user avatar
  • 299
1 vote
0 answers
108 views

Alias for keycodes in XKB evdev file

I want to remap "i" to the home button without losing "i" on the alphabet section of the keyboard. I tried alias = ; but it didn't seem to do anything. I've tried Autokey but it ...
user avatar
3 votes
1 answer
173 views

Assign flatpak run org.chromium.Chromium to an alias

I am using https://www.cypress.io/ for react components e2e testing. The CypressJS could not detect the installed Chromium on my computer, because I have installed it with flatpark. One of the ...
user avatar
2 votes
1 answer
215 views

Using datetime expression in alias

I have an application with logging, and I usually watch it with tail -f /var/myapp/logs/2021-04-20/main-log-2021-04-20.log How can I create an alias for this command and execute it with current date?
user avatar
  • 131
2 votes
1 answer
102 views

How to create aliases with "overlapping" names to existing commands? [duplicate]

Let's say I want to create an alias called ss for the command sudo -s. But ss is already an existing command, so I want to create another alias called sst for the command ss. If using just the normal ...
user avatar
-1 votes
2 answers
1k views

Best practice to keep linux updated and clean [closed]

I got lost with old forum and stuff so here I ask, I did a alias to keep linux updated and clean and I wonder if I did it correctly or if I missed something. alias update='sudo apt update && ...
user avatar
  • 1
0 votes
1 answer
64 views

Turning command into alias, what characters to escape?

I use the following command to count lines of code (skipping blank lines and comments) in python scripts: sed '/^\s*#/d;/^\s*$/d' *.py | wc -l This works just fine, and I am trying to turn this into ...
user avatar
0 votes
0 answers
112 views

How to move between folders in ~/.bashrc

I am creating some aliases to save keystrokes. I am writing inside ~/.bashrc the following: alias work='cd /work/e674/e674/ouatu/' alias pythonvenv='cd /work/e674/e674/ouatu/...
user avatar
  • 213

1
2 3 4 5
8