Thursday, December 13, 2012

Quick Command U must always Remember.

To begin playing with your CentOS6 or Terminal, you need to remember all the simple-simple commands that you will always used to code. As oldest always said "Practise make Perfect", it's actually no doubt. You must remember all the commands or else you will loose ur track or lost in what you are doing later.

This is all the commands that i have used ::

1. THE NOTED ::
1. /etc/hosts (for pc internet connection) 
2. postfix (e-mail connection touch)
3. varchar - variable character
4. console/konsole/terminal/shell/exterm (same term)
5. in my localhost :: 'dora' is my shell user
6. centOS save energy (click mouse in blank then press spacebar)
7. Vbox have snapshot to restore the last backup system.
8. sudo < used in MAC terminal. no function but some system 
   direct edit w/o sudo is not allowed 
9. Print skrin on MAC : control-shift-4, click SPACEBAR to kamera
   icon and clikc ENTER.
10.Cant put any active web in /root .
11.cmd IRC :: /ctcp [nick] version

2. TERMINAL COMMAND ::
1. ping ( to test IP)
2. ping -c 4
3. ls 'this command to see files ls . depend on directory.
4. cd 'this command used to go into files.
5. scp [filename] dora@192.168.56.10:/home/dora 'cmd to transfer file to server.
6. pwd (print work directory) 'command use to see directory.
7. mkdir [filename] 'create new folder
8. scp dora@192.168.56.10:/home/dora/BNC* . 'or
9. scp dora@192.168.56.10:/home/dora/BNC.docx . 'cmd to take file from server.
10./exec -o df -h |grep home
11.w
12.check safari :: safari & / whereis safari

3. USED WHILE BUILD UP LOCALHOST (server) ::

1. ls /etc/sysconfig
2. ls /etc/sysconfig/network-scripts
3. cat /etc/sysconfig/network-scripts/ifcfg-eth0
4. dhclient eth0
5. ifconfig eth0
6. ifconfig eth1
7. ifconfig (see how much we have eth) 
8. ifconfig |grep inet ' grep = choose.
9. ifconfig -a |grep inet
10.dmesg |grep eth (check all eth)
11.ifconfig eth1 up :: using nano - /sbin/ifconfig eth1 up (permanent up)
12./sbin/ifconfig eth1 192.168.56.10 netmask 255.255.255.0 broadcast 
   192.168.56.255    (set mask ip for localhost)


4. SETTING UP PHP/MYSQLD/APACHE:: from terminal and root
1. rpm -qa (look for ls download)
2. rpm -qa |grep php (look for ls php that have been dl)
3. cd /var/www/html
4. cat info.php
5. yum install wget
6. rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-r elease-0.5.2-7. el6.rf.i686.rpm
7. yum install phpmyadmin
8. /sbin/service mysqld start
9. /sbin/service httpd start
10.apachectl reload
11.apachectl restart
12.chkconfig --list |grep mysql
13.chkconfig mysqld on 14.chkconfig --list |grep httpd


5. ROOT :: ROOT/USER
1. ssh (to connect to server) 
   ex :: ssh root@server / ssh dora@server
2. su - (change/switch user to root)

6. SERVER COMMAND
1. rm -f ( delete file/folder )< this cmd should use with careful
2. adduser [name] 'this is command to adduser in linux.
3. passwd [user] 
4. userdel [name] 'this is command to delete user.
5. yum install 
6. mv = rename folder
   ex :: mv [oldfoldername] [newfoldername]
7. tar cjf [folder/filename.tar.bz2] [folder/filename] <- compress
8. tar xjf [folder/file name] <- decompress
9. mkdir -p public_html/smf <= make new directory
10.ls -l (to see what you have install)
11.ls -s 
12.uname -an <- will show the system you're in.


7. NANO EDITOR

noted :: when you used nano for editing, enter new line from the last command line to type your new command then reboot.
1. nano test (test nano)
2. cntl x :: to save
3. cntl r :: editing
4. cat test 
5. nano -w /etc/rc.local (set ip)
6. nano -w /etc/sysconfig/selinux 'changed.
   SELINUX=enforcing => SELINUX=disabled
7. nano -w /etc/httpd/conf.d/phpmyadmin.conf7. 
   Deny from all > Allow from all
8. nano -w /usr/share/phpmyadmin/config.inc.php
   $cfg['blowfish_secret'] = ''; (fill in the blank)
   ex :: $cfg['blowfish_secret'] = 'airbatucampur';
9. nano -w /etc/my.cnf
10.sudo nano -w /etc/resolv.conf (terminal) 'for dns 

8. FILES BACKUP (on system)
cmd::
1. cd VirtualBox\ VMs/
2. /VirtualBox VMs$ tar cjf CentOS6-`date '+%d-%B-%Y'`.tar.bz2 CentOS6/
3. /VirtualBox VMs$ ls |grep bz2
   ... to check folder size.
4. /VirtualBox VMs$ du -ms CentOS6-23-November-2012.tar.bz2
5. /VirtualBox VMs$ du -ms CentOS6 

9. CHANGE IP TO OTHER WORD ex:server|vbox|centOS|urname
noted : do in MAC.

1. cat /etc/hosts
2. sudo nano /etc/hosts
3. last line add like this :: 192.168.56.10   server
4. save . cntrl x 

10. CHANGE DIRECTORY FOLDER NAME ON SERVER
1. login user << in centOS
   [dora@localhost ~]$ pwd
2. su - [go to root]
   [root@localhost dora]# pwd
   /home/dora
3. cd /var/www/html
4. ls -l 'to locate location.
5. ln -s /home/dora/public_html/ www

*** with the two cmd above, no. 9 and 10, my URL will be like this:
    http://server/www/newproject.. . 


noted :: command will be update when new command is used. :)

No comments:

Post a Comment