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 ?
[email protected]:~$ 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 ?
[email protected]:~$ 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 ?
[email protected]:~$ 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 ?
[email protected]:~$ date
Mon May 29 13:20:33 UTC 2017
- How To Display Date As mm/dd/yy ?
[email protected]:~$ date +%D
05/29/17
- How To Display Current Hour, minutes, seconds Individually ?
[email protected]:~$ date +%H
13
[email protected]:~$ date +%M
24
[email protected]:~$ date +%S
45
- How To Display Time In Hours, Minutes & Seconds As HH:MM:SS ?
[email protected]:~$ date +%T
13:25:58
- How To Display Day Of The Week ?
[email protected]:~$ date +%A
Monday
- How To Display Abbreviated Weekday ?
[email protected]:~$ date +%a
Mon
- How To Display Abbreviated Current Month ?
[email protected]:~$ date +%h
May
- How To Display Time In AM/PM Notation ?
[email protected]:~$ date +%r
01:30:30 PM
- How To Display Last Two Digit Of The Year ?
[email protected]:~$ date +%y
17
- How To Display The Date And Time On Two Different Lines ?
[email protected]:~$ date +%D%n%T
05/29/17
13:32:31
- How To Calculate The Number Using (bash claculator) ‘bc’ Command ?
[email protected]:~$ 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 ?
[email protected]:~$ who
ubuntu tty7 2017-05-29 12:54 (:0)
- How To Display All The User Currently Logged In The System With Heading ?
[email protected]:~$ who -H
NAME LINE TIME COMMENT
ubuntu tty7 2017-05-29 12:54 (:0)
- How To Display The Terminal File Of The Current Terminal ?
[email protected]:~$ tty
/dev/pts/1
- How To Display The Message On The Terminal As ‘ Hello World ‘ ?
[email protected]:~$ echo "hello hackers!"
hello hackers!
- How To Create An Empty File With Filename ??
[email protected]:~$ touch demo1 demo2 demo3
It will creates the 3 file with default access permission.
- How To Create File And Enter Data In It ?
[email protected]:~$ cat > demo4
hello hakers !
You cant hack this system :)
For Exiting the file pressctrl+d
- How To Make The Directory With The Directory_Name ?
[email protected]:~$ mkdir my_files
[email protected]:~$ 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 ?
[email protected]:~$ cp demo4 demo5 my_files