Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

UNIX What is UNIX?


May 23, 2021 UNIX Getting started


Table of contents


What is UNIX?

The UNIX operating system is a series of programs that connect computers to users.

A computer program that allocates system resources and coordinates all the details within a computer is called an operating system or kernel.

The user communicates through a program kernel called a shell. T he shell is a command-line interpreter; It converts user-entered commands and converts them into a language that the kernel can understand.

  • UNIX was originally developed in 1969 by a team of people at Bell Labs, including Ken Thompson, Dennis Ritchie, Douglas McIlroy and Joe Ossanna.
  • There are various UNIX variants on the market. E xamples include Solaris Unix, AIX, HP Unix and BSD. Linux is also popular for free UNIX.
  • Many people can use UNIX computers at the same time;
  • Users can also run multiple programs at the same time;

UNIX architecture

Here is a basic block diagram of the UNIX system:

UNIX What is UNIX?

The main concepts that summarize all versions of UNIX contain four basic elements:

  • Kernel: The kernel is the core of the operating system. It interacts with hardware and most tasks like memory management task scheduling and file management.
  • Shell: The shell is the utility used to process your request. W hen you type a command in your terminal, shell interprets the command and calls the program you want. S hell uses all commands for standard syntax. C Shell, Bourne Shell, and Korn Shell are the most famous shells and are suitable for most UNIX variants.
  • Commands and utilities: There are a variety of commands and utilities available to you. cp, mv, cat, grep, etc. are several examples of commands and utilities. T here are more than 250 standard commands, plus other commands provided through third-party software. All commands are followed by a variety of optional options.
  • Files and directories: All data in UNIX is organized into a file. A ll files are organized into directories. These directories are organized into a tree structure called a file system.

The system starts

If you have a computer with the UNIX operating system installed, then you just need to power it on and make it run.

As soon as you turn on the power, the system starts to start, and finally it prompts you to log on to the system, log on to the system and use it for your day-to-day activities.

Land at UNIX

When you first connect to a UNIX system, you'll usually see the following tips:

    login:

Login

  • Have your username (user ID) and password ready. If you don't have these, contact your system administrator.
  • Under the sign-in prompt, type your username and press ENTER. Your user id is case sensitive, so make sure that the id you typed is assigned by your system administrator.
  • Under the password prompt, type your password and press ENTER. Your password is also case sensitive.
  • If you provide the correct user iD and password, you will be allowed to enter the system. The information echoed on the screen is shown in the following image.
    login : amrood
    amrood's password:
    Last login: Sun Jun 14 09:32:32 2009 from 62.61.164.73
    $

You'll be provided with (sometimes called a $ prompt) with a command prompt, and you can type all your commands below. For example, to check your calendar, you need to type the cal command, as follows:

    $ cal
     June 2009
    Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
     7  8  9 10 11 12 13
    14 15 16 17 18 19 20
    21 22 23 24 25 26 27
    28 29 30

    $

Change the password

All UNIX systems require a password to ensure the security of your files and data, a constraint that protects your files from hackers. Here are the steps to change your password:

  1. To begin, type passwd at the command prompt as follows.

  2. Please enter your old password, which is the one you are currently using.

  3. Enter your new password. A lways keep your password complex enough that no one can guess it. But only if you remember.

  4. You will need to type the password again to verify the password.
    $ passwd
    Changing password for amrood
    (current) Unix password:******
    New UNIX password:*******
    Retype new UNIX password:*******
    passwd: all authentication tokens updated  successfully

    $

Note: I use star ( ) to tell you that's where you entered the current password and the new password, which don't appear directly when you type characters, but instead replace them with numbers.

List directories and files

All data in UNIX is organized into files. A ll files are organized into directories. These directories are organized into a tree structure called a file system.

You can use the ls command to list all files or directories in the directory. The following is an example of using the ls command with the -l option.

    $ ls -l
    total 19621
    drwxrwxr-x  2 amrood amrood  4096 Dec 25 09:59 uml
    -rw-rw-r--  1 amrood amrood  5341 Dec 25 08:38 uml.jpg
    drwxr-xr-x  2 amrood amrood  4096 Feb 15  2006 univ
    drwxr-xr-x  2 root   root4096 Dec  9  2007 urlspedia
    -rw-r--r--  1 root   root  276480 Dec  9  2007 urlspedia.tar
    drwxr-xr-x  8 root   root4096 Nov 25  2007 usr
    -rwxr-xr-x  1 root   root3192 Nov 25  2007 webthumb.php
    -rw-rw-r--  1 amrood amrood 20480 Nov 25  2007 webthumb.tar
    -rw-rw-r--  1 amrood amrood  5654 Aug  9  2007 yourfile.mid
    -rw-rw-r--  1 amrood amrood166255 Aug  9  2007 yourfile.swf

    $

The directory is represented here, beginning with d... For example, uml, univ, and urlspedia are directories, and the rest are files.

Who are you?

When you log on to the system, you may want to know: Who I am ?

The easiest way to find out who you are is to enter the whoami command:

    $ whoami
     amrood

    $

Give it a try on your system. T his command lists the account names associated with the current login. You can try the who am i command to get information about yourself.

Who's signed in?

Sometimes you may want to know who logs on to the computer at the same time.

Here are three commands that you can use to get this information based on how much you want to know about other users: users, who, and w.

    $ users
     amrood bablu qadir

    $ who
    amrood ttyp0 Oct 8 14:10 (limbo)
    bablu  ttyp2 Oct 4 09:08 (calliope)
    qadir  ttyp4 Oct 8 12:09 (dent)

    $

Try the w command on your system to check the output. This lists some more information associated with the user recorded in the system.

Log out

When you finish your session, you need to log out of your system and make sure no one else pretends to be you to access your files.

Log out the method

  1. Simply type the logout command at the command prompt and the system cleans everything up and disconnects

The system shuts down

The most consistent way to shut down a UNIX system is to correctly use one of the following commands from the command line:

Command Describe
halt Shut down the system immediately.
init 0 Use predefined scripts to synchronize and clean up your system before shuting down.
init 6 Restart the system after it is completely shut down, and then back it up completely
poweroff Turn off the system automatically by powering off.
reboot Restart
shutdown Shutdown

You typically need a super user or root (the most privileged account on a UNIX system) to shut down the system, but on some unIX machines owned by individuals or individuals, administrator users can do so even regular users.