Running Commands

 The simplest way to run a command is to just type the name of the command from a shell.

 Open a Terminal window and  type the following command: 

 $ date 

 Sat Nov 26 08:04:00 EST 2011

Typing the date command, with no options or arguments, causes the current day, month, date, time, time zone, and year to be displayed as just shown.

Some more examples of commands are as :

$ pwd

/home/torvald

 pwd command shows your present working directory.

$ hostname 

linus-system

hostname shows your computer’s hostname (linus-system in this example is the name of the computer)

$ ls 

Desktop Downloads Pictures Templates Documents Music Public Videos

ls command lists the files and directories in your current directory.

Commands can be run by just typing command names, it’s more common to type more after the command to modify its behavior. The characters and words you can type after a command are called options and arguments.

Comments