Linux Commands Examples
find Search files and folders crontab Schedules the jobs ls Directory listing iptables Firewall netstat Connection status
Articles for Linux
find Search files and folders crontab Schedules the jobs ls Directory listing iptables Firewall netstat Connection status
How to create NFS Share on CentOS NFS services should be install check the services service nfs status which folder you want to share for Example /home/ISOFiles NFS share information kept in /etc/exports file so edit the file and add your share information nano /etc/exports add the line for your share and the host or … Read more
1- how to transfer files between linux servers over ssh #scp source username@destination ip:/destination path For example :- I want to transfer files from local linux machine to remote linux server over ssh #scp abc.tar root@192.168.1.1:/var/ How to transfer files between Windows to Linux over ssh. download winscp from link http://winscp.net/eng/download.php Install winscp Login to … Read more
SSH Session recording script If you want to record your root ssh session create a file .bash_profile . and copy below line by line change the email address where you want to recive the SSH log mail. nano /root/.bash_profile CURDATE=$(date +%F-%T) RAND=$RANDOM EMAILS=”user@example.com otherrecipient@example.com” script -f -q /tmp/session-$USER-$CURDATE-$RAND.log for EMAIL in $EMAILS; do cat “/tmp/session-$USER-$CURDATE-$RAND.log” … Read more
Backup in Linux $ tar cvf backup.tar . C = create an archive V = verbose mode f = file name . = current directory Display the content of tar file $ tar tvf backup.tar t = table of content To extract tar file $ tar xvf backup.tar X = extract Using tar with compression … Read more
How to install ntop on CentOS Follow the following steps 1- Install rpmforge repository: http://wiki.centos.org/AdditionalResources/Repositories/RPMForge Choose your CentOS vesion and install rpmforge repository 2- # yum install ntop 3- There is a bug in the /etc/init.d/ntop startscript we need to fix. # nano /etc/init.d/ntop change the line at start function from: daemon $prog -d -L … Read more
How to Bind Multiple IP Addresses to a Single Network Interface Card (NIC) Network card information are located in /etc/sysconfig/network-scripts/. Go into that directory. cd /etc/sysconfig/network-scripts/ The file we’re interested in is ifcfg-eth0, the interface for the Ethernet device. Let’s assume we want to bind three additional IP’s (10.34.10.1, 10.34.10.2, and 10.34.10.3) to the NIC. We … Read more
Step by Step Cacti installation for Monitoring on Cent OS Login as root Create the yum repository to install cacti through yum #cd /var # mkdir download # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm # rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt # rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm #yum update Install required component for Cacti # yum install mysql-server mysql php-mysql php-pear php-common php-gd php-devel … Read more
How to install SNMP client on Cent OS / Linux Login as root # yum install net-snmp-utils Rename the snmpd.conf # mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org # nano /etc/snmp/snmpd.conf copy and paste below line rocommunity public syslocation “Your Datacenter” syscontact support@yourdomain.com save the file and exit Start the SNMP service on linux # /etc/init.d/snmpd start # chkconfig … Read more