Short/Long Linux useful commands

See mysql speed log:

tail -n 1000 mysql-slow.log |less

Restart Apache/MySQL

sudo /etc/init.d/apache2 restart

sudo /etc/init.d/mysql restart

php.ini location

sudo /etc/init.d/apache2 restart

error log location

sudo tail -20 /var/log/apache2/error.log (it would return only last 20 row/lines from the error log file)

Sort file1 alphabetically and store the sorted data into file2

sort file1 >> file2

Remote Login To Any Windows System Within Local Network Area

rdesktop IPA.DDR.E.SS

shutdown -s (to stop accessing the remote system)

To find and replace text within the current document

nano text.txt

Ctrl \
Enter your search term [press return]
Enter your replacement term [press return]
A [to replace all instances]

Change mysql password in Ubuntu PHP

1. sudo /etc/init.d/mysql stop
2. sudo mysqld –skip-grant-tables &
3. mysql -u root mysql
4. UPDATE user SET Password=PASSWORD(‘mysql’) WHERE User=’root’; FLUSH PRIVILEGES; exit;

Mount any local server to Ubuntu

sudo mount.cifs //192.168.0.45/dir_name/ /mnt/ -o username=unm

It would then ask for the password of that system or server to authenticate.

 

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Advertisements
%d bloggers like this: