Getting Help:
The command that are used to get the help are discussed as :
- Whatis
Display
a short description of command , it uses a database that is updated
nightly. Often not available immediately after installation.
Syntax:
# Whatis cal
- Help
Display usage summary and argument list
Syntax:
<command> --help
Example:
#Date –help
- Man and Info:
Both provide documentation for command. Almost every command has a “man” page. Collection of pages are called linux manual.
# man date
# info date
Viewing Text Page
Syntax:
#less [option] [filename]
Example:
# less abc.txt
scroll with arrows/PgUp /PgDown
/text : search for text
n : Next Match
Option:
-c : Clear before displaying
-s : Squeeze multiple blank lines into a single blank line
Simply we can also use “less” along with pipe | as
# ll |less
File and Directory:
‘ll’
is used to display the information about the files and directory
including date, time, users,group, size, name and permission.
Four symbols are used when displaying permission.
R : Read
W : Write
X : Execute
- : no permission
-rwxrwxrwx : files
drwxrwxrwx : directory
files and directory permission are symbolized by ten character.
If we want to change permission, then there are two methods:
- symbolic
- Numeric
1. Symbolic Method:
Syntax:
Chmod mode directory/filename
Mode Option:
- u,g,o
- w,r,x
- +,-
- =
- # chmod u+rwx file or directory : in case of user only
- # chmod ug+rwx file or directoty : in case of user and group
- # chmod u+w,g+r,o+x directory/file
- # chmod u+rw,g+rw directory/file
- # chmod u-r, g-w,o-rw directory/file
- # chmod ugo+rwx file/directory
- # chmod ugo-rwx file/directory
- + is used to add permission
- - is used remove permission
chmod ugo=rw directory/file
this command will assign read/write permission to u,g,o
suppose we have one file as
test.txt
permission : -r- - r- -r- -
chmod u=w,g=wx,o=w test.txt
this command will assign write to user, write/execute to group and write to other while remove the previous permission.
The
main difference between +,= are + operator simply add the new
permission with previous one and = assign the new permission while
removing old (new permission overwrite an old)
2. Numeric Method:
In this method, calculation are based on following numbers
r = 4
w = 2
x = 1
0 = no permission
Example:
#chmod 777 file/directory
in
this case user get 7 means that user has permission of
read/write/execute, group get 7 means read/write/execute and ame for
other
# chmod 531 file/directory
in
this case user get 5 means that user has permission of read/execute,
group get 3 means write/execute and other get 1 means that other has
permission to execute.
#chmod 742 file/directory
7 : User : rwx
4 :Group : r
2 : Other : w
Very informative post. Keep up the good work. I would really look forward to your other posts
ReplyDeleteDell - Inspiron 15.6" Touch-Screen Laptop - 4GB Memory - 500GB Hard Drive - Black (15RVT-9095BLK)
Dell - Latitude 14.1" Refurbished Laptop - 4GB Memory - 250GB Hard Drive - Gray
Very informative post. Keep up the good work. I would really look forward to your other posts
ReplyDeleteDell - Inspiron 15.6" Touch-Screen Laptop - 4GB Memory - 500GB Hard Drive - Black (15RVT-9095BLK)
Dell - Latitude 14.1" Refurbished Laptop - 4GB Memory - 250GB Hard Drive - Gray