Terminal only shows $ - linux

I tried building my own linux distribution and I follow the Linux From Scratch book. When I tried entering the following commands in bashrc.
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
After this when I restart the terminal. I am seeing only $ symbol. I thought that entry I made in bashrc is the problem. So, I reverted back it and restarted the system too. But, still am seeing the same problem. Also, the auto completion too not working. Please, help me to get rid of this.

Welcome to stackoverflow
You should set the 'PS1' variable. Search it
This is my PS1, for example:
\[\e]0;\u#\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u#\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

Sorry folks, I got my terminal back by reinstalling bash shell by executing the following command
sudo apt-get install --reinstall bash

Related

Command not found in WSL2 even though it's on the path

I'm having an issue with WSL2:
$ where b4a
/usr/local/bin/b4a
$ b4a new
/usr/local/bin/b4a: 1: Not: not found
Even though where finds commands, I can't run them. And it's not a PATH issue either:
echo $PATH
/usr/local/sbin:/usr/local/bin:[...]
And b4a isn't the only command with this problem. What could be the cause? My distribution is Debian 10 and host is Windows 10.
Not necessarily a full answer, but hopefully the troubleshooting methods you need to arrive at a solution ...
Note that it doesn't say that the command itself isn't found. For instance, if you run:
# lllllllllll
lllllllllll: command not found
That's truly a command not found. This is different. While I don't (yet) know the exact cause, this seems closer to the issues we might see with improperly quoted paths with spaces in a shell script.
You mention that other commands have this problem -- Is there something in common with the commands that don't work properly? Is it possible that they are all shell scripts?
Try several things to debug:
Start WSL without your startup profile. It's very likely that something (or you) added a line that is causing problems. From PowerShell or CMD:
wsl ~ -e bash --noprofile --norc
b4a
If that works, then there's a problem in one of your startup files that you'll need to debug. Look for anything modifying environment variables without proper quoting, especially the PATH. WSL automatically appends the Windows path to your Linux path to make it easy to run Windows commands, but the fact that almost every Windows path has spaces in it can cause problems for unsuspecting scripters that don't take this corner case into account.
Having a space in a path is fully allowed in Linux, but some scripts just don't handle it properly.
If the command that is failing is a shell script, trying starting it with:
bash -x /usr/local/bin/b4a
Or even start WSL with wsl ~ -e bash -x to see all trace output from the shell.
In this case, you'll be looking for some problem in the script right around where it actually fails.
If all else fails, you can disable WSL's PATH modification via its config file:
sudo -e /etc/wsl.conf
Add the following:
[interop]
appendWindowsPath = false
Then exit Debian, run wsl --shutdown and restart Debian. Try the b4a command again.
If this works, then the problem is almost certainly due to some problem in the PATH quoting in these commands. I don't recommend it as a permanent solution since you will have to type out the full path of Windows applications each time you want to run them.

after installing node, node is not detected when first open terminal

i install node in zsh terminal.. node sucessfully installed
but to use it i have to switch in bash terminal then switch again to zsh terminal
i dont know why this happen.
beside solution can you tell me whats happening in background
i expect to use node without switch between bash first and switch again to zsh
Since you haven't mentioned how you installed node and what all steps you've tried, my hunch is that the config isn't loaded in your zsh session.
Could you try to reload your zsh config?
Try this command in zsh terminal:
exec $SHELL -l
Judging by what you mentioned, it looks like node is installed in your system and is in the path as well, but the terminal config isn't loaded.
If this command doesn't solve the issue, I'd suggest:
Quit all the instances of the terminal and then open a fresh terminal
and try.
Try to reboot your system (if you haven't already) and try once.
P.S: I'm not entirely sure what you mean by "i install node in zsh terminal". How did you set it up so that it only works in zsh and not the bash one?

Error building a script for linux

I'm trying to build a script for linux to help me each time I install linux from scratch.
The Script have to 1.- Add repositories 2.- Install software from those repositories.
Adding repositories are not the problem, the problem is when i try to install software from this repo.
For the Repo:
sudo add-apt-repository -y ppa:webupd8team/java
After that, the script should make an update, so:
sudo apt-get update
It looks simple, but is not, because I receive an error:
The command Update could not be found.
And so on the rest of the softwares
apt-get -y install oracle-java8-installer
The package oracle-java8-installer couldn't be found..
I really don't know what should I do, nothing looks to work, I gave full rigths to the file and so on... always the same error.
But if I run the command apt-get install direct from the terminal, works without problem..
Any help?
actually I wrote a script in windows to use it in future Linux installations, for some reasons it doesn't work as I want it. Thinking it was a command or misspelled words, I search for a solution, wich didn't help anyways.
Debugging my script in a virtual Machine, I found that the script was giving some random errors like '/r' doesn't support and like that. Really weird because after searching in my script for that line code I didn't find it.
With that in mind, I search again for those errors, and found that for some reasons, if you write your code in a Windows maschine, it save it in a crlf type, wich in a Linux system is interpreted really wrong.
A solution of some users was converting the type from CRLF to LF, wich in linux is using the command dos2unix.
dos2unix filename.sh
After making that and runing my script again everything works perfectly.

no linux command found after installing jdk1.8 on redhat distribution?

After i installed correctly jdk1.8.0 on my redhat distribution and restarted my computer, no linux command is found anymore! the last step i did in the installation of jdk1.8.0 was to write these variables in /etc/environment as it's mentionned in a link which by the way i followed to install jdk1.8.0 :
export JAVA_HOME=/opt/jdk1.8.0_121
export JRE_HOME=/opt/jdk1.8.0_121/jre
export PATH=$PATH:/opt/jdk1.8.0_121/bin:/opt/jdk1.8.0_121/jre/bin
when the day after i started my machine, i do "dir" or "ls" or "vi" or whatever else;
bash dir: command not found
bash vi: command not found
I read in the net that i've messed a path, but no solution is suggested. so how could i fix this problem ? Thank you for your help.

-System-Product-Name:~$ In Ubundu

I Installed Ubuntu 14-04 LTS. I tried to install software's using Terminal.Each time Software Installation successful but after installation it always diSlays one command which is '-System-Product-Name:~$ '.I applied many this like my computer name etc.But not yet success.
I am new in Linux platform.Anyone aware solution for the same please help me.Thanks In advance
Add the following line to .bashrc file in your /home/your-username folder
export PS1="\[\e[0;32m\]\u#\h:\e[m\] \[\e[1;34m\]\w$\e[0m "
execute the command
source .bashrc
Then read
http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
System-Product-Name is the default hostname.
To change it, you can run sudo nano /etc/hostname, modify it with something like yourname-desktop

Resources