HI guys,
I'm not usually a UNIX scripter, but I have a few things that I need to get done here. I've looked at a few books, and read a few websites but I cant seem to help myself out. I'm trying to write some scripts, and these two are giving me problems.
1. I need to write a shell script that attempts to output all of the running instances of the program, displaying name of the user, terminal, pid, and start time when the program was first run.
I know this has something to do with the "ps" command. I can get it so I can see how many instances are running by using this :
ps -C bash #this will show me all the instances of
#the bash shell running on the machine.
I cant get it to show me the other info, such as the username.
Problem #2.
I need to find out how many different file types there are in a a given directory (and then go thru all of its subdirectories).. So if I have multiple directories in on main directory, I need to get all the types of file names.
I know this has something to do with
ls -lR
Then I must also find the directory structure. How do I do that?
Thanx for any help!!
-shorty
I'm not usually a UNIX scripter, but I have a few things that I need to get done here. I've looked at a few books, and read a few websites but I cant seem to help myself out. I'm trying to write some scripts, and these two are giving me problems.
1. I need to write a shell script that attempts to output all of the running instances of the program, displaying name of the user, terminal, pid, and start time when the program was first run.
I know this has something to do with the "ps" command. I can get it so I can see how many instances are running by using this :
ps -C bash #this will show me all the instances of
#the bash shell running on the machine.
I cant get it to show me the other info, such as the username.
Problem #2.
I need to find out how many different file types there are in a a given directory (and then go thru all of its subdirectories).. So if I have multiple directories in on main directory, I need to get all the types of file names.
I know this has something to do with
ls -lR
Then I must also find the directory structure. How do I do that?
Thanx for any help!!
-shorty