I am getting an error in my terminal lias command not found

52 Views Asked by At

Whenever I open my terminal I always get this error bash: lias: command not found. I though of ignoring it but I am not able to listen on localhost:3000. enter image description here

Please help me fix this

1

There are 1 best solutions below

0
Vab On

@MayankRaman based on @Jetchisel explanation - which I totally agree with - here I'll try to provide some hints that I wish will help you to better understand the reason and find the problematic file.

Assuming you are using Git Bash, which provides Git command-line shell, to make some aliases permanent (think about a command shortcut when talking about alias) you have to store it in the relevant file(s) to make it permanent - these files are called initialization files for a shell.

Initialization files may be in both User's $HOME directory (for each individual User configuration) or somewhere in the /etc directory (to be implemented for all Users).

Now you need to figure out in which of your initialization files you have the wrong line lias (instead of alias <followed by a defined command shortcut> ).

The simplest way I can suggest starting with is the following commands, which will try to grep (filter) the lias string in the files in your User's $HOME and /etc directories and IF found one, then outputs the file name and line number so you can fix it by commenting out or removing or fixing the relevant line.

Note: Run and analyze these commands one at a time

  • find "${HOME}" -maxdepth 1 \( ! -name '.bash_history' \) -type f -exec /bin/bash -c 'grep -nw "lias" $1 2>/dev/null && echo "Found in: $1"' _ {} \;

  • find "/etc" -maxdepth 2 -type f -exec /bin/bash -c 'grep -nw "lias" $1 2>/dev/null && echo "Found in: $1"' _ {} \;

Since I don't have a wrong lias parameter, below you may see an example output of the same command that found alias (instead of lias) in my /etc/profile.d/aliases.sh` file:

5:alias ls='ls -F --color=auto --show-control-chars'
6:alias ll='ls -l'
18:             alias $name="winpty $name.exe"
Found in: /etc/profile.d/aliases.sh

PS. These commands have been tested in

$ bash --version
GNU bash, version 4.4.23(2)-release (x86_64-pc-msys)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>