![]() |
|
|
#1 |
|
Senior Member
Join Date: Aug 2011
Posts: 103
|
1.mv file1 file2 – rename or move file1 to file2
2.tail file – output the last 10 lines of file. 3.whoami – who you are logged in as. 4.df-show disk usage. 5.chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and world by adding: ● 4 – read (r) ● 2 – write (w) ● 1 – execute (x) YOU CAN USE ABOVE SOME BASIC COMMANDS UNDER LINUX OPERATION SYSTEM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Aug 2011
Posts: 131
|
Excellent Job Harry
Something is from my side too In binary number we useually write in following way 32 16 8 4 2 1 means 2 raise to power 5 is 32 2 raise to power 4 is 16 2 raise to power 3 is 8 2 raise to power 2 is 4 2 raise to power 1 is 2 2 raise to power 0 is 1 but the condition is on every place there must be binary 1 if there will be binary 0 then the resultant will be zero Now for permissions, first digit represents read second digit represents write and third digit represents execute so if we only want to give rights of read then it must be 100=(2 raise to power 2)+(0 raise to power 1)+(0 raise to power 0)=4 If we want to give read+write then it will be 110=(2 raise to power 2)+(2 raise to power 1)+(0 raise to power 0)=6 If we want to give read+write+execute then it will be 111=(2 raise to power 2)+(2 raise to power 1)+(2 raise to power 0)=7 In three digit permission number, first denotes to owner, second denotes to group and third one denotes to others So if we want to give read+write+execute rights to owner, read+write rights to group and read rights to others, then it would be 764 and read+write+execute rights to everybody then it will be 777 Enjoy coding
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
Good one
solving two purpose one is for rights and other one is to convert from binary to Decimal number |
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
Quote:
|
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2011
Posts: 103
|
Thanks for another addons
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2011
Posts: 1
|
I am just adding to your data base of knowledge
Suppose you want to know which file was last edited out of hundreds files then use below command ls -ltrh The last modified file will be at bottom show , enjoy the result Thanks |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Aug 2011
Posts: 131
|
hmmmmmmmmmm informative
Welcome Rajesh |
|
|
|
|
|
#8 | |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
Quote:
Welcome to Forum. Keep posting. |
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2011
Posts: 1
|
Permission Groups are
u - Owner - owns the file g - Group - a member of the group that owns the file o - Other - neither the owner, nor belonging to the group that owns the file a - All Users Permission Types are read write execute Read permission Folder - one can check the content of a folder (ls command) but can not change directory (cd command) File - one can only able to read the file (cat command) Read and Write permission Folder - one can only do the same as mention above in read permission File - one can modify the content of file Read and Execute permission Folder - one can change the directory (cd command) but can not able to create folder (mkdir command) or file (touch command) under it. File - file became executable ALL permission Folder - one can check the content, change directory and create file & folder. File - one can read, modify and execute ls -l commond will display permissions of file and folder, something like the following -rwxr-xr-x - flag (start from left side) used for regular file and d flag used for directory. Next 3 flag is used to show the permission of owner. Next 3 flag for group permission and remaing 3 flag indicating the permission for other. To set/modify a file's permissions we need to use the chmod command and chmod command will be used to set permissions in either of two modes: Absolute Mode – Use numbers to add permissions or remove permissions. Absolute mode is the method most commonly used to set permissions. Symbolic Mode – Use combinations of letters and symbols to add permissions or remove permissions. Abolute mode is already explain by harry and sachin. so I am only describing symbolic mode through some example Add execute permissions for owner chmod u+x sandy Remove the execute permission from both the file's owner and group chmod ug-x sandy remove all the permissions but add read permission for everybody chmod a=r sandy |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
Very informative article, Sandy sir. Thanks for sharing.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|