Wednesday, January 4, 2012

necessary commands for multi function

[root@localhost named]#nano  /etc/issue                      (for editing welcome window)
[root@localhost named]#ls -l/ll                                     (for shows details of a file)
[root@localhost named]#ls  -a                                      (for shows hidden file)
[root@localhost named]#pwd                                       (for shows running directory)
[root@localhost named]#su  - username                       (for switch)
[root@localhost named]#vim  .bashrc  for alias  syntex- alias  c="clear screan"
[root@localhost named]#ls  -l  /home
[root@localhost named]#ID  username                          (for shows userID)
NB:  userID starts from 500-501-502 but root user by default  0
[root@localhost named]#pwd;ls                                   (for shows current directory & files both)
[root@localhost named]#cal-date-year
[root@localhost named]#date  --help
[root@localhost named]#month-date-time-minute-year.second
such as 092112372011.30
[root@localhost named]#cat   /proc/meminfo                         (for shows memory information)
[root@localhost named]#cd  /home/username                        (to access another user directory)
[root@localhost named]#touch   filename,filename,filename    (one more file creation both)
[root@localhost named]#mkdir   directory name
[root@localhost named]#mkdir  -p /dir1/die2
[root@localhost named]#touch   filename.txt
[root@localhost named]#cd..                                                (to switch in root directory)
[root@localhost named]#cd -                                                (to switch in previous directory)
[root@localhost named]#ls  -R                                              (directory name  for shows directory status)
[root@localhost named]#ls  -ld
[root@localhost named]#ll
[root@localhost named]#ls  -l
[root@localhost named]#ls  -a
[root@localhost named]#cp   source file/directory   destinationfile/directory
[root@localhost named]#mv  directoryname/filename     /directoryname/newname
[root@localhost named]#rm  sourcefile/directory   destinationfile/directory
NB: we can use always an absulate path   & a relative path to copy remove & editing
[root@localhost named]#type something  >> filename                    (to append anything)
[root@localhost named]#type something  > filename                      (to append anything)
[root@localhost named]#rm  -r                                                      (to delete a directory)
[root@localhost named]#rm  -r1                                                   (asking method to delete a file)
[root@localhost named]#rmdir   directoryname
[root@localhost named]#file    filename                                         (to see which type of file)
[root@localhost named]#cat  /etc/passwd
[root@localhost named]#cat  /etc/group
[root@localhost named]#cat  /etc/shadow
[root@localhost named]#cat   /etc/gshadow
[root@localhost named]#ls  -a                                                       (to show hide file)
[root@localhost named]#filename.bashrc                                       (to hide  a file)
[root@localhost named]#a  -rw  file/directory
i/a/o  go to insert
w   for word by word
[root@localhost named]#home  end   key                                       (go to end & first of a document)
 [root@localhost named]# gg (going to first )
[root@localhost named]#G  (going to  last)
[root@localhost named]#:set number   /no number/nonu  (to set  line number)
 [root@localhost named]#u  ( for undo)
[root@localhost named]#:3,5s/dog/cat  (to replace)
[root@localhost named]#:%s/dog/cat/gi   (to convert as a capital)
[root@localhost named]#ls  -il  dir/file  (to see with ID)
[root@localhost named]#poweroff
[root@localhost named]#shutdown  -h  n
[root@localhost named]#grep  -l word  filename  (to see  this word with  line)
[root@localhost named]#grep  -l  -v   word filename  (to see without  this word)
[root@localhost named]#showmount  -e  IP  (to see share of another one pc)
[root@localhost named]#cat  /etc/passwd  | grep  username
[root@localhost named]#grep  root  /etc/passwd
[root@localhost named]#wc   filename    #wc  -l  filename   # wc -w   filename  #wc  -c   filename  #wc   -m   filename
[root@localhost named]#mkdir   -said/{harun,abid,maruf,momin}/a.b.c.d.c}  (to creat  a directory  in some users directory)
[root@localhost named]#tr   'a-z'  'A-Z'  < sort.txt   (to convert as capital)
[root@localhost named]#echo filename  (to see at  screan)
[root@localhost named]#cat  filename  >> newfilename  (to append)
[root@localhost named]#cat  filename > filename  (to add contents of a file to another file)
[root@localhost named]#date  filename  > filename  (to replace)
[root@localhost named]#ls  | tr  'a-z'  'A-Z'
[root@localhost named]#echo  "testmail"  |  mail  -s 'test'  user@host
[root@localhost named]#echo  "testprint" |  1pr
[root@localhost named]#echo  "test print |1pr -p printername
[root@localhost named]#lpq  to see (default printer job)
[root@localhost named]#lpq  -p  printername
[root@localhost named]#lprm   job number  ( to remove a  job)
[root@localhost named]#lpr  -#number of copies
[root@localhost named]#mail  -s 'testmail'  momin@host     <<end
[root@localhost named]#ifconfig    eth0|eth1
[root@localhost named]#ifup   eth0/eth1  #ifdown   eth0/eth1
[root@localhost named]#setup
[root@localhost named]#vim   /etc/resolve.com
[root@localhost named]#system-config-date
[root@localhost named]#ps  -a   #ps  #ps  -au  #top
[root@localhost named]#df  -h  (to see as 1024 byte)
[root@localhost named]#df  -H  (to see as 1000 byte)
[root@localhost named]#updatedb  (to update database)
[root@localhost named]#locate dir/filename
[root@localhost named]#find  dir/filename
[root@localhost named]#system-config-network
[root@localhost named]#system-config-users
[root@localhost named]#userdel   username  #userdel   -r    usrname ( delete with homedirectory)
[root@localhost named]#w   ( last login) 
[root@localhost named]#last   
[root@localhost named]#last  -d  (to see remotely login status)
[root@localhost named]#usermod  -g  groupname  username  (to ch0ange  primary group)
[root@localhost named]#grep   username  /etc/passwd
[root@localhost named]#usermod   -d  /home/r10  username  ( to change users directory)
[root@localhost named]# top  (to see running process)
[root@localhost named]#
[root@localhost named]#
[root@localhost named]#
[root@localhost named]#
[root@localhost named]#
                           

No comments:

Post a Comment