What is "Environment variable" in unix and what is command for set environment variables? What is command for list Processes with the highest CPU usage? What is command To Move Background job that has been suspended? What is command for to check disk space? How to find out what program is running now in unix?

Showing Answers 1 - 12 of 12 Answers

George V J

  • Nov 21st, 2006
 

Hai,

First , its not "Enviranment variable" , its "Environment variables". And, I suppose you are using any LINUX version.

1. Environment variables are system parameters set by either OS or the users themselves. For example, a variable "PATH" will set the search path for executables. It can be explained as follows.

Suppose the variable `PATH` has been set as "/bin:/usr/bin:/usr/local/bin". When you type the command "clear", system will search inside these directories for any executable files called "clear" if it is there, it will be executed, if it was not found inside these directories , it will simply tell you an error message something like "sh:clear:command not found" and exit.

Similiarly, the variable "PS1" will set the shell prompt of a user . The command for setting an environment variable depends upon the OS version and the shell which you are using. it is " export " for most standard shell types in unix and LINIX. "setenv" is used in "C Shell". eg; the command "export PS1=George.."   will set your shell prompt like ;

George..

2.What is command for list Processes with the heighest CPU usage?

ps -eaf --sort=%cpu ( Descending order )

3.What is command To Move Background job that has been suspended?

 "fg %1" will move most recently suspended job from background to foreground.If you want to move the next job in the list, try "fg %2" . You can see a list of jobs running or suspended in the background by running "jobs" command.

4.what is command for to check disk space?

You can try " df " or "du" in linux. "df -h" will give you more readable output in linux. For a unix system, try "dfspace"

5.How to findout what program is running now in unix?

Unix is a multitasking , multiuser OS, so it is not possible to findout the exact idea you have mentioned . Anyway, you can get a list of all running programs using "ps" , "pstree" or "top" commands , (with their options). Try "ps -eaf | less" in RH LINUX

With Regards,

George V James

B'lore

+91-9980228392

  Was this answer useful?  Yes

sai

  • Nov 23rd, 2006
 

1.what is "Enviranment variable" in unix and what is command for set enviranment variables?

it is a shell variable available during that shell context at shell command level

2.What is command for list Processes with the heighest CPU usage?

top

3.What is command To Move Background job that has been suspended?

bg

4.what is command for to check disk space?

du

5.How to findout what program is running now in unix?

ps -ef

GOURAV SHIVHARE

  • Mar 9th, 2007
 

eagy answer:by GOURAV SHIVHARE

1. Environment variables are system parameters set by either OS or the users themselves. For example, a variable "PATH" will set the search path for executables. It can be explained as follows.

Suppose the variable `PATH` has been set as "/bin:/usr/bin:/usr/local/bin". When you type the command "clear", system will search inside these directories for any executable files called "clear" if it is there, it will be executed, if it was not found inside these directories , it will simply tell you an error message something like "sh:clear:command not found" and exit.

Similiarly, the variable "PS1" will set the shell prompt of a user . The command for setting an environment variable depends upon the OS version and the shell which you are using. it is " export " for most standard shell types in unix and LINIX. "setenv" is used in "C Shell". eg; the command "export PS1=George.."   will set your shell prompt like ;

2.What is command for list Processes with the heighest CPU usage?

ps -eaf --sort=%cpu ( Descending order )

3.What is command To Move Background job that has been suspended?

 "fg %1" will move most recently suspended job from background to foreground.If you want to move the next job in the list, try "fg %2" . You can see a list of jobs running or suspended in the background by running "jobs" command.

4.what is command for to check disk space?

You can try " df " or "du" in linux. "df -h" will give you more readable output in linux. For a unix system, try "dfspace"

5.How to findout what program is running now in unix?

Unix is a multitasking , multiuser OS, so it is not possible to findout the exact idea you have mentioned . Anyway, you can get a list of all running programs using "ps" , "pstree" or "top" commands , (with their options). Try "ps -eaf | less" in RH LINUX





ANSWER BY :GOURAV SHIVHARE

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions