Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Feb 132008
 

Export MySQL database as CSV file

Answer:

Export MySQL database CSV file can be done with the mysqldump command.

E.g.

# mysqldump my_db --fields-terminated-by=',' --fields-enclosed-by='"' --fields-escaped-by='\' --lines-terminated-by='\n' --tab /tmp

You will find the whole database my_db is exported under the /tmp folder, in which *.sql files are the table definiation, and *.txt files are the table's content in CSV format.

Feb 072008
 

Install sysstat for basic system monitoring

Answer:

sysstat is a very useful and minimal tool for basic system resources monitoring, e.g. system load average, memory usage, I/O utilization etc.

To install in Ubuntu,

# sudo apt-get install sysstat

To configure sysstat so it run continuously (as cron)

# sudo dpkg-reconfigure sysstat

Wait sometimes and try the following commands to see the collected statistics,

E.g.

1. Check system load average

# sar -q

2. Check memory usage

# sar -r

For more options,

# man sar

Jan 242008
 

Check current environment variables

Answer:

To check the current Linux's environment variables, use the set command

# set 

BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSION='3.2.39(1)-release'
COLUMNS=197
...