Linux Commands New
Linux Commands New
3.Creating a file:
[csbs124@cc7linux~]$ cat > basic
4.Display a file:
[2CB101@localhost ~]$ cat basic
this is a linux lab
csbs department
[2CB101@localhost ~]$
5. FILE PERMISSIONS:
(u-user,g-group,o-others) (r-read,w-write,x-execute)
(octal notation for read-4, write-2 ,execute-1
[2CB101@localhost ~]$ ls -l
total 288
rw-rw-r-x. 2 2CB101 2CB101 4096 Jan 1 06:23 basic
6.Append a file:
[2CB101@localhost ~]$ cat>exam
aaaa
bbbb
cccc
[2CB101@localhost ~]$ cat exam
aaaa
bbbb
cccc
9.Comparing files:
[2CB101@localhost ~]$ cmp b b3
b b3 differ: byte 9, line 5
[2CB101@localhost ~]$ cat>b
a
b
c
d
e
[2CB101@localhost ~]$ cat>b3
a
b
c
d
f
11.List :
[2CB101@localhost ~]$ ls
a a1 abiii cse d32 Desktop fe.txt p
12.Remove:
[2CB101@localhost ~]$ rm a1
[2CB101@localhost ~]$ ls
a a.c d12 d44
13.More:
[csbs124@cc7linux~]$ more b2
14.Additional file name:
[2CB101@localhost ~]$ ln -s b cc
[2CB101@localhost ~]$ ls
15.Present working directory:
[csbs124@cc7linux~]$ pwd
/home/cse240
III.PROCESS AND STATUS INFORMATION COMMAND
16.Date:
[csbs124@cc7linux~]$ date
Sun Dec 31 23:55:10 IST 2000
[csbs124@cc7linux~]$ date +%d
31
[csbs124@cc7linux~]$ date +%m
12
[csbs124@cc7linux~]$ date +%h
Dec
[csbs124@cc7linux~]$ date +%y
00
[csbs124@cc7linux~]$ date +%R
23:55
[csbs124@cc7linux~]$ date +%T
23:55:38
17.Calendar:
[csbs124@cc7linux~]$ cal
December 2000
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
18.Binary calculator:
[csbs124@cc7linux~]$ bc
bc 1.06
5*4
20
19.Who :
[csbs124@cc7linux~]$ who
cse319 pts/1 Dec 31 23:04 (132.147.162.8)
cse318 pts/2 Dec 31 23:51 (132.147.162.7)
cse212 pts/3 Dec 31 23:04 (132.147.162.9)
cse316 pts/4 Dec 31 23:24 (132.147.162.5)
20.Finger command:
[csbs124@cc7linux~]$ finger
Login Name Tty Idle Login Time Office Office Phone
Cse303 cse303 pts/22 Dec 31 23:10 (132.147.162.11)
Cse322 cse322 pts/3 1 Dec 31 23:04 (132.147.162.9)
Cse324 cse324 pts/8 1 Dec 31 23:06 (132.147.162.10)
cse325 cse325 pts/13 Dec 31 23:19 (132.147.162.1)
cse326 cse326 pts/11 Dec 31 23:55 (132.147.162.2)
cse332 cse332 pts/9 Dec 31 23:06 (132.147.162.3)
cse335 cse335 pts/7 1 Dec 31 23:05 (132.147.162.4)
cse338 cse338 pts/4 Dec 31 23:24 (132.147.162.5)
cse340 cse340 pts/10 2 Dec 31 23:32 (132.147.162.27)
cse346 cse346 pts/2 Dec 31 23:51 (132.147.162.7)
21.Who am i:
[csbs124@cc7linux~]$ who am i
cse240 pts/11 Dec 31 23:55 (132.147.162.2)
22.Man:
[csbs124@cc7linux~]$ man date
DATE(1) User Commands DATE(1)
NAME
date - print or set the system date and time
SYNOPSIS
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
DESCRIPTION
Display the current time in the given FORMAT, or set the system
date.
-d, --date=STRING
display time described by STRING, not ânowâ
-f, --file=DATEFILE
like --date once for each line of DATEFILE
23.Word count:
[csbs124@cc7linux~]$ wc new
wc new
6 85 557 new
[csbs124@cc7linux~]$ wc -w new
85 new
[csbs124@cc7linux~]$ wc -c new
557 new
[csbs124@cc7linux~]$ wc -l new
6 new
24.Echo:
[csbs124@cc7linux~]$ echo
25.Read:
[csbs124@cc7linux~]$ read a
5
[csbs124@cc7linux~]$ echo $a
5
26.Terminal line:
[csbs124@cc7linux~]$ tty
/dev/pts/11
28.Which :
[csbs124@cc7linux~]$ which date
/bin/date
[csbs124@cc7linux~]$ which new
/usr/bin/which: no new in (/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr
/X11R6/bin:/home/cse240/bin)
IV.FILTER COMMAND
29.Sorting:
[csbs124@cc7linux~]$ cat new
multitasking is the capability of the operating system to perform various tasks.
A single user can perform various tasks.
every user can have a login name and a password .
[csbs124@cc7linux~]$ sort new
every user can have a login name and a password .
multitasking is the capability of the operating system to perform various tasks.
A single user can perform various tasks.
30.Head:
[csbs124@cc7linux~]$ head new
multitasking is the capability of the operating system to perform various tasks.
A single user can perform various tasks.
every user can have a login name and a password .
31.Tail:
[csbs124@cc7linux~]$ tail new
multitasking is the capability of the operating system to perform various tasks.
A single user can perform various tasks.
every user can have a login name and a password .
[csbs124@cc7linux~]$ tail -2 new
Necessary ingredients like conditional and control structures and variables.
communication is between different terminals.
32.Cut:
[csbs124@cc7linux~]$ cut -c1-3 new
mul
eve
UNI
os
UNI
com
33.Paste:
[csbs124@cc7linux~]$ paste new latest
multitasking is the capability of the operating system to perform various tasks.A single
user can perform various tasks. multitasking is the capability of the operating system to
perform various tasks.A single user can perform various tasks.
34.Grep:
[csbs124@cc7linux~]$ grep "between" new
os is used to have interface between system and user.
communication is between different terminals.
35.Common:
[csbs124@cc7linux~]$ comm new latest
multitasking is the capability of the operating system to peerform various
tasks.A single user can perform various tasks.
every user can have a login name and a password .so, accessing another users
data is impossible without permission.
os is used to have interface between system and user.
communication is between different terminals.
36.Pipes:
[csbs124@cc7linux~]$ who | wc -l
22