What is the output of the command file file in unix?
Assuming you had a file called 'file' in the current working directory it would try to guess what type of file it is, based on its contents.
Why shell is called command processor?
A shell program is called a command processor because it has to process commands according to what the user wishes to do. Along with executing commands as specified by the user it also has its own programming language and can be instructed to do things programmatically.
How do you find out which port is being used by which process in a Unix environment?
There is one general command for the UNIX (actual UNIX not Linux) which will yield which port is being used by what service: lsof -i
For Linux it is: netstat
For more information for either command, please see these sources:
lsof http://www-uxsup.csx.cam.ac.UK/security/lsof.HTML
netstat http://www-uxsup.csx.cam.ac.UK/security/netstat.HTML
Additional :
'netstat' is a standard tcp/ip utility, so it will work on all platforms using tcp/ip, including windows.
How do you change the owner of a file in Unix?
You use the 'chown' command. You must be the owner of the file to do this or the super-user to change ownership.
How do you enter to a file in unix?
Not sure what you mean by enter a file; you could use an editor, such as vi, emacs, nano, pine, etc. to edit it.
The data blocks of a very large file in the Unix file system are allocated using?
an extensioin of indexed allocation
How does a child process becomes a zombie process?
A zombie (or defunct) process is one that has ended but for whatever reason the process information has not been removed from the process table. No code or data segments are allocated to the process anymore but the system has not removed it from the process list, so it appears to be still in the system (but isn't because it doesn't have any resources).
In the past the only way to get rid of zombie processes was to reboot the system to restore the system proc table. It is possible to try and get a parent process to execute a 'wait' system call to try and remove it - see related links.
Why UNIX commands are divided into internal and external commands?
An internal command is one that is built in to the shell interpreter and is likely to be used quite a bit.
An external command is a file in a directory that can be searched, loaded, and executed.
The reason for having internal commands is for performance; it takes a lot less time to have the shell just execute the given internal command than it would take to find it on the system, load it into memory, and then execute it.
What is an AIX server used for?
AIX is the commercial Unix product produced by IBM. Since it is a server system, you could use it for anything that would require server services, such as Internet services, web services, e-mail services, file services, etc.
AIX in a server mode is no different than other servers in terms of offering resources to be used by other clients.
What is the one that does not belong between Linux Unix Solaris and D SQL sever?
LINUX, UNIX, SOLARIS are the UNIX based operating system.
SQL SERVER is a database system from IBM.
Solaris 9 is no longer available for purchase or download from Sun Microssystems. You may be able to purchase a used license from other online retailers or on eBay.
DSGET
What is the output of ls wc -l command?
wc -l filename It will return no of lines in the provided file. wc stands for word count.
The 'ps' command without arguments will give a summary of those processes running in the current environment.
Shell script in unix to check if a string is a palindrome?
len=0
i=1
echo -n "Enter a String: "
read str
len=`echo $str | wc -c`
len=`expr $len - 1`
halfLen=`expr $len / 2`
while [ $i -le $halfLen ]
do
c1=`echo $str|cut -c$i`
c2=`echo $str|cut -c$len`
if [ $c1 != $c2 ] ; then
echo "string is not palindrome"
exit
fi
i=`expr $i + 1`
len=`expr $len - 1`
done
echo "String is Palindrome"
Which is better to learn Linux or Unix?
Linux is far more common these days than traditional Unix. But as any old system administrator will tell you, learn to learn, don't learn the system. There are numerous differences between the different Linux distros, differences between Linux and Unix, and differences between each of the Unices. Learning everything about each system is a daunting task, and probably near impossible. Rather than, say, learning all of the different command line switches for "ls" on each system, just know how to access a man page.
How is c-programming so different and powerful in the UNIX environment compared to windows?
Hard to say this is a true or false statement; the C language is the same on both platforms; only the API/System calls vary. Since they do similar things it would be almost impossible to say one system is more powerful than another in terms of a programming language that is common to both.
What are the invisible files in unix?
No files are actually "invisible." However, certain files may not be displayed by default as a convenience to the user. These are setting / configuration files for programs in the user's directory.
Where might one go to read the Southern Daily Echo?
One could go read the Southern Daily Echo on their website at Daily Echo. It is owned by one of the biggest publishing companies in the United Kingdom.
How do you compress a folder in AIX?
The usual approach is to create a 'tar' file first of the directory and then compress the tar file. This is also safer because it leaves the original directory intact.
Use tr:
cat file | tr '[:upper:]' '[:lower:]'
What is the command to fetch first 10 records in a file in unix?
At the prompt, type:
head filename
For example, if you have a file named file.txt, type:
head file.txt
To fetch a specific number of records from a file, e.g. 15, type:
head -15 file.txt
To see more options of 'head' command run 'man head'.
#include
#include
#include
int main(int argc, char *argv[])
{
int process = 1;
int child[2];
int numChilds = 0;
int state;
int depth;
assert(argc 0)
{
numChilds = 0 ;
procId *= 2 ;
if (! --depth)
exit(0);
}
else
{
numChilds++ ;
process++ ;
}
}
while (numChilds) wait(&state);
}
Solaris is a UNIX operating system developed by Sun Microsystems.