Geeks Trick
Linux Basic Commands For Beginners

Linux Basic Commands For Beginners

In this tutorial we will see some Linux Basic Commands For Beginners covering the basic knowledge.

Commands with output

  • How To Display The Calendar Of The Current Month Of The Current Year ?
ubuntu@ubuntu:~$ cal
      May 2017        
Su Mo Tu We Th Fr Sa  
    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 

This command will display the current month of the current year.

 

Similarly in Linux, every single commands has its different parameters. Let us see the the commands and its parameter.

  • How To Display The Calendar Of The Year 2007 ?
ubuntu@ubuntu:~$ cal 2007

This command will display all the months of the year 2007 with the dates.

 

  • How To Display The Calendar Of The Month July Of The Year 1998 ?
ubuntu@ubuntu:~$ cal 07 1998 
     July 1998        
Su Mo Tu We Th Fr Sa  
          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
  • How To Display Today’s Date ?
ubuntu@ubuntu:~$ date
Mon May 29 13:20:33 UTC 2017
  • How To Display Date As mm/dd/yy ?
ubuntu@ubuntu:~$ date +%D 
05/29/17
  • How To Display Current Hour, minutes, seconds Individually ?
ubuntu@ubuntu:~$ date +%H 
13
ubuntu@ubuntu:~$ date +%M 
24
ubuntu@ubuntu:~$ date +%S 
45
  • How To Display Time In Hours, Minutes & Seconds As HH:MM:SS ?
ubuntu@ubuntu:~$ date +%T 
13:25:58
  • How To Display Day Of The Week ?
ubuntu@ubuntu:~$ date +%A
Monday
  • How To Display Abbreviated Weekday ?
ubuntu@ubuntu:~$ date +%a
Mon
  • How To Display Abbreviated Current Month ?
ubuntu@ubuntu:~$ date +%h
May
  • How To Display Time In AM/PM Notation ?
ubuntu@ubuntu:~$ date +%r
01:30:30 PM
  • How To Display Last Two Digit Of The Year ?
ubuntu@ubuntu:~$ date +%y
17
  • How To Display The Date And Time On Two Different Lines ?
ubuntu@ubuntu:~$ date +%D%n%T
05/29/17
13:32:31
  • How To Calculate The Number Using (bash claculator) ‘bc’ Command ?
ubuntu@ubuntu:~$ bc -q
123+4
127
123*2
246
12/2
6
quit

For exiting the bash calculator just type quit to exit.

 

  • How To Display All The User Currently Logged In The System ?
ubuntu@ubuntu:~$ who
ubuntu   tty7         2017-05-29 12:54 (:0)
  • How To Display All The User Currently Logged In The System With Heading ?
ubuntu@ubuntu:~$ who -H
NAME     LINE         TIME             COMMENT
ubuntu   tty7         2017-05-29 12:54 (:0)
  • How To Display The Terminal File Of The Current Terminal ?
ubuntu@ubuntu:~$ tty
/dev/pts/1
  • How To Display The Message On The Terminal As ‘ Hello World ‘ ?
ubuntu@ubuntu:~$ echo "hello hackers!"
hello hackers!
  • How To Create An Empty File With Filename ??
ubuntu@ubuntu:~$ touch demo1 demo2 demo3

It will creates the 3 file with default access permission.

  • How To Create File And Enter Data In It ?
ubuntu@ubuntu:~$ cat > demo4
hello hakers !
You cant hack this system :)

For Exiting the file pressctrl+d

  • How To Make The Directory With The Directory_Name ?
ubuntu@ubuntu:~$ mkdir my_files  
ubuntu@ubuntu:~$ ls
demo4  Desktop    Downloads  my_files  Public     Videos
demo5  Documents  Music      Pictures  Templates

where $ ls command will list down all the files and directory in the current directory.

  • How To Copy The Files To The Directory ?
ubuntu@ubuntu:~$ cp demo4  demo5  my_files 

Rehmaanali

Hi This Is Rehmaanali.
Blogging Is Just A Hobby.
Graduate In Bsc Computer Science

2 comments

  • man command for displaying the description and the paramerters of the command
    $ man
    $ man ls
    LS(1) User Commands LS(1)

    NAME
    ls – list directory contents

    SYNOPSIS
    ls [OPTION]… [FILE]…

    DESCRIPTION
    List information about the FILEs (the current directory by default).
    Sort entries alphabetically if none of -cftuvSUX nor –sort is speci‐
    fied.

    Mandatory arguments to long options are mandatory for short options
    too.

    -a, –all
    do not ignore entries starting with .

    -A, –almost-all
    do not list implied . and ..

    –author
    And to quit press q

Author

Rehmaanali

Hi This Is Rehmaanali.
Blogging Is Just A Hobby.
Graduate In Bsc Computer Science

Subscribe To Our Newsletter

Join our mailing list to receive the latest Articles news and updates from our team. 

You have Successfully Subscribed!