Updated-Unix Basics By JBK

Unix Architecture:
  • Here is a basic block diagram of a UNIX system:


  • Kernel:
    The kernel is the heart of the operating system. It interacts with hardware and most of the tasks like memory management, and file management.
  • Shell:
    When you type in a command at your terminal, the shell interprets the command and calls the program that you want. C Shell, Bourne Shell and Korn Shell are most famous shells which are available with most of the Unix variants.
  • Files and Directories:
    All data in UNIX is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the file system.
To change file or directory permissions:









cal, date , time , who , whoami , sort , echo, df, du, ping, logout
  • class : class keyword is used to declare classes in Java
  • #!usr/bin/perl
    				print "Enter your name: ";
    				$ name=;
    				print "Hello, ${name} ... you will soon be a Perl creater!";
    				Save it as hello.pl to a location of your choice.
  • Back at the command prompt, change to the directory where you saved your Perl script.
  • $ cd c:\perl\scripts 
    					$ perl hello.pl 
    you'll be prompted to enter your name.
    Enter your name: Kiran
    Hello, Kiran
    ... you will soon be a Perl creater!
    -e with perl allows you to run code from the command line, instead of having to write your program to a file and then execute it.
    $ perl -e 'print "Hello World\n";'

    Output:
    Hello World
We need to create two files .htaccess and .htpasswd in our directory
  • .htaccess file contains security directives for the specific directory
  • .htpasswd file contains the userids and associated encrypted passwords.
  • .htaccess file must contain:
  • AuthUserFile /users/www/userid/welcome_html/class1/.htpasswd
  • AuthGroupFile /dev/null
  • AuthName Private
  • AuthType Basic
  • < Limit GET >
  • require user USERID1 USERID2
  • < / Limit >
  • .htpasswd
  • .To create this file use command
  • htpasswd -c .htpasswd USERID1