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

Which traversal computes the total size of each directory in the unix system?

You could use the 'du -s' command to get the size of each directory/sub-directory from wherever you are currently in the file system.

Who made Linux unix?

UNIX was created in 1969 by Ken Thompson, Brain Khernighan, and Dennis Ritchie, who at that time were working at AT&T's Bell Laboratories.

Linux was created in 1991 by a Finnish student named Linus Torvalds, just for fun, and is based around the designs of Unix as it had evolved from 1969 to around that year. Fun factoid, around 1991 a lot of Unix researchers were actually experimenting with microkernel designs, so Linus wasn't entirely following the bleeding edge Unix trends of the time when he created the Linux kernel.

What is Unix ls - l?

the "ls" command gives a listing of all the files in the current working directory, "ls" with the -l option gives the listing in vertical format along with file permissions, owner, group, and date when it was last modified. To see a more detailed explanation of the "ls" command and all its options run the command "man ls", man will also work with any other standard Unix/Linux command to give a detailed explanation of its purpose and various options.

Which command is used to display the first four line in unix?

Use the following command:

head -4 filename

Note: this only works on line terminated (newline) text files. The 'filename' can be any file.

Which command in the UNIX equivalent of the Windows command nslookup?

Here is what I was able to do on our local system:

$ uname -a

SunOS <uname -n> 5.9 Generic_122300-25 sun4u sparc SUNW,Sun-Fire-15000

$ /usr/sbin/nslookup <IP-ADDRESS>

*** Can't find server name for address <SERVER_IP1>: Server failed

Server: <F.Q.D.N of SERVER_IP0>

Address: <SERVER_IP0>

nslookup is a standard TCP/IP utility, which exists in both Windows and Unix. You could also use 'dig' as a replacement in Unix.

Which command is used copy and paste in vi editor of UNIX?

The 'yank' and 'put' commands are used to copy and paste lines in a file using 'vi'. Each series of lines that are yanked can be put into a named (or unamed) buffer from a to z and then pasted in the appropriate place in the file.

To actually do this procedure takes more than a simple answer so it is suggested that you search using a internet search engine for examples of how to do that or use the 'man vi' command to see the exact procedure in 'vi'.

What are hidden files and how can they is displayed in UNIX?

A hidden file is any file or directory that starts with the character '.' (period). It is designed to eliminate common files from showing with the 'ls' command.

Using the -a option for 'ls' will show all files.

In unix how will you find extension of file using commands?

Unix files do not rely on extensions, therefore there is no command to find them.

What is the expansion of the abbreviation UNIX?

Unix is not an abbreviation. The name is a play on the Multics operating system. Multics (Multiplexed Information and Computing Service) supported multiple users; Unix originally supported only one, making it essentially a single user version of Multics.


X designates a user's terminal as hosting the server while the application is referred to as the client Does this make sense?

Yes, if you view it from the perspective that the X server is providing the display, rather than the client providing an application.

What is the cost of a Unix server?

The cost depends on whether or not you buy one new or used; it also depends on which Unix you want to run. For used units you can buy one for a few hundred dollars on up.

How do you remove a file from a directory other than the current one in Unix?

By specifying either the absolute or relative path to file.

Example 1 (absolute path; works from anywhere):

rm /etc/shadow

Example 2 (relative patch; will only work if you are in /usr):

rm ./bin/vi

Example 3 (relative path; removing file from home directory, works from anywhere):

rm ~/mystuff/importantfile

What is Daemon Process in unix?

The word daemon is a word of Greek derivation meaning "worker". Daemon processes in Unix are background tasks that do things, such as printing, networking, task scheduling, etc.

Who is the best author for UNIX Operating system book?

This question cannot be answered because it depends on multiple, individual factors, such as what you are looking for, the amount of detail involved, and the writing style of the author. Your best bet is to sample several books on the subject and decide for yourself who is the best for your learning style.

What is the rudest or funniest unix command?

http://www.tbi.univie.ac.at/~ronke/FUN/unix.html You'll have to find that out for yourself.

What are the hardware requirements for Solaris 10?

The requirements that Sun lists for Solaris 10 are slightly inconsistent:

* 2 GB of hard drive space (6 for most popular packages) * 512 MB of RAM (1 GB recommended).The same page also says you need 256 MB to install it, and I personally have run Solaris 10 on 256 MB, so that should be considered the minimum. * CD / DVD drive * network connection (for installing other software).

Shell script to generate that listens to a port over the internet?

You wouldn't use a shell script to do this. Any program could listen on a port by connecting or binding to a socket address. There are some utility languages such as Perl that could connect to a port and listen, but the listening would also be a function of what you are listening for.

Write a shell program to generate the first hundred numbers in the Fibonacci series?

bin

echo "Enter How many numbers:"

read 100

num1=0

num2=1

echo "Fibonacci series:"

echo $num1

echo $num2

count=2

while [ $count -le $num ]

do

num3=`expr $num1 + $num2`

echo $num3

num1=$num2

num2=$num3

count=`expr $count + 1`

done

--------------------------------------

ANSWER:

The above script didn't work at all for me so I wrote this one. That said, the author of the script above appears to be familiar with the subject matter and the challenges involved, but was possibly busy or distracted at the time the answer was written.

NOTE: One obvious omission is the lack of an absolute PATH for the 'shebang' line of the script, it is this which leads me suspect his or her

mind may not have been on the task at hand when the script was written. I believe the author above is experienced at script writing however.

#!/bin/bash

#

## Written by John Horn, June, 2013.

#

# set -x

if [ -z ${1} ]; then

echo "Pass the number of fibonacci numbers you wish generated as the argument to this script."

exit

fi

#

## Decided to add comma insertion every 3rd digit to make the

## output easier to read. Friday the 13th of September, 2013.

## Friday the 13th? That isn't very auspicious. :(

#

## This subroutine inserts a comma every 3rd digit to the arg passed.

#

commify () {

typeset text=${1}

typeset bdot=${text%%.*}

typeset adot=${text#${bdot}}

typeset i commified

(( i = ${#bdot} - 1 ))

while (( i>=3 )) && [[ ${bdot:i-3:1} == [0-9] ]]; do

commified=",${bdot:i-2:3}${commified}"

(( i -= 3))

done

echo "${bdot:0:i+1}${commified}${adot}"

}

#

## Initialize some variables for whatever reason (simplicity maybe).

#

LIMIT=${1}

COUNT=0

N1=0

N2=1

FIBONACCI=0

#

## Might as well just print the first two as they can't possibly

## have any other value than 0 and 1.

#

echo "And our first ${LIMIT} FIBONACCI numbers are...:"

echo "0"

echo "1"

while [ ${COUNT} -le ${LIMIT} ]; do

#

## Fork the 'bc' command to perform the actual addition operation.

#

FIBONACCI=`echo "${N1} + ${N2}"|bc -l`

#

## Call the commify() subroutine to format the integer with commas.

#

COMMA_FORMATTED_RESULT=`commify "${FIBONACCI}"`

#

## Print our latest FIBONACCI number to STDOUT.

#

echo "${COMMA_FORMATTED_RESULT}"

#

## Overwrite our variable contents with our new values.

#

N1=${N2}

N2=${FIBONACCI}

#

## Increment our counter so we'll know when we've reached our $LIMIT.

#

(( COUNT++ ))

done

echo -e "\n\nAll done.\n"

----------------------------

On my Ubuntu Linux 12.04 LTS machine the above script works perfectly. Your

mileage may vary. Good luck!

JMH

Why ProC is used only on Unix and not on Windows?

The /proc file system is used internally by the Unix and Linux operating systems.

Unix and Windows do things differently; Windows uses the registry, which in a sense is what the /proc file system does, but in a different way.

Operating systems are all different; they are free to implement ideas and details in any way they want to.

If you are asking about the Pro*C compiler, that's a different matter.

Where do you find unix source code?

The true Unix source code is copyrighted; it doesn't exist anywhere specifically on the net. If you are interested in how something works in Unix you are better off looking at the Linux source code that accomplishes that task.

What are all the process that are presently running?

The 'ps' command will give you all the currently running processes. Each Unix system may have slightly different options to list them.

The most common would be:

ps -ed

or

ps -ef

or

ps -el

depending on how much information you want to see.

What is a filter in Unix?

A Unix filter is a command pattern that allows the output of one command to be "piped" into the input of the next command.

Commands like 'ls' which list a directory are not filters since they only generate output. Filter examples are grep, sed, sort, uniq, awk.

Commands in Unix are usually filters unless they only create output, like 'ls', 'vi', etc.