Sunday, August 25, 2013

Shell Programming : 3

Hello ... Friends , in the beginning we have to study some of the commands separately then we are going to combine these all commands for a meaningful scripts & then we moves on so let's try to understand some of the Basics commands


  • pwd
  • cal
  • date

before going ahead we are going to Discus about the Terminal
nullport is user name on this kernel this is the name you provide during the installation of linux kernel. $ symbole tells about the shell that we are working on shell. So now we can start with commands in the shell
here i want to tell you it is very Important when you are working on shell then must remember shell takes commands in lower case letter if you are tring to execute the caps letter commands then it is notexecuting or give you an error massage with command not found error.

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

  • pwd - print current/working directory
Syntax: pwd [OPTION]...

nullport@localhost ~ $ pwd
/home/nullport

here pwd is stand for the command print name of the current/working directory . in the above commands it will gives us this shell is working directory /home/nullport that's mean we loged in as user nullport & it's shell working in home directory.

--------------------------------------------------------------------------
  • cal - display a calender 
Syntax : cal [options] [[[day] month] year]

this is a important command if we want to see the calender of the current month then we just need simply to write cal in the terminal but when we want to see the particular Date in past or in the future then we need to write complete Syntax as i mention above 

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


  • date : print or set the system date and time
Syntax : date [OPTION]... [+FORMAT]
       date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

this is pretty simple command as  we want to see the current date then we can just use date command & if we want to see the date in different format then we can use the syntex as in above. here i want to explain we can use %m, for month,%y for year & %H for hrs %M for min & %S for sec. 

No comments:

Post a Comment