Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Permission Types
Read r 4
Write w 2
Execute x 1
Full Permission rwx 7
• Root :
directory :- 755
file :- 644
• User :
directory :- 775
file :- 664
Umask
• Root : 022
• User : 002
• Eg :
777 – (default directory permission)
022
755
666 – (default file permission)
022
644
File -- # vi /etc/bashrc (Check Umask value)
#umask (checking umask value)
#umask <value>
Changing File Ownership
• It has 3 modes:
1. Insert Mode
2. Command Mode
3. Extended Mode
Insert Mode:
i--inserts the text at current cursor position
I - inserts the text at beginning of line
a - appends the text after current cursor position
A - appends the text at end of line
o - inserts a line below current cursor position
O - inserts a line above current cursor position
r - replace a single char at current cursor position
Command Mode:
dd - Deletes a line
ndd - Deletes n lines
yy - Copy a line
nyy - Copies n lines
p - After deleting or copying, by pressing p the deleted or
copied contents will be pasted below the position of
cursor.
P - pasted above the position of cursor.
u - Undo (can undo 1000 times)
U – Undo entire Line
Ctrl+r - Redo
G - Moves cursor to last line of file
5G - Moves cursor to 5th line of file
Command Mode:
gg – To go to the beginning of the page
w – To move the cursor forward, word by word
b -- To move the cursor backward, word by word
nw -- To move the cursor forward to n words
nb -- To move the cursor backward to n words
dw – To delete the word letter by letter (like backspace)
x-- To delete the word letter by letter (like delete)
/ -- To search a word in the file
Extended Mode:
:q - quit without saving
:q! - quit forcefully without saving
:w - save
:wq - save & quit
:wq! - save & quit forcefully
:x - save & quit
:X – To give password to the file and remove password
Shift+ZZ - save & quit
:sh - Provides temporary shell
Extended Mode:
:set number - Setting line numbers
:se nu - Setting line numbers
:set nonumber - Removing line numbers
:se nonu - Removing line numbers
:84 - Press enter goes to line 84