Posts Tagged ‘linux’

How to import large .sql files into MySQL via shell?

Thursday, October 1st, 2009

If you seek to import a large MySQL file via the shell in Linux, the following command might be helpful to you:

shell>mysql -uusername -ppassword db_name < dumpfile.sql

If you are already running mysql, you can execute an SQL script file using the source or \. command:

mysql> source dump.sql
mysql> \. dump.sql

How to test a SVN commit?

Thursday, June 18th, 2009

Do a dry-run with:


svn merge --dry-run -r BASE:HEAD .

How to install Subversion client on cPanel

Thursday, June 18th, 2009

You can do it in console with:

# yum install subversion

and then you may get this error:

Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

To solve this do the following:
#wget ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/7/Everything/i386/os/Fedora/perl-URI-1.35-3.noarch.rpm
# rpm -i perl-URI-1.35-3.noarch.rpm
# yum install subversion

That’s it subversion client is successfully installed on your server you can check it using following command.
#svn --version

How to create a .tar.gz archive?

Wednesday, June 17th, 2009

Go inside the director you want to create an archive of and write:

# tar -czf archive.tar.gz *

The * means all the files. You can use other filters if you wish.

How to shutdown a Linux server?

Friday, June 12th, 2009

There are several options available:

1. Immediate shutdown

# shutdown -h 0


2. Delayed shutdown

# shutdown +5 "Server is going DOWN in 5 minutes"


3. Scheduled shutdown

# shutdown 1:00 "SERVER DOWN"
# shutdown 13:00 "SERVER DOWN"

How fast is SATA disk in Linux?

Friday, June 12th, 2009

To find out how fast is your HDD in linux use:


hdparm -tT /dev/sda

This measurement is essentially an indication of the throughput of the processor, cache, and memory of the system under test. Here is for loop to run test 3 time in a row:


for i in 1 2 3; do hdparm -tT /dev/sda; done

How to delete the .svn folders recursively?

Friday, June 12th, 2009

You can delete the .svn folders recursive by using the following command:


rm -rf `find . -type d -name .svn`