RSS

Useful Linux Commands……

09 Jan

General Information
# cat /proc/version  (Linux Version)
# cat /proc/meminfo (Memory Information)

Zip File/Folder in Linux
# zip -9 -r <zip file> <folder name>
# zip -9 <zip file> <filename>
Use “-9? for best compression. The compressed file works fine with Windows XP compression tool.

Execute Shell Script
# chmod x+ file.sh
# ./file.sh

System User
# useradd -d /var/www wwwuser
# passwd wwwuser
# userdel wwwuser
# userdel -r wwwuser

List loaded Modules
# lsmod

Extract here
# tar -xvzf latest.tar.gz -C ./(folder name)
# unzip file.zip

Upload site with zipped version
# zip -9 -r /var/www/html/html.zip /var/www/html
# wget http://75.101.199.175/html.zip
# unzip html.zip
# cd /root/var/www/html
# mv * /var/www

Create shortcuts in linux
# rm -rf /var/www/
# ln -sf /var/scalr/app/www /var/
# chmod a+rX -R /var/www
# ln -sf /var/log/apache2 /var/www/logs

Compute Load
# uptime   (1,5,15 minute)
# w
# top
* CPU usage
* ‘uptime’ for load average
* ‘top’ for an overall system view
* ‘iostat’ for storage I/O statistics
* ‘netstat’ for network statistics
* ‘mpstat’ for CPU statistics
* ‘tload’ for display an ncurses graphic of the recent load

Linux Ports/processes
# netstat -an
# lsof -i
# nslookup www.*.com
# ps aux | grep mysqld
# netstat -an
# netstat -an | grep 3306

Updrage php 5.2.x
cd /etc/yum.repos.d
wget http://remi.collet.free.fr/rpms/remi-fedora.repo
yum –enablerepo=remi update mysql
yum –enablerepo=remi update php
apachectl restart

Others
# whereis  file
# locate filename
# find / -name filename
# shutdown -r now (restart)

Advertisements
 
1 Comment

Posted by on January 9, 2009 in Linux, php, resources

 

Tags: , ,

One response to “Useful Linux Commands……

  1. mical

    July 1, 2009 at 5:20 am

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: