Archive for November, 2008

Copy / Paste files and folders.
– copy a file
~# cp filename1 filename2
A copy from filename1 is created in the same directory
~# cp /home/myweb/filename1 /home/hisweb/filename2
Creates a copy from filename1 into another directory and name filename2
To copy a folder use the -r ( recursive option )
~# cp -r folder1 folder2
~# cp -r /home/myweb/folder1 /home/hisweb/folder2

To copy and preserve the user and group rights use the -p flag
~# cp -rp filename 1 filename2
To show all options type:
~# cp –help

 

To move a file or to rename a file use:
~# mv filename1 filename2
For folders addd the -r ( recursive ) flag
~# mv -r folder1 folder2

 

To create a dump file use the following syntax:

/var/lib/mysql # mysqldump -u root -p mysqldatabase > backup.sql

You will be prompted for the password and the backup file will be created.

————————————————————————-

To restore a backup dump file use the following syntax:

/var/lib/mysql # mysql -u root -p mysqldatabase < backup.sql

You will be promted for the password and the backup will be restored.

 

To change date and time on your shell manually you need type the following code:

~# date --set 2008-11-19
~# date --set 15:25:0

Make sure to respect the syntax.
 

I experienced this problem on VPS Debian 4.0 Etch:

——————————————————————————-
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
——————————————————————————-

Locale is a framework to switch between multiple languages for users who
can select to use their language, country, characters, collation order,
etc.

I noticed that i couldn’t install the Squirrelmail language modules.
How to fix:

~# apt-get update
~# apt-get upgrade
~# apt-get install locales
~# dpkg-reconfigure locales

Now i experienced that the reconfigure script was bugging and needed
do it manually:

~# ln -s /usr/share/i18n/SUPPORTED /etc/locale.gen
~# locale-gen

It takes a little eternity but afterwards your system is updated and
supports multiple languages.