Shell

November 17, 2012 Leave a comment Go to comments
# CPU
grep processor /proc/cpuinfo # Anzahl von processor
less /proc/cpuinfo # Anzahl von processor
rpm -q centos-release # CentOS Version
cat /etc/redhat-release # CentOS Version
uname -a # "i686" means 32-bit. If it was 64-bit, it would be "x86_64"
top # zeigt die höchsten Ressourcenverbraucher an

shutdown -h now #
reboot # restart linux
df -h # free space
find / -name php.ini # Gezielte Suche nach Dateien
find . -type f |xargs grep nofollow
dos2unix filename
chmod 644 .htaccess # Die Datei muß für den HTTP-Server lesbar sein
fg # Prozess in den Vordergrund holen
cat /etc/passwd | grep redmine # User 'redmine' info
   redmine:x:500:500::/home/redmine:/bin/bash
less -> G #going to the last line
mv file file2 # renaming files
ps -ef | grep postgres #
rpm -ql ant # istet alle Dateien zu der Paketdatei
shutdown -i5 -g0 -y  # solaris
yum search php # paket suchen
chkconfig --list # List all known services

service --status-all # list running services
service --status-all | grep ntpd
service --status-all | less

# Oracle
http://www.drap.homelinux.com/wiki/index.php/Oracle_Befehle

# Apache
vi /etc/httpd/conf/httpd.conf
less /var/log/httpd/error_log
less /var/www/vhosts/****.de/statistics/logs/error_log # Plesk
/etc/init.d/httpd restart

# Java
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u6-b24/jdk-7u6-linux-i586.rpm"

# PHP
vi /etc/php.ini
pear config-show
pear list
echo '<?php phpinfo();?>' > /var/www/html/phpinfo.php
php -v # Show PHP version
php -m # Show compiled in modules 

# PostgreSQL
vi /var/lib/pgsql/data/pg_hba.conf
vi /var/lib/pgsql/data/postgresql.conf
su - postgres
psql -d template1 -U postgres
SELECT version();
\l - List the databases
\du - List the User

# MySQL
vi /etc/my.cnf
log=/var/log/sql.log
/etc/init.d/mysqld restart
less /var/log/mysqld.log
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('secret_password')

tail -n 30 -f /var/log/secure

# Mounting Windows shared folder on linux
mount -t cifs -o username=server_user,password=secret,rw,file_mode=0770,dir_mode=0770 //192.168.1.100/share /var/win_share
umount  /var/win_share

# RubyGems
gem list # LOCAL GEMS

Links

  1. No comments yet.
  1. No trackbacks yet.