Documente Academic
Documente Profesional
Documente Cultură
ls -l for listing the files as well as directories those are kept in the particular working directory syntax [root@nettech root]#ls -l .ls -la files. same as !ls -l!"ut "y this command we can also see the hiden
syntax [root@nettech root]#ls -la #.ls -li same as !ls -la! "ut it will also shows us the inode num"er of each and e$ery file syntax [root@nettech root]#ls -li %.ls "y this command we can see only file name nothing else
syntax [root@nettech root]#ls &.clear it will clear the screen'short cut ctl(l)
syntax [root@nettech root]#clear *.exit to end a current session as well current terminal logging
syntax [root@nettech root]#cd -home-mango where !-home-mango! is the desired directory to "e change from !-root! ..cat to $iew the contents of a file and it is also used for creating a new file with some contents
[root@nettech root]#cat 0 newfilename enter1then you can write something in the file and then to sa$e the file contents press clt(d then enter 12.mkdir syntax [root@nettech root]#mkdir newdirname you can also create a directory at your desired path without changing your present working directory syntax [root@nettech root]#mkdir -home-mango-newdirname 11.rm to remo$e a empty file to make a new directory
syntax [root@nettech root]#rmdir directoryname 1#.rm [-i--r--f] to remo$e a directory with its su"directories as well as its files that is to remo$e a directory which already contains some files in it syntax [root@nettech root]#rm -i directory-filename -i stands for interacti$ely -r stands for recursi$ely -f stands for forcefully 1%.cp syntax [root@nettech root]#cp sourcepath destinationpath example3 [root@nettech root]#cp -home-mango-we"min.rpm -root-a"cd in this example the we"min.rpm file will "e copied in -root-a"cd directory to copy something in a destination file or directory
1&.m$ to mo$e one file or directory from one place to another place1 it is also used for renaming adirectory or file . 4yntax [root@nettech root]#m$ source destination [root@nettech root]#m$ oldfilename newfilename 1*.man [to change the file name]
syntax [root@nettech root]#man commandname 1+.info to $iew the information a"out any command
syntax [root@nettech root]#mkdir info 1,.--help to $iew the help doccuments of a command
syntax [root@nettech root]#commandname --help 1..dir to $iew the su"directories and filesn under the directory
syntax [mango@nettech mango]5su output wil "e [root@nettech root#] 1.who "y this command you can see the user name and their ip addresses who ha$e loged in on your ser$er . 4yntax [root@nettech root]#who .whoami this command shows your current logged in terminal user name
syntax [root@nettech root]#whoami #.who am i this command shows you the logged in terminal num"er and user
syntax [root@nettech root]#rpm -i$h packagename.rpm rpm stands for !redhat package manager! -i stands for install -$ stands for $er"ose mode -h stands for with hash sign'#) *.rpm -6 to 6uerry a"out any rpm package
synatx [root@nettech root]#rpm -e package ,.find - -name to find any file or directory in linux file system syntax [root@nettech root]#find - -name filename ..su username to switch from one user to another users home directory syntax [root@nettech root]#su mango output will "e [mango@nettech root]#cd [mango@nettech mango]# #2.su - username directory directly to switch from one user to another user users home
#1.useradd
syntax [root@nettech root]#passwd tarun output will "e gi$e a password for user tarun3'here you ha$e to type a password for tarun user) confirm password3'again type the same password) ##.userdel to remo$e a user from linux
syntax [root@nettech root]#groupdel groupname #*.chown to change the ownership of a file or directory
syntax [root@nettech root]#chown ownername filename #+.chgrp to change the group ownership of a file or directory
syntax [root@nettec root]#chgrp newgroupownername filename example [root@nettech -]#ls -l drwxrw-rwtarun root %2.* 7ar 11 1 32# a"cd
[root@nettech root]#chgrp tarun -a"cd effect [root@nettech -]#ls -l drwxrw-rwtarun tarun %2.* 7ar 11 1 32# a"cd
#,.chmod drwxrw-rw-
to change the permission of a file or directory root root %2.* 7ar 11 1 32# a"cd 'name) 9:
'permission) 'ownr) 'grpownr) 'si8e) ;C<=> ?=>@A d stands for directiry r stands for read only permission w stands for write only permission x stands for execute only permission drwxrw-rwA<C.
4AC;:C <IBAA ;C<A< G;B @4AB ;B ;E:AB LAB79449;: 'rwx ;B + 9: ;C<=> ?=>@A) <I9BC <IBAA ;C<A< G;B HB;@L LAB79449;: 'rw- ;B * 9: ;C<=> ?=>@A) G;B<I <IBAA ;C<A< G;B ;<IAB4 LAB79449;: 'rw- ;B * 9: ;C<=> ?=>@A) 4J:<=F [root@nettec root]#chmod $alue fileordirectoryname example [root@nettech -]#ls -l drwxrw-rwtarun root %2.* 7ar 11 1 32# a"cd
[root@nettech -]#chmod %2 -a"cd [root@nettech -]#ls -l drw-----w%2.usermod tarun tarun %2.* 7ar 11 1 32# a"cd