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
1answer
47 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 ~$:...
0
votes
1answer
41 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 ...
0
votes
1answer
165 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=&...
0
votes
1answer
40 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 ...
0
votes
0answers
16 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 ...
2
votes
1answer
36 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 ...
2
votes
1answer
88 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?
1
vote
1answer
31 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 ...
-1
votes
2answers
97 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 && ...
0
votes
1answer
45 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 ...
0
votes
0answers
64 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/...
2
votes
2answers
62 views

How can I alias a dot string (e.g. '…' to '../..')? [duplicate]

I'm trying to have a shortcut for going back a few dirs. Something like "cd ...." == "cd <number of dots - 1> * '../'" I tried doing alias '...'='../..' && cd ... ...
0
votes
1answer
75 views

How to add special characters in ~/.bashrc file?

I am trying to make a bash alias to grep for Git conflicts within files after a merge occurs. Usually on the command line with bash shell, I run grep -nr '<<<<<<<', where the ...
1
vote
1answer
74 views

How do I add color and labels to bash when opened with alias command?

I have an alias command to connect to a computer using ssh. Here is an example of my alias command: alias yusuf-mongo-191='ssh yusuf@xx.xx.xx.xxx' I want to customize the terminal of this remote ...
0
votes
0answers
22 views

Best practice for using .bashrc aliases under sudo [duplicate]

I have some productivity aliases on ~/.bashrc, which I'm missing when I run something on sudo. In example, I have an alias with parameters for ncdu, which doesn't work when I wanna use it on folders ...
0
votes
0answers
30 views

Can two alias be used in one line?

Can two alias be used in one line? Also, the autocomplete feature does not work after the alias, although it does normally in the default command
1
vote
1answer
56 views

“watch” command doesn't work on alias

watch command doesn't work for alias commands. without alias ➜ scrcpy git:(master) git -P branch * master ➜ scrcpy git:(master) watch git branch with alias ➜ scrcpy git:(master) which gb gb: ...
0
votes
1answer
40 views

Is it possible to show the alias command before being executed?

Let’s say I have the following alias defined: alias agi='sudo apt-get install' When I execute agi I would like to see sudo apt-get install displayed before the command is run. This would serve as a ...
0
votes
0answers
37 views

Combine Alias with new arguments

How can I combine an alias command and a new argument to execute? I have defined alias sqME="squeue -u abcdef123456789". However, sometimes I want to execute squeue -u abcdef123456789 -start,...
0
votes
1answer
148 views

bash.bashrc not working for all users

So I have 2 users on my PC when I add the line alias abc='echo Hello' in /etc/bash.bashrc file and log back in it only works for the first user. (the one that I changed the file) I even rebooted my PC ...
1
vote
0answers
565 views

gedit: Unable to init server: Could not connect: Connection refused

I am trying to make use of the alias command to separate the ROS1 and ROS2. I have dual-booted Ubuntu on my MacAir machine and am using the docker container, which I have installed both the ROS1 and ...
0
votes
1answer
48 views

.bashrc alias help about terminal error

i have alias on .bashrc file like; alias modemreboot="IP=$(/sbin/ip route | awk '/default/ { print $3 }');echo "reboot" | sshpass -p "12345" ssh admin@$IP" for to reboot ...
0
votes
1answer
105 views

Python command starts python3 but no alias is set

When I type python into my Ubuntu 18.04 terminal, python3 starts. The thing is I haven't set an alias for python, e.g. see here. Could anyone explain to me how is this possible and what I would need ...
0
votes
0answers
151 views

How do I create a shortcut to an executable with variables? Ubuntu Server 20.04

How can I create a shortcut to a file with a variable in Ubuntu Server 20.04? The user account that will execute the shortcut does not have Sudo permissions. Here is the path with a variable I want to ...
0
votes
0answers
94 views

Unable to source zshrc during a terminal emulator's startup

Installed Tilix terminal emulator on Ubuntu 16.04 virtual machine and configured a json theme to my liking named theme.json. I have added the same environment variables and aliases both in the .bashrc ...
0
votes
1answer
98 views

How to escape backticks in a .bash_aliases file?

How do I escape backticks as below: root:~# root:~# cat .bash_aliases alias clean='docker rm `docker ps -aq`' root:~# see also: https://stackoverflow.com/q/1250079/4531180 and https://...
1
vote
1answer
66 views

'source' from alias does not work, but manual sourcing does

I have these lines saved on my .bash_aliases: alias sss='source ~/.bashrc' alias merc='source /usr/local/mermaid-bootload/environment-setup-cortexa7t2hf-neon-oe-linux-gnueabi' When I invoke merc, ...
1
vote
1answer
311 views

Creating an alias for apt-get update using apt-get

I've noticed that a lot of blogs that I've seen advise updating the repos using apt-get update prior to running any apt-get install. Considering that many (most?) of my uses of apt-get involve an ...
14
votes
4answers
1k views

Alias to go to newest folder in a folder

We have robot results created into separate folders in format of "result-yyyy-mm-dd-hh-mm-ss" and I currently have this in my bash_aliases alias res="VAR=$(ls --directory /path/to/...
0
votes
0answers
25 views

Use script in an alias [duplicate]

Can I use this script in an alias? MOV="$*" FILENAME=$(basename "${MOV// /_}" | sed 's/\(.*\)-.*/\1/').mp3 ffmpeg -i "${MOV}" -vn -acodec libmp3lame -ac 2 -ab 160k -ar ...
5
votes
1answer
634 views

`alias` command in `.profile` not recognized until `source .profile` is called

I have the following line in my .profile file in my home directory: alias flux='redshift -O 2500' But whenever I login and type flux I get a flux is not a recognized command. I then do a source ....
1
vote
1answer
57 views

Problem with executing alias of a command on Ubuntu 18.04

I created an alias file for holding alias nano .bash_aliases and then used the command alias ganache='./ganachescript' However, $ ./ganachescript 08:29:17.571 › Checking for update 08:29:19.052 › ...
0
votes
1answer
42 views

Multiple Aliases triggering same function

I'm trying to create a function, but I want to trigger by either aliases : debugApp, debugApi Rather than creating 2 functions to do the same thing debugApp() { #update .env to generate log ...
2
votes
0answers
32 views

bash_aliases are not working in Ubuntu run (Alt+F2) dialog [duplicate]

bash_aliases are not working in Ubuntu run (Alt+F2) dialog. It shows a "Command not found" error. But it works perfectly in Terminal. How can I make it working in run command box?
0
votes
2answers
158 views

“which alias” and “whereis alias” doesn't return anything [duplicate]

I recently installed Ubuntu 20.04. I am unable to find the alias command. When I enter which alias I get nothing back. Same with whereis alias.
0
votes
0answers
29 views

Terminal shortcut to a sequence of keys

I often need to restart programs in several terminals while testing with: ctrl+C + arrow up + enter. How can I make a shortcut for this sequence: ctrl+C + arrow_up + enter? Ubuntu 16.04.6 LTS
0
votes
0answers
33 views

trying to make bash alias on mac

I am trying to follow this explanation of how to make an alias and made the following .bashrc file in my home directory. Here it is: # .bashrc # User specific aliases and functions alias py='python3'...
1
vote
0answers
311 views

sSMTP, mail, aliases

I setup ssmtp to send email messages from my Ubuntu server to an external email address. Using the mail command of the mailutils package, I am able to receive emails from my server sent via : $echo ...
0
votes
0answers
61 views

line 5: alias: python: not found [duplicate]

This is the problem I face when I boot my laptop. Error found when loading /home/pulkit/.profile /home/pulkit/.bashrc: line 5: alias: python: not found /home/pulkit/.bashrc: line 5: alias: =: not ...
0
votes
0answers
32 views

Aliasing with reserved keyword or command alias? (Overwriting)

Is it possible to make an alias with a name that is already reserved as a keyword/command in Linux and Ubuntu? If I alias passwd or chpasswd with the same name but use additional parameters so that ...
0
votes
1answer
281 views

Alias for “echo $?” doesn't work

I am trying to set alias for echo $? which returns exit status of the most recently executed command. I've put alias status="echo $?" in ~/.bashrc. But it's not working, it's always returning 0. user@...
0
votes
1answer
959 views

ZSH Alias with Multiple Commands giving “command not found”

I am using this series of commands to build and run a docker container. The commands work when combined with && and give output like this: > docker stop $(docker ps -a -q --filter ...
0
votes
1answer
48 views

Assign Semi Path to a variable

How can i assign only the first 4 words of a path to a variable for example: my current working directory is /home/Foo/Documents/Programs/ShellScripts/Butler and i want assign a variable with path ...
1
vote
1answer
110 views

Alias for BASH integer calculator

My .bash_aliases file is populated with single-letter aliases (such as o for octave-cli and r for sudo reboot. For a while I've been wanting to implement BASH's built-in calculator to do quick ...
7
votes
4answers
976 views

Alias for all users

I created a this file: /etc/profile.d/pycharm_alias.sh startPyCharm() {... } alias py=startPyCharm I rebooted the PC, but then the alias is not available: ===> alias ...empty If I login to ...
0
votes
1answer
318 views

alias updt='sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y' … What could go wrong?

I currently use this handy alias I call "updt" on a daily basis in the following manner: alias updt='sudo apt update -y && sudo apt upgrade -y' I was wondering if anything could possibly go ...
0
votes
2answers
244 views

When making an alias; quatation marks, apostrophes or semicolons can prevent the command to work properly?

I have a file called .bash_aliases where I keep my first (and only one untill now) alias witch work properly, but when I tried to create a new one the terminal failed to recognize the command line, I ...
3
votes
2answers
175 views

Alias to open last file edited in Vim

I am running Ubuntu 19.10, and I am trying to alias the command "vv" to open the last edited file in Vim. Below is my results from running the command 'alias'. ~/Documents/code$ alias alias alert='...
1
vote
1answer
150 views

Ubuntu VPS 18.04 server Apache2 Domain Alias

I hope someone can help me some. I believe this is an easy problem. I currently have a VPS running ubnuntu 18.04 server and Apache2 . I have prestashop installed and trying to configure the multi ...
-1
votes
1answer
2k views

Command not found error after trying to install mgltools on WSL

I am working on Ubuntu windows application. I want to use a tool and I have downloaded the file and install it is in /usr/local/bin. I want to access the tool from anywhere and for that I have write ...

1
2 3 4 5
8