Solved

directory problem in redhat 9

Posted on 2004-04-11
17
590 Views
Last Modified: 2010-04-22
Hi

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
0
Comment
Question by:lomaree
  • 9
  • 6
  • 2
17 Comments
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10800757
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?

-Karl
0
 
LVL 1

Author Comment

by:lomaree
ID: 10801783
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).
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10806395
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

insert:

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

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):
http://www.tldp.org/LDP/abs/html/sample-bashrc.html

here is a sample .bash_profile:
http://www.karlwilbur.net/linux/howto/bash/sample-bash_profile.html

Hope this does the trick, keep us updated.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10807776
> i mean that when i login ..
where do you log in? with X?
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10807872
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.
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10807915
Sorry ahoffmann, I didn't read who posted the comment.  I though your question was from lomaree.

-Karl
0
 
LVL 1

Author Comment

by:lomaree
ID: 10810681
my /root/.bash_profile is like this


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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH
alias ls='ls'
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10810686
change

alias ls='ls'

to

alias ls='ls --color=auto'
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:lomaree
ID: 10810690
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
fi
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10810700
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'

0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10810711
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.

-Karl
0
 
LVL 1

Author Comment

by:lomaree
ID: 10810725
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.
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10810740
You see nothing?  no files, no directories?

try

ls -la

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

source ~/.bash_profile

-Karl
0
 
LVL 1

Author Comment

by:lomaree
ID: 10810753
what do you mean other alias command for ls ???
0
 
LVL 1

Author Comment

by:lomaree
ID: 10810759
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
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 10810764
alias ls='ls --color=auto'
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 125 total points
ID: 10812143
> alias ls='ls'
grrr, please get rid of any alias which aliases basic system commands (ls, rm, mv, cd, etc. etc.)
Belief me, this is BS !
and may cause a lot of problems, unless you know 300% what are you doing and how it works.

Also, please tell us which user (root, any other) has the ls problems on which login (console, X, rlogin, ssh).

I also recommend that you get rid of all ~/.bash* and ~/.profile for user root, until your account works with the system settings (from /etc). Then you can slihgly begin to design your own settings. Take care that bash keeps all its dragons there (~/.bash*) secret, until you find them yourself ;-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now