In this Slides we will Cover Some Basic Commands and then Permission on User and Other Files in Fie System.
Our Group also Make Compete Course of Linux in Urdu in Future Insha Allah in PPT Format and also in Video or Word and Pdf mean IT related all Format
5. WHAT IS GNU/LINUX?
A free Unix-type operating system developed under the GNU
General Public License.
● Open source
● Popular
● Support most of the platforms available
6. HISTORY OF BEFORE
LINUX
1969
UNIX
1973 UNICS
Converted into Unix
1984
GUN Unix
مقابلہ
1990
Working on Kernel
By
Linus Torvalds
GNO &
MINIX
نہیں کرنل
تھا
Memory
Manager
creator
Utility of
MINIX
and GNO
Rewrite all utility
Of MINIX and GNO
As Competition of
UNIX
کیا ہے میں اصل لینکس
تاریخ کی اس اور
ہے کیاAssembly
language Write
1st
Ken Thompson,
Dennis Ritchie
In C language
1973, Rewrite
UNIX with C
Richard Stallman
GPL
Hacker
GNU(Free Software
Foundation )
starts under
GPL
Andrew Stuart
"Andy" Tanenbaum
7. What is
Linux/GNU?
1991
Kernel
Announcement in
Social Media Group
Comparison of
operating systems
https://en.wikipedia.org/wiki/Compari
son_of_operating_systems
یعنی نام کا سسٹم اس Linux لینکسکے الفاظ دو کو
لفظ پہال ہے۔ گیا بنایا کر جوڑ کو حروف ابتدائی
LINUS اس ہے۔ نام کا بانی کے سسٹم اس جو ہے
یعنی حروف ابتدائی تین سے میں لفظ LIN منتخب
لفظ دوسرا ہیں۔ گئے کئے Unix یعنی مخفف کا UX
لفظ طرح اس گیا۔ لیا LINUX ہے۔ پاتا تشکیل
لینکس
Linux Distribution
SunOS, Solaris, HP-UX,
AIX, SCO UNIX
کرنل پہال سے سب
1994کیا جاری میں ء
گیا
اسسسٹم آپریٹنگکو
لینس کے لینڈ نِف
نے ٹوروالڈز1991ء
میںکیا شروع
8. LINUX TODAY
• Linux has been used for many computing platforms
• PC, Supercomputer
• Commercial vendors moved in Linux itself to
provide freely distributed code. They make their
money by compiling up various software and
gathering them in a distributable format
• Red Hat, Slackware, etc.
• About 29 million people use Linux worldwide
9. LINUX DISTRIBUTION
• Red Hat Linux : One of the original Linux
distribution.
• The commercial, non-free version is Red
Hat Enterprise Linux, which is aimed at
big companies using Linux servers and
desktops in a big way
• Debian GNU/Linux : A free software
distribution. Popular for use on servers
• Gentoo Linux : Gentoo is a specialty
distribution meant for programmers
22. SOME BASIC COMMANDS IN
LINUXCommand Name Description
32. su u name
Example : su zubi
لیئے۔۔۔۔۔۔ کے جانے پر یوزر لوکل سے یوزر سوئچ
33. usermod –s /bin/bash uname
Example : usermod –s /bin/bash zubi
and check by cat
لیئے۔۔۔۔۔۔ کے کروانے ایبل ان کو زر یو
34. cat , more, vi, view,
Example :vi /etc/passwd
اس واسطے کرنے ایڈٹ کو فائل اور دیکھنے کو فائل
کرے۔۔۔ یوز کو کمانڈ
35. userdel –r/f u-name
Example : userdel –r /f yami
۔۔۔۔۔ کیلئے کرنے ڈیلیٹ کو یوزر اپنے
36. usermod –s /sbin/nologin u-name
Example : usermod –s /sbin/nologin
zubi
کرنےکیلئے۔۔۔۔۔ ایبل ڈس کو یوزر
23. SOME BASIC COMMANDS IN
LINUXCommand Name Description
37. info
Example : info +Enter
لیئے۔۔۔۔۔۔ کے کروانے وُش انفارمیشن
38. Exit or logout or halt
Example : halt and press enter
لیئے۔۔۔۔۔۔ کے کروانے ختم اور ن َڈاو شٹ
39. cat , more, vi, view,
Example :vi /etc/passwd
اس واسطے کرنے ایڈٹ کو فائل اور دیکھنے کو فائل
کرے۔۔۔ یوز کو کمانڈ
40. userdel –r/f u-name
Example : userdel –r /f yami
۔۔۔۔۔ کیلئے کرنے ڈیلیٹ کو یوزر اپنے
41. usermod –s /sbin/nologin u-name
Example : usermod –s /sbin/nologin
zubi
کرنےکیلئے۔۔۔۔۔ ایبل ڈس کو یوزر
24. SOME BASIC COMMANDS IN
LINUX
Command Name Description
42. df [options]
Example : df yami
کے کروانے وُش جگہ بقیہ اور سپیس شدہ استعمال
لیئے۔۔۔۔۔۔
43. du [options]
Example : du yami
لیئے۔۔۔۔۔ کے دیکھنے اسکو ہے لیتی فائل ہر جگہ کتنی.
44. less [options] [filename]
Example :less yami
کو مواد کے صفحے ایک فائل ایک میں وقت ایک
۔۔۔۔۔۔ لیئے کے دیکھنے.
45. echo
Example : echo + enter
لیئے۔۔۔۔۔ کے کروانے وُش کو آرگومنٹ
46. Man ls
Example : man ls + enter
۔۔۔۔۔ لیئے کے جاننے کو کمانڈز کی قسم خاص
25. SOME BASIC COMMANDS IN
LINUXCommand Name Description
47. Ps –e
Example : ps –e
لیئے۔۔۔۔۔۔ کے کروانے وُش پروسیس تمام
48. pstree
Example : pstree + enter
لے کروانے وُش کو پروسس میں شکل کی ٹری ایک
لیئے۔۔۔۔۔۔
49. top
Example :top + enter
۔۔۔ لیئے کے کروانے وُش پروسس انٹریکٹیو
50. vi mycron
Example : vi mycron + Enter
۔۔۔۔۔۔۔۔۔ بیسٹ مائی ایڈیٹر
51. History
Example : history + enter
۔۔۔۔۔ لیے کے کرنے چیک ہسٹری
26. SOME BASIC COMMANDS IN
LINUXCommand Name Description
52. whoami
Example : whoami + enter
لیئے۔۔۔۔۔۔ کے کروانے وُش یوزر کرنٹ
53. cat /etc/shells
Example : cat /etc/shells
کو شلزلیئے۔۔۔۔۔۔ لے کروانے وُش
54. top
Example :top + enter
۔۔۔ لیئے کے کروانے وُش پروسس انٹریکٹیو
55. vi mycron
Example : vi mycron + Enter
۔۔۔۔۔۔۔۔۔ بیسٹ مائی ایڈیٹر
56. History
Example : history + enter
۔۔۔۔۔ لیے کے کرنے چیک ہسٹری
27. HOW TO CONFIGURE INTERNET IN RHEL
س سبےپہلےاپناٹکری اوپنرمینلں
اپنےنیٹکرن چیککو ورکےکےلیئےیہکمانڈلگائیں
#service network restart
می بعد اورںاسکا
IP
کری چیکںکمان اسڈسے
# ifconfih
31. • Local Permissions:-
Within a system or standalone system, permissions
applied are called local permissions.
• Network Permissions:-
Over the network, permissions applied on a system are called
network permissions, i.e., shared device permissions.
32. Local Permissions
Types of Permissions in Linux:-
Read ( r )
Write ( w )
Execute ( x )
Sequence of permissions is important. We can check the file
properties to see the permissions.
33. TO SEE THE PROPERTIES:-
# ls -l
First column of properties is the permissions of the file or directory. There are 10 slots of the
permission column. We divide these ten slots into 4 segments.
- - - - - - - - - -
1 slot 3 slots 3 slots 3 slots
• First segment contains only the one slot (first slot only).
• Second segment contains three slots (next three slots).
• Third segment contains three slots (next three slots of remaining).
• Forth segment contains also three slots (last three slots).
34. 1st Segment 2nd Segment:-
If the slot is “–“, then it is a file.
If the slot is “d”, then it is a directory.
If the slot is “l”, then it is a link file
(shortcut).
2nd segment shows the owner’s (file creator)
permissions.
rwx means read, write and execute (all
permissions) permissions.
_wx means only write and execute
permissions.
_ _ x means only execute permission.
r _ x means only read and execute
permissions.
rw_ means only read and write permissions.
_ _ _ means no permissions.
35. 3rd Segment:- 4th Segment:-
3rd segment shows the owner’s primary group
permissions.
rwx means read, write and execute (all
permissions) permissions.
_wx means only write and execute permissions.
_ _ x means only execute permission.
r _ x means only read and execute permissions.
rw_ means only read and write permissions.
_ _ _ means no permissions.
4th Segment:-
4th segment shows the others permissions, other
than owner’s primary group permissions. Others
are also called world users.
rwx means read, write and execute (all
permissions) permissions.
_wx means only write and execute permissions.
_ _ x means only execute permission.
r _ x means only read and execute permissions.
rw_ means only read and write permissions.
_ _ _ means no permissions.
36. ڈاریکٹکرنا چیککو پرمیشن کی ری
To Check the Permissions of a File/Directory:-
# ls -l file-name
# ls -l Yami
To Change the Permissions:-
chmod command is used to change any file or directory permissions.
37. METHODS OF CHANGE PERMISSIONS
Identifier Method
Number System Method
39. THERE ARE THREE PERMISSIONS READ, WRITE
AND EXECUTE ARE AVAILABLE IN LINUX.
There are three permissions
read, write and execute are
available in Linux.
Actions:-
Add permissions ‘+’
Remove permissions ‘-‘
Syntax:
# chmod
identifier action permission
file/dir-name
Example:-
# chmod g+x Yami
This will add a owner’s primary
group permission execute on abc file.
Example To Add & Remove the
Permissions:-
# chmod u-x, g-x, o+w Yami
Problem:-
Give the read, write and execute
permissions to the owner, give read and
write to primary group and give read
permissions to the others.
Owner = rwx
Group = rw_
Others = r_ _
Solution:-
# chmod u+rwx, g+rw, o+r
Yami
#chmod a+r, u+wx, g+w Yami
output:-
_rwxrw_r_ _
40. NUMBER SYSTEM METHOD:-
In number system following
numbers are assigned to each
permission.
• r = 4
• w = 2
• x = 1
Full Access or Full
Permission:-
4+2+1 = 7
7 means full access (rwx) as
4+2+1=7
• rw_ is equivalent to 6, as 4+2=6
• r_ _ is equivalent to 4
• r_x is equivalent to 5, as 4+1
• _wx is equivalent to 3, as 2+1=3
• _ _ x is equivalent to 1
• 0 means no permissions (access)
Example:-
Required Result: _rwx rw_ r_ _
# chmod 764 yami
Example:-
Present Permissions Status:
_ rwx rw_ r_ _
Required Result:
_ rw_ r_ _ r_x
#chmod 645 yami
41. SPECIAL PERMISSION:- (STICKY BIT)
• It is used on that directory or file on which everyone has full control. i.e. , tmp
directory.
•
• Delete permission is not given. One user cannot delete other user’s files.
• 1 is used for numeric value of sticky bit.
• Its symbol is “t”. For example, -rwxrwxrwt.
42. ADD A STICKY BIT:-
If we want to add a sticky bit on the data directory, then we will execute the following
command.
# chmod 1777 data
where “1” is to add a sticky bit.
Remove a Sticky Bit:-
# chmod 777 data
Or # chmod 0777 data
Sticky bit is not applicable on owner of the file or directory.
43. DEFAULT PERMISSIONS
• In windows OS everyone has by default full control on a file or directory.
• In Linux by default permission on a file is 644 (- rw- r- - r- -).
• And by default permission on a directory is 755 (d rwx r-x r-x).
• Default permissions depend upon umask (user mask) value.
• Default umask is 022
• In the case of directory 777 – 022 = 755
• And in case of file 666 – 022 = 644
• Full access umask is 000.
44. • By default root has a umask 022
• And regular account’s umask is 002.
• 027,022,002 have some common umask used in Linux.
• In case of directory we subtract the umask value from 777.
• And in the case of a file we subtract the umask value from 666.
• If the resultant value is less than 0, then this will be considered to 0
DEFAULT PERMISSIONS