answersLogoWhite

0

📱

Unix

Unix is a family of operating systems primarily designed for servers, mainframes, and high-end workstations. First created in 1969, Unix systems are renowned for their security and stability.

1,127 Questions

Write a shell script to check whether the given input is prime or not?

shell script for check whether the given no is prime or not??

echo "input any number:"

read no

no=`expr $no`

i=`expr 2`

while [ $i -lt $no ]

do

if [ `expr $no % $i` -eq 0];

then

echo "$no is not a prime no.."

break 2

fi

i=`expr $i +1`

done

if [ $i -eq $no ];

then

echo "$no is a PRIME no..."

fi

What is the difference between echo and printf command of UNIX?

Echo merely repeats its command line arguments as stated. The 'printf' command allows for formatted print and a more exacting method of printing out information. Printf requires you to specify the format of what you want to print; echo does not have this ability.

Where is a users default shell set?

The default user shell is set in the password file as an entry for each account.

What are the advantages and disadvantages of Xenix?

There are no advantages or disadvantages to Xenix, since it has no practical application for use in today's world. Like CP/M or System 1 on the Macintosh, Xenix cannot even be compared properly to modern systems.

How do you yank and paste lines?

The command 'Y' or 'yy' copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively:

Y

2Y

10Y

yG

To paste the text contained in the buffer above (uppercase P) or below the current cursor position (lowercase p), respectively:

P

p

It is also possible to yank text within a line. The following commands yank text from the current cursor position to the end of the word and the end of the line, respectively:

yw

y$

The same commands paste the text within a line. Lower case p pastes after the cursor position and upper case P pastes before.

Paste will also work with deleted text, either lines or parts of lines. Be careful not to execute any other commands prior to pasting as this will empty the buffer.

You are working on an AIX system and trying to copy a file to a filesystem The error is A file cannot be larger than the value set by ulimit How can you correct that?

Check your limits on your account and shell by using ulimit -a. You may be able to set the value higher, but in some cases it is limited by the system administrator, so you may want to talk to them about the limitation.

A computer that runs UNIX can be classified as a PC?

PC means: "Personal computer"

If it's your PC it doesn't matter what OS you install. It's still a PC.

What is the difference between a job and a process?

a system lets use A Operating system as a sample. a operating system is the system you'r running on your Computer.

i coul'd be Windows Xp, Windows Vista, Windows 7, Linux, Mac etc.

a process is something your comupter is working on. lets use internet explorer or the internet as a sample. when you are going to a web site you see a line on the button on the screen it is normal blue, but it can be other coloras to. the blue line is cal'd the "ProgsessBar" and is showing how much your computer has loaded of this site and how much is left.

so the difference between system and a process is BIG

Why do the 'whatis whatis' and 'apropos whatis' commands have the same result in UNIX?

  • "whatis" displays the one line manual page description for its argument
  • "apropos" searches all the manual pages titles and descriptions for the argument and will list the one line manual page description for all the matching entries it finds.

Therefore "apropos whatis" will find only one matching man page and will report the same information as "whatis whatis" command.

Unix supports DOS commands or not?

Most of MS-DOS' commands were based on those of Unix and CP/M. 'cd', 'dir', 'clear', and 'echo' are usually found in both. MS-DOS added it's own commands, however, and made some different from those of existing versions of Unix, and no one saw any reason to change the names of existing ones in Unix.

Difference between perl scripting and shell scripting?

Perl is a scripting language. It is not, however, a shell scripting language because Perl is not a shell program. A shell program is one that usually interacts with a user and provides certain user interface abilities. Perl was not designed for that purpose.

You can certainly program a shell to operate in various fashions. A shell script is usually provided for redundant tasks and series of commands, unattended operation, and so forth.

Perl is a "kitchen sink" of ways to interact with data, databases, networks, and so forth. It is a great language for manipulating text in various ways.

The syntax of command statement in UNIX 10. If the permission for a file is 000then the file can be accessed by whom?

Your question doesn't make a lot of sense, but if the permission is 000 none of the access bits are set and nobody can access the file. However, the root user is "special" in many ways, and depending on the implementation it's possible that root can access it (root can certainly change the permissions to allow him- or herself to access it).

How would you create a user named John Doe who has the user name jd and who belongs to group 65535 from the command line?

The exact command varies with different Unix or Linux systems, but usually it looks like:

adduser --home /home/jd --shell /bin/bash --group 65535 jd

Check the adduser command on your system for exact details.

What is the operational definition of a shell?

A shell program is the interface between the user (environment) and the operating system (kernel). It allows users to specify commands and requests the operating system to execute them.

What happens if user create a directory same name as root in unix?

It can't be exactly the same name as root; directories in Unix have to be unique, and therefore you can't duplicate the name.

What is a absolute pathname?

An absolute pathname, is the location of a filesystem object relative to the root directory.

absolute pathnames always begin with a slash (/).

With Absolute pathname you have access to complete file system objects such as directories and files.

How do you place a call to a command line executable within a PHP script?

Use the "system" function: system("Command.exe"); (See: php.net/system)

What is interprocess communication in UNIX?

Interprocess communication allows one process to send or receive a message to or from another process. Normally, in Unix, processes are in a separate address space and cannot exchange information. With interprocess communication, they are allowed to exchange information to each other.

What is purpose of command ping?

ping is a test command. It sends a "ping" to a specified IP which should ACK back, when the ACK is received the message turnaround time is calculated. If the IP fails to respond it times out and reports failure. You can use this command to verify network connectivity, etc.

What is the output of the command 'echo shell shell'?

The output would be 'shell shell' (without the quotes, of course)