Posts: 121
Threads: 26
Joined: Oct 2017
Reputation:
0
don't know ... mine working well ... whats the directory you are trying to get ls from ... maybe you are asking without giving root permission
Just Installed Linux lite??? check
this tutorial
Have I Helped? Click [Thanks] button to the right.
Yours,
Mohammed Khaled
Posts: 76
Threads: 30
Joined: Jul 2016
Reputation:
0
(11-06-2017, 09:02 PM)Moltke link Wrote: I wanted to list files/folders in a directory with and got this Code:
ls: unrecognized option «--color [»
Why am I seeing this?
Often there are predefined aliases. For Example in my system there are for example those aliases:
Code:
alias cd..='cd ..'
alias c~='cd ~'
alias la='ls -a | grep '\''^\.'\'' | column'
alias ls='ls --color'
In many cases those aliases are defined in the file "[tt]home/USERNAME/.bashrc[/tt]" or in "[tt]/home/USERNAME/.bash_aliases[/tt]". (Of course you have to replace "USERNAME" by your account name.)
In my opinion there might be a typo in the definition of the alias for "ls". You might test it by typing:
Code:
alias ls='ls --color:always'
ls
If now you get no error message as before, it should be a typo in the alias definition.
But to make this change permanent you have to edit the file ".bashrc" (or ".bash_aliases"), in which the alias is wrong defined.
HTH
"Show up on time, know your lines, and don't bump into the furniture."
(This post was last modified: 11-06-2017, 09:39 PM by
JohnD.)
Posts: 76
Threads: 30
Joined: Jul 2016
Reputation:
0
(11-06-2017, 09:36 PM)Moltke link Wrote: Quote:Often there are predefined aliases. [...]
By predefined you mean predefine "by user" or "by the system"? I could use ls command before without any issues whatsoever and I haven't created any aliases for it.
In my opinion they are defined by the maintainers of a distribution. But by the way: There is an older thread on this topic in the web:
superuser.com/questions/1145543/unable-to-use-ls-command-in-linux
They also suppose, it might be a wrong alias definition.
You might use the followong command to find a file, in which the alias for ls is defined:
Code:
grep --files-with-matches -e "alias ls=" ~/.bashrc ~/.bash_aliases ~/*profile /etc/*profile 2>/dev/null
"Show up on time, know your lines, and don't bump into the furniture."
(This post was last modified: 11-06-2017, 09:54 PM by
JohnD.)
Posts: 76
Threads: 30
Joined: Jul 2016
Reputation:
0
(11-06-2017, 09:55 PM)Moltke link Wrote: I simply had to run and that did the trick.
You might have the problem, that the wrong alias definition is again there, if you restart your system, because it might be defined in a file, which will be read at system start or if you open a shell.
"Show up on time, know your lines, and don't bump into the furniture."
Posts: 1,133
Threads: 87
Joined: Sep 2017
Reputation:
0
I just did it; I deleted those lines in my .bashrc file, restarted the pc and it's working fine. By the way, when I was checking the .bashrc file I found what caused the problem; few days ago I tried this app called "hollywood" which is a "hacker terminal emulator" making you terminal look as if you were doing some "hacker stuff" I wanted to pull a prank on my wife like "oh look I'm hacking you" ::) but it was a total waste of my time so I removed it, the thing's I saw some lines referring to it which I deleted as well. Guess the prank was on me ;D
Without each others help there ain't no hope for us :)
Need a translation service?
https://www.deepl.com/es/translator