Solved

A bunch of SIMPLE admin questions

Posted on 2002-06-27
13
360 Views
Last Modified: 2010-04-20
All of these questions I need answered for a non-graphical command-line driven RHL 7.1 Bash shell.

How do I login to multiple shells in linux?  How do I swap application contexts in linux(like alt-tab in windows)?  How do I open another shell, when my current shell is already performing some action, same as first question only command line isn't available to login to another shell?  How do I see a list of process on my system, 'ps' or 'jobs' doesn't do anything?  Why doesn't the 'netconf' command work on my system (as well as a number of other network commands)?  Ping and Samba seem to work just fine, is it a PATH problem?

Thanks for the help.
0
Comment
Question by:wgilster
  • 5
  • 4
  • 2
  • +2
13 Comments
 
LVL 4

Expert Comment

by:newmang
Comment Utility
I'll try to answer these in turn but some of your questions are a bit ambiguous and may need clarification.

1) I'm not sure what you are getting at here. You have multiple virtual terminals available to you which you can switch between using the Alt and F1 to F6 keys so you can log in on each of these virtual terminals and run different commands on each.

2) You have to run the first command in the background. You do this by adding & to the end of the command (such as gzip foo.bar &) You can do this any number of times, you can check on the state of your background jobs with the jobs command and you can bring any background job back to the foreground by using the fg %x command where x is the job number returned by the jobs command.

3) To see all the jobs on your system use ps -ef as the command, jobs only tells you what jobs you have running in your current shell in background mode (see my previous answer).

4) When you say that netconf doesn't work do you mean the command can't be found or the command doesn't do what you want it to do? What are you trying to do with the netconf command (my Mandrake system - derived from RH) doesn't have a netconf command.... What other network commands fail?

Cheers - Gavin
0
 
LVL 1

Expert Comment

by:bearware
Comment Utility
Also if a command is runing in fourground press ctrl-Z to suspend it, then type bg to put it in background.

If command are not found type:
#> find / -iname "cmd"

Replace cmd with your command name, you can use * as in bash globs (whildcards) but make shour it is in quotes to bash does not expand it (find has to interperate it)

If you fine the files, then check PATH
type:
#> echo $PATH
if a directory is missing try
#> PATH=$PATH:dir
to append a directory
if this works at it to ~/.profile or /etc/profile
but not to the bashrc files

If you dont find them read the manual on RPM. and install them.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
1) login - use rlogin or ssh, then you can suspend them, and start the next login
2) swap application - uspend them (most likely with Ctrl-Z), then use jobs and fg command
3) open another shell - suspend current application (Ctrl-Z), then put in background with bg, then continue in current shell or start a new one with bash, csh, or whatever you like
4) list of processes - ps ax
5) netconf does not work - millions of reasons, please post command and errors
0
 
LVL 1

Expert Comment

by:petereilering
Comment Utility
Alt+F3 starts another bash shell and gives you a new login prompt. alt+F1 switches between shells

Install BBkeys and you can use alt+tab to switch between
applications (ofcourse in graphical enviroment like kde,gnome, etc)

In redhat there is no netconf but there is setup you can use
you have to be root so you must use su - to change to root
user do not forget the - character else you do not have the required path
0
 
LVL 1

Author Comment

by:wgilster
Comment Utility
I think you answered all my questions, but in turn brought up a whole new set of questions.  

I was wrong in saying the ps command doesn't work.  It does.
Linux still doesn't find the jobs command. PATH Statement

In RHL, it's netconfig instead of netconf, I guess.  I had to login as root to get the net commands.  They were in /sbin?

I increased the question points to 70 because I have two more questions.

Where can I find a comprehensive document defining all of the config and script files and when they are read-in or executed?

What is the difference between all of these:
su root
su
login root
login
su myname

0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
most administration commands are in /sbin, which is accessable for root by default

su root
  substitute current user with user root, just changes the effective UID
su
  shortcut for  su root  (usually)
login root
  login as user root (effective and real UID are equal)
login
   ask f0r user to login
su myname
  substitute current user with user myname
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 4

Expert Comment

by:newmang
Comment Utility
Re the su command

If you enter su root (or su followed by any other username) you become that user BUT you retain your current environment. To FULLY become the other user and assume their environment you must add a dash to the command as in su - root or su - foobar

Cheers - Gavin
0
 
LVL 1

Author Comment

by:wgilster
Comment Utility
So then does that mean that
su - myname
is the same as
login myname
or what is the difference between the commands?

Do the login scripts for "myname" run when you
su - myname
If they do run, which scripts run (.bashrc, .profile, /etc/profile.d /etc/profile, /etc/bashrc), and are they concatenated onto the current user's environment, or is there some "base user" environment that the "myname" login scripts modify?

I increased the points again.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
> or what is the difference between the commands?
AFAIK, none.

> Do the login scripts for "myname" run when you su - myname
Yes (see man su)

> .. which scripts run ..
depnends on the shell specified in /etc/passwd, *and* the shell itself, *and* how it is compiled, *and* how it is installed, and probably some more ...

> .. concatenated onto ..
i.g. the system scripts are read first (from /etc usually), then the user's private scripts (from $HOME, usually), but this all also depends on the shell
0
 
LVL 1

Author Comment

by:wgilster
Comment Utility
I do realize that this flexibility is what makes everything so great in Linux.  But to really know whats happening on any given Linux box, it seems like you have to know about every different shell that could exist then decompile the shell and analize the code to see what is going on.  I guess this is an exageration, but really it doesn't seem that administration is straight forward in Linux.  Am I wrong here?
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 85 total points
Comment Utility
> Am I wrong here?
In theory: no. In practice: yes.

Things are simple, and straight forward, for sh and csh.
There it reads /etc/{profile,csh_login,csh_cshrc} then ~/.{profile,login,cshrc}. tcsh follows this way too, but can be improved/configured to behave different.
It's a bit more complicated with ksh (and its variants like pdksh), but i.g. it's like sh.
bash and zsh are the dragons to beat. The default, most commonly used, here is like sh, but it can be completely different. That's why I said you need to know compilation and configuration settings. I'm pedantic, sometimes, somehow ;-)

To summarize:
  i.g. you get a global file from /etc, and a user file from ~ (aka $HOME). That's all, and that's why it is to admin simple.
0
 
LVL 1

Author Comment

by:wgilster
Comment Utility
Obviously, I have a ton more questions beyond the scope of these, but I need to stop.  All of my questions were answered, quite well.
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
obviously there are man-pages, which might answer most of your question. Probably the problem is just to select the right one ;-)
Thanks, and good luck.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

13 Experts available now in Live!

Get 1:1 Help Now