Closed RayCxggg closed 9 months ago
Some add up here. After I typed rm bash
, I tried tab
to complete the line for rm bash_profile
and remove the wrong bash_profile
file. However, it printed out the same error again.
Can you paste the result of the following command?
$ ls -l /dev/null* | cat -v
Here is the output:
root@LAPTOP-LTLGK41V:~# ls -l /dev/null* | cat -v
-bash: /dev/null: cannot overwrite existing file
-bash: /dev/null: cannot overwrite existing file
-rw-r--r-- 1 root root 0 Sep 26 12:35 /dev/null
-rw-r--r-- 1 root root 136 Sep 25 15:09 /dev/null.old
The file /dev/null
in your seems to be replaced by a regular file. The file /dev/null
should be a character device and the result of ls -l /dev/null should look the following (this is the result in my Ubuntu 20.04/WSL2):
$ ls -l /dev/null*
crw-r--r-- 1 root root 1, 3 2023-09-26 19:33:14 /dev/null
Could you try solutions in the answers in the following Q&A?
Thanks a lot. It perfectly solved the problem. BTW, I am just curious that how /dev/null
was changed into a regular file?
Great!
BTW, I am just curious that how
/dev/null
was changed into a regular file?
Hmm, I don't have an idea. Since we haven't seen other reports to Oh-My-Bash (OMB), I guess it is not caused by OMB. In the past, Bash 4.2 had a bug where /dev/null
was removed from the file system when HISTFILE=/dev/null
was specified. It might be caused by a similar bug in a certain program.
The issue is that maybe you tried to copy or to move a file to /dev/null. /dev/null is not a folder, it is a special file. And when a file is moved to /dev/null, it breaks its properties.
Hi, I am working on Ubuntu 20.04 with WSL2.
After I install oh-my-bash, it works well for a while. Then when I start a new terminal, it prints![6264f7f6d31d67fb604804fda747a29](https://github.com/ohmybash/oh-my-bash/assets/63034168/72201145-69bc-48a9-94dd-3ab17d4608f0)
It seems that some lines in the
.bashrc
triggered the problem. The normal functions of bash seem fine so far.This is my
.bash_profile
:I have only changed the
OSH_THEME
field and added a fewexport PATH=
lines at the end of.bashrc
. Those lines worked fine in my old.bashrc
file. Please help me figure out what is wrong. Thanks!