Posts

Showing posts from 2015

VI Editor basic usage

vi filename.txt

Press insert button to activate editing mode.To quit without saving :q!   and enterTo save file :wq!

Transfer files to Remote server using SCP commands

Pulling files from server to local machine 1. Cd /home/manoj/workingdir
2. scp -r username@198.168.0.138:/var/www
3. password :*******

-r Recursively copy entire directoriesTransfer file from local machine to server 1. Cd /home/manoj/workingdir

2. scp filename.php username@198.168.0.138:/var/www
3. password :*******





SQL Important queries

Fetch record in ASC or DESC order 


//DECENDING ORDER
SELECT * FROM mytablename ORDER BY id DESC 

//ASSENDING ORDER
SELECT * FROM mytablename ORDER BY id ASC

//WITH LIMIT 
SELECT * FROM mytablename ORDER BY id DESC LIMIT 50


How to fetch last 50 records from table

SELECT * FROM ( SELECT * FROM mytablename ORDER BY id DESC LIMIT 50 )sub ORDER BY id ASC 

Update column fields using update commands 

UPDATE tablename SET devicemodel='Data what you want to replace' where devicemodel='HUAWEI G730-U00' 



Use Delete commands 

DELETE FROM Persons WHERE FirstName = 'Peter'