Basic Linux Command

 

 

 

BASIC LINUX COMMANDS

 

1. Date command:

This command is used to display current time and date.

Syntax:

# date

Options : -

a = Abbreviated weekday.

A = Full weekday.

b = Abbreviated month.

B = Full month.

c = Current day and time.

C = Display the century as a decimal number.

d = Day of the month.

D = Day in „mm/dd/yy format

h = Abbreviated month day.

H = Display the hour.

L = Day of the year.

m = Month of the year.

M = Minute.

P = Display AM or PM

S = Seconds

T = HH:MM:SS format

u = Week of the year.

y = Display the year in 2 digit.

Y = Display the full year.

Z = Time zone

 

To change the format :

Syntax :

$date ‘+%H-%M-%S

Example:    # date                       

Output:          Fri Jul 6 01:07:09 IST 2012

 

2.Calender Command :

This command is used to display the calendar of the year or the particular month of calendar year.

Syntax :

a.$cal<year>

b.$cal<month><year>

 

 Here the first syntax gives the entire calendar for given year & the second Syntax gives the calendar of reserved month of that year.

Example: # cal July 2016

Output:

Su Mo Tu We ThFrSa
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 31

3.’who’ Command :

            It is used to display who are the users connected to our computer currently.

Syntax :$who – options

Options : -

H–Display the output with headers.

b–Display the last booting date or time or when the system was lastly rebooted.

 

4.’who am i’ Command :

Display the details of the current working directory.

Syntax :$who am i

Example:#whoami
Output:     rinku

 

5.’tty’ Command :

It will display the terminal name.

Syntax :$tty

Example:       #tty

Output:         

Comments

Popular posts from this blog

what is Machenical Engineering

PHOTO ( CHINESE LADKA)

Arithmatic operations, factorial of a number, while loop, prime number, etc