JAVA SCRIPT
Showing posts with label 5.LINUX TUTORIAL. Show all posts
Showing posts with label 5.LINUX TUTORIAL. Show all posts

LINUX INTERVIEW QUESTIONS



1. what is Linux ?

Linux is one of popular version of UNIX operating System. It is open source as its source code is freely available. It is free to use. Linux was designed considering UNIX compatibility. Its functionality list is quite similar to that of UNIX.


2. what are components of Linux system ?

Components of Linux System

Linux Operating System has primarily three components

  • Kernel − Kernel is the core part of Linux. It is responsible for all major activities of this operating system. It consists of various modules and it interacts directly with the underlying hardware. Kernel provides the required abstraction to hide low level hardware details to system or application programs.

  • System Library − System libraries are special functions or programs using which application programs or system utilities accesses Kernel's features. These libraries implement most of the functionalities of the operating system and do not requires kernel module's code access rights.

  • System Utility − System Utility programs are responsible to do specialized, individual level tasks



3.   Kernel Mode vs User Mode

Kernel component code executes in a special privileged mode called kernel mode with full access to all resources of the computer. This code represents a single process, executes in single address space and do not require any context switch and hence is very efficient and fast. Kernel runs each processes and provides system services to processes, provides protected access to hardware to processes.

Support code which is not required to run in kernel mode is in System Library. User programs and other system programs works in User Mode which has no access to system hardware and kernel code. User programs/ utilities use System libraries to access Kernel functions to get system's low level tasks.


4. Features of Linux operating system


Following are some of the important features of Linux Operating System.

  • Portable − Portability means software can works on different types of hardware in same way. Linux kernel and application programs supports their installation on any kind of hardware platform.

  • Open Source − Linux source code is freely available and it is community based development project. Multiple teams work in collaboration to enhance the capability of Linux operating system and it is continuously evolving.

  • Multi-User − Linux is a multiuser system means multiple users can access system resources like memory/ ram/ application programs at same time.

  • Multiprogramming − Linux is a multiprogramming system means multiple applications can run at same time.

  • Hierarchical File System − Linux provides a standard file structure in which system files/ user files are arranged.

  • Shell − Linux provides a special interpreter program which can be used to execute commands of the operating system. It can be used to do various types of operations, call application programs. etc.

  • Security − Linux provides user security using authentication features like password protection/ controlled access to specific files/ encryption of data.


5. Architecture of Linux operating system 


The architecture of a Linux System consists of the following layers −

  • Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).

  • Kernel − It is the core component of Operating System, interacts directly with hardware, provides low level services to upper layer components.

  • Shell − An interface to kernel, hiding complexity of kernel's functions from users. The shell takes commands from the user and executes kernel's functions.

  • Utilities − Utility programs that provide the user most of the functionalities of an operating systems.


6.  What is the difference between Linux and UNIX?

Linux and UNIX are related systems with several important distinctions that a competent IT professional would need to understand. As an interview candidate, this presents a unique opportunity to offer a complete answer that shows your knowledge of the competing systems. Other compare-and-contrast type questions could include:  Bash versus DOS , Cron versus anacron



7.  what is LILO ?

The acronym LILO stands for Linux Loader. It is a bootloader for Linux that loads Linux into main memory and starts up the operating system. GRUB and ELILO are other 2 bootloaders.


8 . What is BASH?

BASH is short for Bourne Again SHell. It was written by Steve Bourne as a replacement to the original Bourne Shell (represented by /bin/sh). It combines all the features from the original version of Bourne Shell, plus additional functions to make it easier and more convenient to use. It has since been adapted as the default shell for most systems running Linux.



9.   What is Swap space?

The primary purpose of swap space is to substitute disk space for RAM memory when RAM memory fills up and more space is needed. The Linux kernel will swap out pages of memory that haven't been used recently out to disk to free up RAM for active programs. This mechanism is used by Linux to optimize performance and free up memory for prioritized operations.”


10. Virtual Desktop ?  KDE or Gnome
 (multiple desktop enviornment)

With the workspace switcher tool, you can map each desktop to a workspace and switch back and forth as needed. This helps users who use Linux to multitask in a more resource-friendly, faster way.”

11.  What is the advantage of open source?

Open source allows you to distribute your software, including source codes freely to anyone who is interested. People would then be able to add features and even debug and correct errors that are in the source code. They can even make it run better and then redistribute these enhanced source code freely again. This eventually benefits everyone in the community.



 




RH033 COURSE NOTES

RH 253: LINUX PAM

Linux Pluggable Authentication Modules (PAM) provide dynamic authorization for applications and services in a Linux system. Linux PAM is evolved from the  unix Pluggable Authentication modules architecture.

Each file under pam.d has 3 fields


A. First field

1.auth  

 Module authenticate the user,by checking the password

2.account 

 Module verifies that access is allowed,by checking if users  account is valid,expired,allowed to access in this time of day.

3. passwd  

 Module sets and verify the passwords

4.session

 Module configure and manage user sessions. Represents the enviornment of a user.



B. Control Flag

1. required 

 Module result must be successfull for authentication to continue. If result failed returns failure only after remaining modules are invoked.

2. requisite 

 Module result must be successfull for authentication to continue.  But if module result is fail user is noticed immediately with message reflecting failed required or requiste module

3. Sufficient

 If module results fail , it is ignored, but if its successful and  no required modules is failed ,then user is authenticated to  service.

4. Optional


  If module results fail,it is ignored.If module result is successful  it does not play role in overall success/failure for module.



CONFIGURATION FILE

 1. /etc/pam.d/login


A.account     required  pam_nologin.so

Checks for /etc/nologin file, If exists stops normal user from logging in.
If module is commented, allows user to login even if file /etc/nologin exists

B.auth requisite  pam_access.so

Checks for user name, If username is correct only then it prompts for password
if user incorrect,Displays login incorrect.But if this module is commented though
username is wrong it prompts for password

C.session    required    pam_mkhomedir.so

Create user without homedir  --> useradd -M suma
If homedir doesnt exist,this module creates home dir as soon as user is logged in. But if this module is commented if user is created without homedir,it wont create home dir.

D. auth auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so 

Checks if any terminal is commented in the /etc/securetty, if any terminal is commented root cannot login in that terminal,But if this module is commented root can login in a terminal, though that particular terminal is commented in /etc/securetty file.



2. /etc/security/limits.conf


suma   .............   maxlogins     3

Allows this user to login in only 3 terminals, after 3 logins, we cant even
ssh as that particular user. Even ssh not allowed because USEPAM yes in
/etc/ssh/sshd_config



3. /etc/pam.d/su


auth    required    pam_rootok.so

Change above line from sufficent to required,So even root user needs password
when he tries to do su..  Change  line from sufficent to required.


4. /etc/pam.d/system_auth

passwd    required    pam_passwdqc.so


When  even root tries to set password for normal user, even root is forced
to set complex password for normal user.


5.  /etc/pam.d/vsftpd


1. auth  required  pam_listfile.so  item=user sense=deny  file=/etc/vsftpd/suma
   onerr=succedd

Create file suma under /etc/vsftpd, and add some users to the file /etc/vsftpd/suma So tht users are not allowed to login thru ftp.Default file is /etc/vsftpd/ftpusersSo any users put into tht file are denied to ftp.










If you found this post useful, I would  really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH133 COURSE NOTES

RH033 14. LINUX-FILE-SYSTEM



Inode num is unique num given to file, we identify files by filename but harddisk identify files by sequential uniq num called inode lets observer what happnes to inode whne we copy/remove/move file

cp file1 file2 -->copy file1 file2
ls -li file1 file2 -->inode nums r diff,so file1 file2 occupies
seperate space in hard-disk
mv file1 file2 -->move file1 file2
ls -li file1 file2 -->inode num of file1 is given to file2
file1 no more exist
rm file2 -->remove file
ls -li file2 -->inode of file2 gets vacant,next time you creat
file inode of file2 is given to that.


LINKING FILE

when you copy a source to destination, contents of both are same, later you update source or destination, other file wotn get updated, so linkign file helps to update the file even if contents are added to file after linking.


1. Hard link

ln file1 file2      //hard link file1 file2
ll -i file1 file2    //observe inode/filesize

a. Inode nums are same
b. Size of file is same
c. If source is deleted data can be accessed from destination
d. Only files can be linked dir cant

2. Soft link

ln -s file1 file2 //soft link file1 file2
ll -i file1 file2 //observe inode/filesize

a. Inode nums are diff
b. Size of file is diff
c. If source is deleted data is lost
d. Even dir can be linked.


3. df -h   
Shows current systems partion,n used and free space mount.
Shows List of partions and which dir it is mounted fdisk -l  Also shows system partitions


du -h <file/dir> =Shows size occupied by the file/dir


4. eject    //opens cd tray put cd then
eject -t    //Close cd tray, thn to acces cd contents

To access contents of cd 

mount /dev/cdrom /media  
 (mounts contents of cd to /media dir)

cd /media   (Change dir to /media)

cp OR ls   (list contents or copy contents of cd)

cd [and press enter]  (Takes you out of /media dir)

umount /media  (Unmount /media dir before removing cd)

To access contents of pendrive or any external device

fdisk -l   (At end shows u device identity)

OUTPUT OF fdisk -l looks like this

[root@server1 ~]# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2 16033+ 83 Linux
/dev/hda2 3 1177 9438187+ 83 Linux
/dev/hda3 1178 1488 2498107+ 83 Linux
/dev/hda4 1489 9729 66195832+ 5 Extended
/dev/hda5 1489 1814 2618563+ 83 Linux
/dev/hda6 1815 1945 1052226 83 Linux
/dev/hda7 1946 2199 2040223+ 82 Linux swap / Solaris
/dev/hda8 2200 2215 128488+ 83 Linux
Note: sector size is 4096 (not 512)

Disk /dev/sda: 79.8 GB, 79824777216 bytes
26 heads, 50 sectors/track, 14991 cylinders
Units = cylinders of 1300 * 4096 = 5324800 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 14992 77953628 b W95 FAT32

------>> Here /dev/hda1 to /dev/hda8 are system partitions
and /dev/sda1 is external device identity

SO TO ACCESS CONTENTS OF EXTERNAL DEVICE

mount /dev/sda1 /mnt //Here identity of usb is sda1,and mounting to /mnt

cd /mnt //Change dir to /mnt
cp OR ls //list contents or copy contents of usb
cd [and press enter] //Takes you out of /mnt dir
umount /mnt //Unmount /mnt dir before removing usb



TO TAKE BACKUP USING TAR COMMAND

tar -cvf dump file1 file2 file3 //Take backup of file1,2,3 and store under
dump dir
tar -tvf dump //List all files backed up under dump dir

tar -xvf dump //Restore all contents of dump to pwd


where c->create v->verbose f->file t->list x->extract


TO COMPRESS FILE (2 utilities)

1. gzip file //compress file
gunzip file.gz //once file compressed .gz extension added so file.gz


2. bzip2 file //compress file
bunzip2 file.bz2 //once file compressed .bz2 extension added so file.gz


Before compressing and after compressing observer file size by giving ls -lh and observe file-size




If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH033 15. INSTALLATION


Mode of installation

1. enter --> Takes you to gui mode of installation
2. linux text --> Takes you to text mode of installation

Types of installation

1. Kickstart --> Unattentded installation
2. network installation -->use cd to boot then read remain from server


For Client to install a package it need 2 refer to a file to find
which is server and read packages from there, so create a client.repo file

in /etc/yum.repos.d directory.


vim /etc/yum.repos.d/client.repo
[Server]
name=rhel5
baseurl=ftp://192.168.0.154/pub/RHEL5.1/Server
enable=1
gpgcheck=0

1. yum clean all //changes to client.repo file updated
2. yum install <pkg> //Install a package
3. yum remove <pkg> //Remove a package
4. yum list <pkg> //Status of package
5. yum list all //List all packages installed in your machine
6. yum list available //List all packages available in server

Package are:-

1. Server //Server related packages
2. Cluster //Replication related packages
3. ClusterStorage //Storage related packages
4. Virtualization //vmware of redhat related packages.

If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH033 0. HELP COMMANDS IN LINUX



     HELP COMMANDS

1.   whatis <command> 


One line information about   command.. whatis is a database stored under /var/cache/man/whatis
     

# rm -rf /var/cache/man/whatis      //Delete whatis file

# makewhatis                           //Updates whatis db manually


2.  command --help   


One page information, explaining options of command
   

3.  man <command>  


Manual pages of command
    /text          =search text
    n              =next search
    N              =previous search
    q              =quit

   Sections of man page.Each command is grouped into different sections.

   1. User command
   2. System calls
   3. Library calls
   4. File format
   5. Special file
   6. Games
   7. Missleanous
   8. Administrative commands
   p. Programmers commands

   man page is zipped file stored under 

  /usr/share/man/manx -->where x is num

  man  -a <command> 

  Shows all manual page other than default

  man  -k <keyword> 

 Shows commands related to keyword


  man  -w <command> 

  Path of command


 4. info <page> 


Detailed info about command,designed like webpage each
  * represents a url

    tab =Takes you to *             //Give enter to expand the * 

                                                     and u for undo
    s   =Search text
    q   =undo
 


If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH133 1.STEPS OF BOOT PROCESS




1. BIOS               ->Do POST ->power on self test and Check boot priority,
2. MBR                ->I stage boot loader,partition table, o/s signature
3. /etc/grub/grub.conf   ->root (hd0,0)
                           kernel /vmlinuz...... ro root=LABEL=/
                   initrd /initrd.....img
4. /etc/inittab          ->/etc/rc.d/rc.sysinit     ->Set hostname
                                  
              ->Set clock
                                      
      ->Enable selinux,quota
                                ->check filesystem
                                ->Enable root in rw mode
5. /etc/inittab          ->runlevel  ->/etc/rc.d/rcx.d (where x is num)
6. /etc/rc.d/rc          ->whenever runlevel changes
7. /etc/rc.d/rc.local    ->last script executed in boot process


GRUB FEATURES:

1. Grand unified boot loader
2. Grub indentifies upto 15 file systems
3. Grub has a pre-os enviornment use commands to load o/s
4. Grub supports LBA(Logical block addressing)


GRUB COMMANDS

1. root   (hd0,0)        ->mount the boot partition

2.find  /etc/fstab       ->find the partition  which contains label of /
3.cat (hd0,4)/etc/fstab  -> TO check label of root
OR

4.find  /etc/fstab        ->find the partition  which contains label of /
5. root (hd0,4)           ->Mount the route partiton
6. cat  / + press tab     ->shows contents of mounted partition
7. cat /etc/fstab         ->open the file to see file contents

8. kernel  /vmlinuz........ ro root=LABEL=/       ->Loads the kernel
9. initrd  /initrd...img                 
         ->provides initital ram disk
10. boot                          
                -> Helps to boot the o/s


TO  EXTRACT THE INITRD
1. mkdir initrd
2. cp /boot/initrd-2.6.18-53.el5.img initrd/
3. cd initrd/
4. ls
5. file initrd-2.6.18-53.el5.img
6. mv initrd-2.6.18-53.el5.img initrd.gz
7. ls
8. gunzip initrd.gz
9. ls
10.file initrd
11.cpio  -ivd < initrd


TO SET GRUB PASSWORD
1.grub-md5-crypt              
     ->generate the password
2.vim /etc/grub.conf               ->open file (write below line in this file)
  password --md5  <generated password> (write below hidden menu)
3.reboot
4.Try pressing e or c in grub prompt it wont let you unless you type p
   and provide password

TO EXTRACT SPLASH IMAGE
1. mkdir splash
2. cp /boot/grub/splash.xpm.gz splash
3. cd splash/
4. ls
5. gunzip splash.xpm.gz
6. ls
7. firefox splash.xpm

TO ADD MULTIPLE TEXT TERMINAL
1. vim /etc/inittab
    50:2345:respawn:/sbin/mingetty tty50  -->creates 50th terminal
2. init q                             
   -->make changes to inittab
3. chvt  50                            
  -->change to 50th terminal
Note: To allow root to login also add entries to /etc/securetty.


TO MAKE SERVICE PERMANENT

1. chkconfig --list  |grep network
2. chkconfig --list  |grep sendmail
3. chkconfig --list  |grep cups
4. chkconfig --list  |grep vsftpd
5. chkconfig vsftpd on
6. chkconfig --list  |grep vsftpd
7. chkconfig --levels 35 vsftpd on
   chkconfig --levels 35 <service> <on/off>

If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH133. 5A. SELINUX ADMINISTRATION



            SELINUX

DAC =Discretionary access control
MAC =Mandatory access control

DAC  ->chmod,acl,sudo,visudo
MAC  ->selinux

3 states of selinux
1. ENABLED    = DAC + MAC both are implemented
2. PERMISSIVE = DAC + warning messages of MAC
3. DISABLED   = ONLY DAC

TO show status of selinux
1. cat /etc/sysconfig/selinux
2. sestatus
3. getenforce

TO Change status of selinux from or to permissive/enabled
1. setenforce 0  ->set to permissive from enforcing
2. setenforce 1  ->set to  enforcing from permissive

TO Change status of selinux from or to disabled/enabled
1. vim /etc/sysconfig/selinux  OR
2. system-config-selinux

Once u change from disable-enable or enable-disable you haf
to reboot for changes

To enable/disable booleans for services
1. getsebool -a |grep <service>       ->show status of service
2. setsebool -P  <service> <on/off>   ->Change status of service

To check status of selinux on files
1. ls -Z  <file> ->show sestatus for files

To change context of selinux on files
1. chcon -t <policy>  <file> OR
2. chcon -R --reference <srcfile> <dstfile>

To restore context/policy to originals
1. restorecon <srcfile>

Log Messages of selinux are stored in
1. tailf /var/log/audit/audit.log      
    ->>text mode
2. sealert -b /var/log/audit/audit.log  ->>gui mode



If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH133 8. KICKSTART INSTALLATION




1. yum install system-config-kickstart vsftpd
2. system-config-kickstart
3. vim anaconda-ks.cfg   (copy packages from this file and paste
                          into ks.cfg)
4. cp ks.cfg /var/ftp/pub
5. service vsftpd restart
6. chkconfig vsftpd on

Client

1.Put the boot cd and reboot your machine
2.linux ks=ftp://192.168.0.37/pub/ks.cfg



If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH133. 11.STEPS OF BOOT PROCESS





1. BIOS    ->Do POST ->power on self test and Check boot priority,
2. MBR     ->I stage boot loader,partition table, o/s signature
3. /etc/grub/grub.conf   ->root (hd0,0)
                           kernel /vmlinuz...... ro root=LABEL=/
                           initrd /initrd.....img
4. /etc/inittab          ->/etc/rc.d/rc.sysinit     ->Set hostname
                                                    ->Set clock
                                                    ->Enable selinux,quota
                                                    ->check filesystem
                                                    ->Enable root in rw mode
5. /etc/inittab          ->runlevel
6. /etc/rc.d/rc          ->whenever runlevel changes
7. /etc/rc.d/rc.local    ->last script executed in boot process


1. Problem  -> MBR CORRUPTED
   Corrupt  -> dd if=/dev/zero of=/dev/sda bs=446 count=1
   Error    -> Stops at boot from for long time
   Recovery -> Put first cd and reboot thn press linux rescue
                chroot  /mnt/sysimage
                grub-install  /dev/sda


2. Problem  -> grub.conf file missing  OR wrong entries in grub.conf
   Corrupt  -> mv /boot/grub/grub.conf /root
   Error    -> drops you to grub prompt
   Recovery -> root (hd0,0)
               kernel /vmlinuz...... ro root=LABEL=/
               initrd /initrd.....img

               
3. Problem  -> /vmlinuz or /initrd file missing from /boot dir.
   Corrupt  -> rm -rf /boot/vmlinuz....... rm -rf /boot/initrd.......
   Error    -> file not found
   Recovery -> Put first cd and reboot thn press linux rescue
                chroot  /mnt/sysimage
                cat /proc/sys/dev/cdrom/info  ->check cdroms identity
                mount /dev/hdb /media
                cd  /media/Server
                rpm --ivh --force kernel.................

4. Problem  -> /etc/rc.d/rc.sysinit    OR       /etc/inittab file missing
   Corrupt  -> rm -rf /etc/rc.d/rc.sysinit OR   /etc/inittab
   Error    -> cannot that execute /etc/rc.d/rc.sysinit OR No process left
   Recovery -> Put first cd and reboot thn press linux rescue
                chroot  /mnt/sysimage
                cat /proc/sys/dev/cdrom/info  ->check cdroms identity
                mount /dev/hdb /media
                cd  /media/Server
                rpm --ivh --force initscripts-8.45

5. Problem  -> Wrong entry of runlevel 0 or 6
   Corrupt  -> vim /etc/inittab and edit runlevel to 0 OR 6
   Error    -> continously reboots
   Recovery ->  Reboot machine and go to single user mode
                and edit vim /etc/initab file and change runlevel to
                3 or 5. and press init q for changes.
               


6. Problem  -> Wrong entries in the /etc/fstab
   Corrupt  -> vim /etc/fstab make some changes in the labels
   Error    -> Drops you to emergencey mode
   Recovery -> First provide roots passwd
               mount -o remount,rw /
               vim /etc/fstab ->and correct the labels  
               If you dotn know label e2label /dev/sda1
               keep checking for correct label e2label /dev/sda2
               


If you found this post useful, I would really love it, if you can Like the Page, or share it with your Facebook/Google+/Twitter Friends... It will keep me motivated. Thank you!

RH033 1. A UNIX file system


File system  is a collection of files and directories stored. Each file system is stored in a separate whole disk partition.


FEATURES OF FILE SYSTEM.

1.Linux file system is inverted root tree like structure
2.Linux file system is casesensitive.
3.Hidden files start with . (dot) extension.
4.dot (.) refers to current dir
5.double dot (.) refers to immediate parent dir
       

The FILE SYSTEM and its contents..


 /      This is the root directory.  This  is  where  the  whole tree starts. Please note that /root is root user’s home 
directory, which is not same as /.

 /bin   This  directory  contains  executable programs.
             
/boot  Contains  static files for the boot loader.  This 
directory only holds the files which are  needed  during  the
 boot process. 

/dev   Special/device  files,which  refer to physical devices.          
/etc   Contains configuration files

/home  users  home directories are stored here.
             
/lib  This directory should hold those shared  libraries 
like drivers
             
 /mnt and /media  This directory contains  mount  points  for  temporarily  mounted filesystems

/opt  This  directory  is used to store third party tools  or packages.

        
 /proc  This is a mount point for  the  proc  filesystem,  which
              provides  information  about  running  processes 
              and the  kernel. 

/root  This  directory  is  usually  the home directory for the
              root user (optional).

/sbin  Like /bin, this directory holds commands needed to   
           boot the system, but which are usually not executed              by normal users.

 
/tmp   This directory contains temporary  files  which  may  
            be deleted  with  no notice, such as by a regular job 
            or at  system boot up.

  /usr   This directory is usually mounted from a separate 
             partition. contains documents .

  /var   This  directory contains files which may change in 
           size,such as spool and log files.



RH033 2. BASIC COMMANDS IN LINUX:

->  To Set Date:  (Date command)


    date  =Shows current date and time
    date <mmddHHMMYYYY> =Set current date and time
    date +%a =Shows week
    date +b  =Shows month
    date +Z  =Shows timezone
    date +T  =Shows time only



->  To  check  Calender:   (cal command)

    cal         =Show current cal
    cal -3      =Show current next and previous cal
    cal <YYYY> =Show particular years calender



->  To create File:    (cat and touch command)

   CREATE FILE
   cat  >  <file>  =Create file    add contents, ctrl c save file
   cat  >> <file>  =Append exisiting file
   cat  -n <file>  =Number  file

   touch <file>                   =Creates empty file
   touch file file2 file3 file4   =Create 4 empty files



->  To remove file:    (rm command)

   rm    <file>    =Remove file by prompting
   rm -f <file>    =Remove file without prompt




->  To create directory:  (mkdir command)

   mkdir  <Dir>              =Create dir
   mkdir -p <Dir1/dir2/dir3> =Create parent dir




->  To remove directory:  (rm command)

   rmdir    <dir>            =remove empty dir
   rm    -rf <dir>           =remove dir which has contents




-> List contents of directory and  its options. 
(ls command)

   ls          =List contents of dir
   ls -l       =Long listing
   ls -a       =List hidden file
   ls -l <file>=Long list individual file
   ls -ld <dir>=Long list individual dir
   ls -i <file>=Shows inode num of file
   ls -h <file>=Shows human readable size of file



-> To change directory (cd command)

   cd  <dir>  =Change to specified dir
   cd         =Change to home dir
   cd ..      =Change to immediate parent dir



-> To copy  files  (cp command)

   cp   <file1> <file2>  =Copy file to file
   cp   <file1> <Dir>    =Copy file to dir
   cp -r <dir1> <Dir2>   =Copy dir1  to dir2



->  Move or Rename  file  (mv command)

   mv <file1> <file2>  
Move/rename file, once moved source file dont exist.