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 if you are root or not?

[ $UID -ne 0] # Checks if the user ID is not 0 (root UID)

Write a shell program using the if-the-else to test whether a variable name is a directory or a file?

# shell script example

if [ -f $1 ]; then

echo $1 is a file

elsif [ -d $1 ]; then

echo $1 is a directory

fi

What is the difference between trial version and old versions of a product?

An old version is just what the name says: an old version, no longer up-to-date. Old versions are typically no longer maintained or supported by the manufacturer, although different industries and manufacturers handle this differently. For example, a washing machine manufacturer will continue supporting an old model for a number of years after its replacement with a more recent model. "Continue supporting" in this context means the retail of spare parts, the supply of repair and diagnostics services, etc. Software products, on the other hand, are often only supported in the current version, plus maybe one version back in the revision history. Exceptions exist with high-value software and foundation software, such as Microsoft's operating systems. Old version products are typically not on sale any more. A trial version is typically only available with software products. Trial versions come at reduced cost, often free, but are typically limited in features or in time. The purpose of a trial version is to allow the future buyer to evaluate the product prior to making a purchase.

How do you set the date in Solaris?

The date and time are set in most Unix systems with the 'date' command. The exact syntax can vary, in which case you can find out by using the 'man date' command.

Note: you have to be a root level user to issue this command to change the date or time.

What command could you use to change the owner to bob and the group owner to acctg for the file etc yearend?

This is accomplished via two different commands; the sequence would be:

chown bob /etc/yearend

chgrp acctg /etc/yearend

What is the conceptual difference between the lp and lpr commands in Unix?

lpr is the off-line printer...

lp is just a frontend to the lpr. (that is in FreeBSD, maybe is the same in Sun Solaris), out put from man lp(1):

LP(1) FreeBSD General Commands Manual LP(1)

NAME

lp -- front-end to the print spooler

SYNOPSIS

lp [ -cs ] [ -o option ] [ -dprinter ] [ -n num ] [ name ... ]

DESCRIPTION

The lp utility is a front-end to the print spooler as required by the

IEEE Std 1003.2 (``POSIX.2'') specification. It effectively invokes

lpr(1) with the proper set of arguments.

How you redirect the output of the perl script into some file using perl script?

If the perl script outputs to the standard output device, use the I/O redirection operators (>, >>, |) to redirect it somewhere else.

How do you see files in home directory in solaris?

Several ways to do this. If you just want to see what the files are, you could use:

ls $HOME

ls ~

ls /home/userid, where userid is your logon account

How insert the text in vi editor?

the text is inputed in vi editor by pressing the i key, that mean get the insert permission into vi editor

What type of hardware does Unix run on?

Unix can be run on a variety of server, mainframe, and workstation devices.

How can you find orphan process on Solaris?

If processes run on nodes that have derailed so to speak or the tm.watched yk has been activated, the process is considered orphaned. The watch deamons are set to kill the orphan process on default.

How can you find out if you have the permission to send a message in UNIX?

%ls -l

if we get output -rw---- then we have permission to send message

Is sort command is a filter in unix?

The answer depends on what you consider a 'filter' program. If you consider a filter program to actually limit (or filter out) certain parts of a file then the sort program would not be considered a filter program, but more of a utility program.

If you consider a filter program to be a program that changes the output in some way but gives the same amount of lines of output that are input then you could consider the sort program a filter.

Most people would probably say that the sort utility program is not a filter, but it can be up to some interpretation.

What is the context switch in UNIX?

Context switching is, as far as I know, essentially the same process in all multi-tasking operating systems.

Simplistically, in order for a multi-tasking operating system to switch tasks on and off a CPU, the operating system must be able to store and restore the state of the CPU for each process that shares that CPU. The act of storing and restoring the CPU state is referred to as context switching.

In a nutshell (an oversimplified nutshell), the states/values of the Instruction Pointer, the registers, accumulator etc. must all be saved for a given process for the OS (Operating System) to move to the next process in the queue. Once they are saved, the states/values of the next process in the queue can be loaded into those same registers etc. and that process can continue execution for 'N' number of instructions. Then this whole procedure is repeated for the next process in the queue. And so on, and so forth, ad infinitum...

Necessarily, MUCH is omitted in the above over simplification but it is hoped, none the less, that the above description provides some very general idea of what happens during a context switch.

The term context switching is a sort of catch all which may refer to and cover a number of more specific processes such as thread context switches, register context switches, task context switches etc.

This answer is necessarily over simplified as a full description of context switching is far beyond the scope deemed acceptable in this forum.

Where form can you download an absolutely free no purchase cost no download cost etc unix not Linux live CD you need it for the sake of learning unix shell scripts etc?

Some of your options are as follows:

Open Solaris. It is based on Sun's Solaris Unix operating system. You can get it from http://opensolaris.org/os/

FreeBSD livecd

http://livecd.sourceforge.net/

However, if your only goal is to learn shell scripting all the Linux/Unix variants use the same shells (usually some version of bash, sh, csh, tcsh, or zsh). The bash shell is the same if ran on Linux, Unix, or even Windows.

What is the definition of execute?

Execute means to perform an action. To execute a turn is to make a turn. To execute a jump, or play, is to actually complete the activity. To execute a computer program is to actually run it on the computer.

Another common use is to mean to kill, either as capital punishment or a murder done in a similarly dispassionate manner.

What operating system was developed in 1969 at AT and Ts bell labs?

Unix was the computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna.

What is difference between Solaris volume manager and Veritas volume manager?

For one, they are programs produced by two different companies.

What is paging system implementation?

The question is not very clear - in general the implementation of paging is too complex to answer in a Wiki answer entry; I suggest you take a look at any Operating System theory book.