Linux Commond
Linux Commond
17. userdel (username) =delete the user (IN USERNAME U HAVE TO ADD USERNAME WHICH
YOU HAVE TO DELETE)
18: GROUP:- Group is collection of users that provide the user the group of
security and privillages
HOW TO CREAT A GROUP- groupadd groupname
TO GET THE GROUP- getent groupname, less /etc/group, cat
/etc/group
TO DELETE THE GROUP- groupdel "groupname"
HOW TO ADD A USER TO GROUP- usermod -a -G "groupname" "username"
TO VIEW USER IN GROUP- id "username", NOT WORKING=id -nG
HOW TO ADD MULTIPLE GROUP TO USER- usermod -a -G "groupname1","groupname2"
"username"
HOW CHANGE USER GROUP- usermode -G "groupname" "username"
OCTEL VALUES:
OCTAL VALUES READ WRITE EXECUTE
7 READ WRITE
EXECUTE
6 READ WRITE
5 READ EXECUTE
4 READ EXECUTE
3 WRITE EXECUTE
2 WRITE
1 EXECUTE
0
20.To creat new text file: vi text.txt (where text is file name)
21. to get out from vi : press ESC and then :q
22.to insert the vi screen: :i
23.to change the permisiom: :chmod 777 file name (first seven-owner
/ second 7=group / third 7=user)
24.TO write and quit: : to write and quit
25.change ownership file diectory :chown "username" "filename"
26.Regular to root: :sudo su ~
27.to asign group: :chown :"groupname" "filenames"
28.to verify: : ls -l
29.to change the owner :chgrp "groupname" "filename" (this
commond is used to change group ownership of given file )
chgrp chown
1.we only change group ownership 1. this common changes
ownership of both user and group
(by using c=chown "�sername":"groupname" file name)
REMOVE A FILE
96.rm :to remove a file
97.rm "filename1" "filename2" : to remove multiple files
98.rm *.file extention :to remove all extention file given by
user
99.rm -i filename :it will ask you before deleting
100.rm -f "filename" :if you dont want comfirmation prompt
while removing file(force remove)
REMOVE A DIRCTORIES
101.rm -d "directoryname" : to remove a empty directory
102.tree "direcotry name" :if u want to remove tree direcory
103.rm -r "direcortyname" :if you u want to remove parent
direcories along with its subdirecories (work with non empty direcory)
104.rm -d -i "direcory name" :to get promp msg
105. rm -d -f "direcooryanme" :to delete forcefully
106.rm -rf "direcoryname" :write protected direcotry to be remove
107.rmdir "direccortyname" :to remove folder
108.rmdir -p a1/a1/a3 :to remove whole path tree
MV CP
1.mv cammond is used to move or rename the file but it will 1.this will
copy file but will not delete original file
delete oeriginal file while cmoving
MV VERSUS RENAME
RENAME MV
1.Rename cammond is more advanced than mv cammomd we can 1.in mv we can not
use regular expression it is a basic cammond which used for rename
use regular expression in this
FIND LOCATE
FIND GREP