We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


directory problem in redhat 9

lomaree asked
Medium Priority
Last Modified: 2010-04-22

when i login to my redhat 9 box and do "ls -l" it does'nt show me any directory and when i remotely login using ssh and try the following it showes me all the directories and everything works fine. please help me out what's wrong
Watch Question

I am not sure what you mean here.  Are you saying that when you login at the on the console you don't see the directory names, or is it that you see the directory names but the directories are not blue(or whatever color you expect them to be).  What do you see when you login at the console?



i mean that when i login i don't see directory names (blue), but when i login remotely using ssh i can see the directories (blue).
So, you are seeing the directory nemes but they are not blue?

if so, log in from the console and try this:

alias ls='ls --color=auto'

then do your ls -l

if this works, then the following will be a more permanent solution.

Edit you .bash_profile (if not there, create it):

vi ~/.bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
      . ~/.bashrc

then edit .bashrc (if not there, create it):

and add the previous alias command here, verbatim.  

You can really add it anywhere in the file but you should read up on .bash_profile and .bashrc for prefered placement.

Here is a sample .bashrc file from The Linux Documentation Project's site (may be a little complicated for you, or maybe not):

here is a sample .bash_profile:

Hope this does the trick, keep us updated.
> i mean that when i login ..
where do you log in? with X?
Sure, you could login with X then open a terminal window or if you've set up your systen so that X doesn't start automatically and you get to a text login, you can login there too, without having to start X.  Or if X startd and you don't want to login to X you can hit Ctrl+Alt+(F1-F6) to get any of the 6 VCs (Virtual Consoles) that are running on you system and login there.

(Once you have escaped X using Ctrl+Alt+F(1-6), you can switch between VCs by Alt+F(1-6) since there is no need to use the Ctrl key any more...or maybe it's the other way around and you use Crtl to switch and don't need Alt anymore...you can fugure it out.)

If you use Ctrl+Alt+(F1-F6) to get to a VC and want to get back to X, it's running on VC7 (Alt+F7).

Anyway, just get to a command line.

In vi (the text editor that I mention above...because I really like it since I am very familiar with it) you hit "i" to change into "insert mode" and when you are finished editing, hit "Esc" to exit "insert mode".  Hit ":" to get a vi command line and type "w" to write(save) and "q" to quit.  cOmmAnds ArE cAsE sEnsItIvE.
Sorry ahoffmann, I didn't read who posted the comment.  I though your question was from lomaree.



my /root/.bash_profile is like this

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc

# User specific environment and startup programs


alias ls='ls'

alias ls='ls'


alias ls='ls --color=auto'


and my /root/.bashrc looks like this where as the link you gave me for it looks a very different

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
IN that link, there was a _lot_ more stuff.  Yours is fine.  The alias commands should really be in just on fiole.  I think that .bashrc is the preferred.  So, you can delete the alias command from .bash_[rpfile and enter this in the .bashrc just below the others.

alias ls='ls --color=auto'

Sorry about all of that.   I am typing in the dark.  I'll try again.

To keep the alias commands in the .bashrc file, delete the alias command for ls from .bash_profile and add the other alias command for ls to the .bashrc file.



i tried doing that, but as soon as i do and re login in the machine and use "ls -l" , i can't see nothing.
You see nothing?  no files, no directories?


ls -la

for future, you don't have to logout to reload a changed .bash_profile, just type

source ~/.bash_profile



what do you mean other alias command for ls ???


yeah i can't see any directories that is cuz by default there are in color blue and i can't see blue (hope you understood my problem) i can see files and all
alias ls='ls --color=auto'
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.