Linux commands




The best ways to run all files from a folder in SqlPLus
Create a file and store all of the file names from the folder:
ls -l > list.sql
Edit and set @ before each file name
vi list.sql
1,$s/^/@/

sqlpus ich/foo@mydb
@list.sql

Convert latin1 to UTF-8 in MySQL
$ mysqldump -h localhost –user=myName -p –default-character-set=latin1 -c \
–insert-ignore –skip-set-charset dbname > dump.sql
$ iconv -f ISO-8859-1 -t UTF-8 dump.sql > dump_utf8.sql

Find out which charset is my file

$ iconv -f 8859-1 -t utf-8 FILE1> FILE2
$ iconv -f utf-8 -t 8859-1 FILE2 > FILE3
$ diff FILE1 FILE3

apt-get –purge remove NameOfPackage
apt-get install –reinstall NameOfPackage
z.B:
apt-get –purge –reinstall install apache2.2-common apache2
apt-get install –reinstall libapache2-mod-php5 php5-cli php5-common php5-cgi

dpkg-reconfigure xserver-xorg
update-alternative -config x-session-manager

lpstat -t
cancel
lpadmin -p lj -E

PSI=’\u@\h:\n$’

wget -c –user=user –password=passwd http://hostname…

find -name ‘*.[ch]‘ | xargs grep -E ‘expr’
find -type f -print0 | xargs -r0 grep -F ‘example’

find . -exec grep “use GD” ‘{}’ /dev/null \; -print
find . -name “*.pl” -type f -exec grep “use GD” ‘{}’ /dev/null \; -print

Only get diffs. Do multiple times for troublesome downloads:
rsync -P rsync://rsync.server.com/path/to/file file

Post your comment

Captcha
Enter the letters you see above.