Monday, March 28, 2011

chmod linux command

chmod command is used to change the file access permission.


Simple example:



1) chmod 644 file1.txt
This gives the file read/write by the owner and only read by everyone else (-rw-r--r--).


2) chmod 755 file2.txt
This gives the file read/write/execute by the owner and read/execute by others (-rwxr-xr-x).




Syntax:
chmod [permission] file name


options:


-c, --changes    : report only when a change is made

-f,  --quiet       : suppress most error messages
      --help        : display this help and exit
-R,  --recursive : change files and directories recursively

-v,  --verbose   : output a diagnostic for every file processed




Permissions:
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.


r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.






Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)


200 write by owner
020 write by group
002 write by anybody


100 execute by owner
010 execute by group
001 execute by anybody

Monday, February 14, 2011

chgrp linux command


The chgrp command is used to change the group that has access to files and directories. All files in linux belong to an owner, and a group. The owner is set by the chown command, and the group by the chgrp command.
Syntax:
chgrp newgroup filename(s) [-options]
Options :
       -c, --changes
              like verbose but report only when a change is made
       --dereference
              affect the referent of each symbolic link, rather than the symbolic link itself (this is the default)
       -h, --no-dereference
              affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)
       --no-preserve-root do not treat '/' specially (the default)
       --preserve-root
              fail to operate recursively on '/'
       -f, --silent, --quiet
              suppress most error messages
       --reference=RFILE
              use RFILE's group rather than the specifying GROUP value
       -R, --recursive
              operate on files and directories recursively
       -v, --verbose
              output a diagnostic for every file processed
       The  following  options modify how a hierarchy is traversed when the -R option is also specified.  If more than one is specified, only the final
       one takes effect.
       -H     if a command line argument is a symbolic link to a directory, traverse it
       -L     traverse every symbolic link to a directory encountered
       -P     do not traverse any symbolic links (default)
       --help display this help and exit
       --version
              output version information and exit
Examples:
       1) chgrp tech /file.txt
              Change the group of /file.txt to "tech".
       2) chgrp -hR tech /file.txt
              Change the group of /file.txt and subfiles to "tech".


      

cat linux command

The cat command's primary function is to concatenate, or join, files, but you can also use it to display a file on the screen. The cat command takes one or more files that you specify, smashes them together, and then sends the resulting file to the standard output device (without changing any of the original files). The standard output device is your screen, but by using the greater-than (>) operator, you can redirect cat's output to another file. 


Syntax :


cat [option] [file name]


Options :
      -A, --show-all
              equivalent to -vET


       -b, --number-nonblank
              number nonblank output lines


       -e     equivalent to -vE


       -E, --show-ends
              display $ at end of each line


       -n, --number
              number all output lines


       -s, --squeeze-blank
              never more than one single blank line


       -t     equivalent to -vT


       -T, --show-tabs
              display TAB characters as ^I


       -u     (ignored)


       -v, --show-nonprinting
              use ^ and M- notation, except for LFD and TAB


       --help display this help and exit


       --version
              output version information and exit



Examples:



cat test.txt
Display the test.txt file on the screen.

cat test1.txt test2.txt
Join the files test1.txt and test2.txt and then displayt he result on the screen.

cat test1.txt test2.txt > test3.txt
Join the files test1.txt and test2.txt and save them in the file test3.txt.


what is port scan

A port scan is a series of messages sent by someone attempting to break into a computer to learn which computer network services. Essentially, a port scan consists of sending a message to each port, one at a time. The kind of response received indicates whether the port is used and can therefore be probed for weakness.



Types of port scans include:
  • vanilla - An attempt to connect to all ports (there are 65,536)
  • Strobe - An attempt to connect to only selected ports (typically, under 20)
  • Stealth scan - Several techniques for scanning that attempt to prevent the request for connection being logged
  • FTP Bounce Scan - Attempts that are directed through an File Transfer Protocol server to disguise the cracker's location
  • Fragmented Packets - Scans by sending packet fragments that can get through simple packet filters in a firewall
  • UDP - Scans for open User Datagram Protocol ports
  • Sweep - Scans the same port on a number of computers

cal linux command

Cal command displays a simple calendar.  If arguments are not specified, the current month is displayed.



Syntax :


     cal [options] [[month] year]


cal Options :


     The options of cal command are as follows:


     -1      Display single month output.  (This is the default.)


     -3      Display previous, current and next month output.


     -s      Display Sunday as the first day of the week.  (This is the default.)


     -m      Display Monday as the first day of the week.


     -j      Display Julian dates (days one-based, numbered from January 1).


     -y      Display a calendar for the current year.


Examples :


1) cal 2012
This example gives the calendar of the year 2012.
2) cal -3 9 2011
This example gives an output calendar of one month before and after September 2011.
3) cal 6 2011
It will gives the calender of june 2011.

Wednesday, February 2, 2011

bc linux command

You may be using bc command in command line for calculations. It can also be used for batch mode calculations as explained below.


Syntax
bc [-c] [-l] [file]




To perform addition using bc command

echo "56.8 + 77.7" | bc




Another way of executing bc calculation

bc <<< 4+2




Let say you want to convert decimal to hexadecimal, you can do this.
echo "obase=16; ibase=10; 56" | bc




A simply way to do calculation with floating point
echo 2/5 | bc -l

Wednesday, January 12, 2011

Limiting size of emails sent with CPanel?

You can restrict sending and receiving mails which are exceeding a certain size limit with cpanel by adding the line "message_size_limit" on your exim configuration file(exim.conf).



Example:


How can you restrict sending and receiving emails exceeding a size limit of 10MB?

Add this in the first part of your exim.conf file

message_size_limit = 10M

This setting should restrict both incoming and outgoing attachments over 10MB.

Tuesday, January 11, 2011

CSF IP block removal

1) How to remove temporary ip block:
you can ckeck /var/log/lfd.log file to find whether the ip is blocked or not, by using
grep <ip> /var/log/lfd.log

If it blocked you need to do the following step to remove that block
csf -tr <blocked ip>


Then you must restart the csf firewall.
csf -r




2) How to remove permanent ip block:
you can check /etc/csf/csf.deny file to find whether the ip is blocked or not.
grep <ip> /etc/csf/csf.deny

If it blocked you need to do the following step to remove that block
csf -dr <blocked ip>

Then you must restart the csf firewall.
csf -r

Saturday, January 8, 2011

grep linux command

Find the lines that are matching for a given string from the specified file.


Syntax:


grep <option> "pattern" /path/of /file/to/be/searched


Example:


grep root /etc/passwd – The command searches for the pattern root in the file /etc/passwd and print the lines that matches the pattern.



grep -c /bin/tcsh /etc/passwd - List the number of users who use tcsh

grep -l '^#include' /usr/include/* - List header files that have at least one #include directive


Options:




-c, --count
              It prints a count of matching  lines for  each  input  file.



 -n, --line-number
              Print each line of output with the line number within its input
              file.



-o, --only-matching
              Show only the part of a matching line that matches the pattern.



-R, -r, --recursive
              Read all files under each directory, recursively; this is equiv-
              alent to the -d recurse option.



mkdir linux command

Linux command to create a new directory. mkdir command creates a new directory if it does not already exist.


Syntax


mkdir [option] new directory name


Example:


mkdir mydir - This would create a new directory called mydir.


mkdir -p /test/mydir – This would create a directory mydir in test directory and if test directory does not exists it would create test directory and then the directory mydir.


mkdir -m 444 atom - This would creates a directory 'atom' with read only permission to all.


Options:



-m, --mode
              add access permission for newly created directory.
-p, --parents
              creates the new directory in the parent directory if exist, otherwise make parent directories as needed

-v, --verbose
              It prints a message like "created directory"  for each newly created directory.

ls linux command



Ls command is used to list the contents of a directory. If no directory names are given, list the files in the current directory otherwise list the files in the given directory.



Examples

ls -l
In the above example this command would list each of the files in the current working directory and the files permissions, the size of the file, date of the last modification, and the file name or directory.

Syntax


ls [option] /path/of/directory


Options


-a, --all
do not hide entries starting with ‘.’(show all hidden files)


-l,  --file-details
use a long listing format.


-d, --directory
list directory entries instead of contents


-i, --inode
with -l, print the index number of each file


-r, --reverse
reverse order while sorting

-R, --recursive
list subdirectories recursively

-s, --size
with -l, print size of each file, in blocks

-S, --sort
sort by file size

-t, --sort
sort by modification time

-v, --sort
sort by version

-X, --sort
sort alphabetically by entry extension

-1, --line
list one file per line

Thursday, January 6, 2011

FTP linux directory structure

ProFTPD:

Program :/usr/sbin/proftpd

Init Script :/etc/rc.d/init.d/proftpd

Conf: /etc/proftpd.conf

Log: /var/log/messages, /var/log/xferlog

FTP accounts file – /etc/proftpd/username – all ftp accounts for the domain are listed here


Pure-FTPD:

Program : /usr/sbin/pure-ftpd

Init Script :/etc/rc.d/init.d/pure-ftpd

Conf: /etc/pure-ftpd.conf

Anonymous ftp document root – /etc/pure-ftpd/ip-address

ssh, perl, php directory structure

SSHD:

Program :/usr/local/sbin/sshd

Init Script :/etc/rc.d/init.d/sshd

/etc/ssh/sshd_config

Log: /var/log/messages



Perl:

Program :/usr/bin/perl

Directory :/usr/lib/perl5/5.6.1/



PHP:

Program :/usr/local/bin/php, /usr/bin/php

ini file: /usr/local/lib/php.ini – apache must be restarted after any change to this file

mysql directory structure

Program : /usr/bin/mysql

Init Script : /etc/rc.d/init.d/mysql

Conf : /etc/my.cnf, /root/.my.cnf

Data directory – /var/lib/mysql – Where all databases are stored.

Database naming convention – username_dbname (eg: john_sales)

Permissions on databases – drwx 2 mysql mysql

Socket file – /var/lib/mysql/mysql.sock, /tmp/ mysql.sock

Exim directory structure

Conf : /etc/exim.conf – exim main configuration file

/etc/localdomains – list of domains allowed to relay mail

Log : /var/log/exim_mainlog – incoming/outgoing mails are logged here

/var/log/exim_rejectlog – exim rejected mails are reported here

/var/log/exim_paniclog – exim errors are logged here

Mail queue: /var/spool/exim/input

Cpanel script to restart exim – /scripts/restartsrv_exim

Email forwarders and catchall address file – /etc/valiases/domainname.com

Email filters file – /etc/vfilters/domainname.com

POP user authentication file – /home/username/etc/domainname/passwd

catchall inbox – /home/username/mail/inbox

POP user inbox – /home/username/mail/domainname/popusername/inbox

POP user spambox – /home/username/mail/domainname/popusername/spam

Program : /usr/sbin/exim (suid – -rwsr-xr-x 1 root root )

Init Script: /etc/rc.d/init.d/exim

dns directory details

DNS – Named(Bind):

Program: /usr/sbin/named

Init Script(daemon): /etc/rc.d/init.d/named

/etc/named.conf - configuratuon file

db records:/var/named/

/var/log/messages - dns log files

Apache directory details

/usr/local/apache

+ bin- apache binaries are stored here – httpd, apachectl, apxs

+ conf – configuration files – httpd.conf

+ cgi-bin -

+ domlogs – domain log files are stored here

+ htdocs - default document_root of  apache

+ include – header files

+ libexec – shared object (.so) files are stored here – libphp4.so,mod_rewrite.so

+ logs – apache logs – access_log, error_log, suexec_log

+ man – apache manual pages

Cpanel script to restart apache – /scripts/restartsrv_httpd

Start httpd with ssl – /etc/init.d/httpd startssl

Wednesday, January 5, 2011

cpanel scripts

    * adddns - Adds a DNS zone.
    * addfpmail - Add frontpage mail extensions to all domains without them.
    * addfpmail2 -Add frontpage mail extensions to all domains without them.
    * addnetmaskips - Add the netmask 255.255.255.0 to all IPs that have no netmask.
    * addnobodygrp - Adds the gorup nobody and activates security.
    * addpop - Add a Pop Account.
    * addservlets - Add JSP support to an account (requires tomcat).
    * addstatus - (Internal use never called by user).
    * adduser - Add a user to the system.
    * admin - Run WHM Lite.
    * apachelimits - Add rlimits to Apache.
    * betaexim - Installs the latest version of exim.
    * biglogcheck - looks for logs nearing 2 gigabytes in size
    * bsdcryptoinstall - Installs crypto on FreeBSD.
    * bsdldconfig - Configures the proper lib directories in FreeBSD.
    * bsdpkgpingtest - Tests the connection speed for downloading FreeBSD packages.
    * buildbsdexpect - Install expect on FreeBSD.
    * buildeximconf - Rebuilds exim.conf.
    * buildpostgrebsd-dev - Installs postgresql on FreeBSD.
    * chcpass - (Internal use)
    * checkallowoverride -
    * checkbadconf - Checks /usr/local/apache/conf/httpd.conf for bad users.
    * checkbsdgroups - Checks and repairs proftpd ownership on FreeBSD.
    * checkccompiler - Checks to make sure the C compiler works on your system.
    * checkfpkey - Checks for the FrontPage suid key
    * checkgd - Checks to see if GD is built.
    * checkinterchange - (Internal use).
    * checklibssl - Checks to make sure the proper libssl symlinks exist.
    * checkmaxclients - Checks to see if apache has reached the maximum clients allowed.
    * checkoldperl - Checks to see if the version of Perl on your system is old.
    * checkrsync - Checks to make sure rsync is up to date.
    * checksuexecpatch - Checks to see if mailman has been patched for suexec.
    * checksuspendpages - Checks to see if suspend pages are properly named.
    * checkup2date - Makes sure up2date is set up properly (RedHat)
    * checkyum - Makes sure yum is set up properly.
    * chkpaths - Makes sure /usr/sbin/chown has a symlink to /bin/chown
    * chownpublichtmls - Change ownership of all users web space to them, which is useful for converting to suexec. Files owned by nobody are deleted.
    * chpass - Change password.
    * ckillall - Allows you to kill a process (used like killall).
    * ckillall2 - Allows you to kill a process.
    * cleanbw - Cleans up old bandwidth logs.
    * cleandns8 - Clean up named.conf.
    * cleangd - Cleans up old GD installs and reinstalls GD
    * cleanmd5 - Fix CPAN md5 problems.
    * cleanmsglog - cleans exim's msglog
    * cleanupmysqlprivs - Cleans up improper mySQL privileges.
    * compilers - Disables the usage of compilers for unprivileged users.
    * convert2maildir - Converts mail from mbox to maildir format and installs courier impap and pop (cpimap is removed).
    * courierup - Updates/Installs Courier
    * cpbackup - Runs backups.
    * distupgrade - Upgrades RedHat to the newest version (for testing only)
    * dnscluster - Enables DNS clustering.
    * dnsqueuecron - Adds a cron job to dump the DNS queue.
    * dnstransfer - Only if the server has a DNS master (sync with DNS master).
    * dotbuffer - (INTERNAL)
    * downgradefp - Downgrades FrontPage Extensions (to 5.0-0)
    * dropmysqldb - Drops a mySQL database.
    * easyapache - Upgrade Apache
    * editquota - Change a users quota.
    * enablechkservdwebmail - Enable service checking of webmaild.
    * enablefileprotect - Protects home directories if file protection is built in apache.
    * ensurepkg - Installs a FreeBSD package.
    * ensurerpm - Installs a rpm.
    * exim3 - Installs exim 3.
    * exim4 - Installs exim 4.
    * exim4-rh73test - Installs exim release #260. (RedHat only)
    * eximcron - Creates a cron job for exim_tidy_db.
    * eximlocalsend - Enables/Disables exim local sending.
    * exim_tidydb - Cleans the exim message log.
    * eximup - Installs/Updates exim.
    * fetchgd - Includes libg.so.
    * findhacks - Search for common Trojan Horses.
    * findoddrootprocesses - Lists root processes that may need to be checked out.
    * findphpversion - Check to see if your php version file is up to date.
    * findtrojans - Exhaustive Trojan Horse search.
    * fixallcartswithsuexec - Fixes permissions on carts when using suexec.
    * fixallinterchangeperm - Fixes permissions on all users' Interchange Shopping Carts.
    * fixbinpath - Makes sure all bin file paths are correct.
    * fixbuggynamed - Updates bind to solve any problems with bugs.
    * fixcartwithsuexec - (INTERNAL) - Can be used to fix a cart with suexec.
    * fixcommonproblems - Attempt to fix the most common problems.
    * fixetchosts - Fixes problems with /etc/hosts
    * fixeverything - Fix common problems and quotas.
    * fixfpwml - Fix for .wml errors with frontpage.
    * fixheaders - Run if nothing compiles errors with .h files on compile.
    * fixinterchange - Reinstall interchange Perl modules.
    * fixinterchangeperm - fix permissions on a user's interchange cart.
    * fixipsnm - Same as addnetmask ips, but Perl though.
    * fixlibnet - Reinstall Bundle::libnet (Perl).
    * fixlocalhostwithphp - Change /etc/hosts to work better with PHP 4.2.0 + MySQL.
    * fixmailman - Updates and restarts mailman.
    * fixmysql - Fixes problems with mySQL.
    * fixmysqlbsd - Fixes problesm with mySQL on FreeBSD.
    * fixnamed - Updates bind to handle many DNS zones (more than 512).
    * fixndc - Repair redhat's broken named.conf on 7.2.
    * fixoldlistswithsuexec - Run after enabling suexec on the server to change the URLs that Mailman gives out to ones that don't give a 500 internal server error.
    * fixperl - Symlink /usr/local/bin/perl /usr/bin/perl.
    * fixperlscript - Makes sure a perlscript includes all corresponding modules.
    * fixpop - Fix a POP account and reset password.
    * fixproftpdconf - Fixes problems with /usr/local/etc/proftpd.conf
    * fixproftpddupes - Updates proftpd.
    * fixquotas - Fix quotas.
    * fixrndc - Fixes named.conf to prevent rndc staus failed.
    * fixspamassassinfailedupdate - Reinstalls a failed spamassassin update.
    * fixsubconf -
    * fixsubdomainlogs - Run if subdomain logs don't show up in cPanel.
    * fixsuexeccgiscripts - Fix CGI scripts that are broken after suexec installed.
    * fixvaliases - Fix permisions on valiases.
    * fixwebalizer - Repair a Webalizer that has stopped updating.
    * fp3 - Updates the fpexe3 patch.
    * fpanonuserpatch - Updates FrontPage extensions to include the anonymous user patch.
    * ftpquaotacheck - Runs quota checking for all ftp users.
    * ftpup - Updates your ftp server.
    * fullhordereset - Resets Horde and displays the current Horde password.
    * futexfix - Fixes problesm with futex.
    * futexstartup - Starts futex.
    * gcc3 - Installs gcc-3.3.3
    * gencrt - Generate a .crt and .csr file.
    * grpck - Checks to see if grpck is working properly.
    * hackcheck - (INTERNAL)
    * hdparmify - Enable dma/irq/32bit HD access, which speeds up IDE drives.
    * hdparmon - Turns on hdparm.
    * HTTPreq.pm - (INTERNAL)
    * httpspamdetect -
    * icpanel - (OLD)
    * initacls - Mounts your file systems with ACL support (make sure your kernel supports ACLs)
    * initbyteslog - (INTERNAL)
    * initfpsuexec - Enable FrontPage suexec support.
    * initquotas - Turn on quota support on new drives.
    * initsslhttpd - Make sure HTTP starts with SSL.
    * initsuexec - Turn on suexec support if suexec is installed.
    * installaimicq - (INTERNAL)
    * installcgipm - Installs CGI.pm
    * installcpbsdpkg -
    * installcpgentoopkg -
    * installdbi - Install Bundle::DBD::mysql.
    * installfpfreebsd - Installs FrontPage 5 Extensions on FreeBSD.
    * installfpgentoo - Installs FrontPage on Gentoo.
    * installgd - Builds GD.
    * installipc - (INTERNAL)
    * installpkg - Installs a FreeBSD package.
    * installpostgres - Installs PostrgeSQL.
    * installrmmods - (OLD)
    * installrpm - Installs a rpm.
    * installrpm2 - (INTERNAL)
    * installspam - Install SpamAssassin.
    * installssl - Add a SSL vhost.
    * installtree -
    * installzendopt - Install zend optimzer.
    * installzendopt-freebsd - Install zend optimizer on a freebsd machine.
    * ipcheck - (INTERNAL)
    * ipusage - (INTERNAL)
    * isdedicatedip - Checks an ip to see if it is dedicated.
    * kernelcheck - (INTERNAL)
    * killacct - Delete an account.
    * killbadrpms - Security script that kills insecure RPMs from the server.
    * killdns - Delete a DNS zone.
    * killdns-dnsadmin -
    * killdrrootvhost - Removes the document root for a virtual host.
    * killndbm - Remove the broken NDBM_File module from 7.2.
    * killpvhost - Removes a virtual host from proftpd.conf.
    * killspamkeys - Removes a spam key.
    * killsslvhost - Removes a SSL entry for a virtual host.
    * killvhost - Delete a vhost.
    * listcheck - Checks mailing lists for issues.
    * listproblems - Lists common problems.
    * listsubdomains - List subdomains.
    * mailadmin - (DEAD, OLD)
    * maildirmenu - (INTERNAL)
    * mailman212 - (INTERNAL)
    * mailperm - Fix almost any mail permission problem.
    * mailscannerupdate - Updates MailScanner
    * mailtroubleshoot - Guided mail fix.
    * makecpphp - Installs php.
    * makesecondary - Part of DNS transfer.
    * manualupcp - Updates cPanel manually.
    * md5crypt - Encrypts a password into MD5.
    * mkquotas - OLD
    * mkwwwacctconf - (INTERNAL)
    * mrusersscpcmd -
    * mseclocal - Sets up Mandrake's msec to allow exim to run as mailnull.
    * mysqladduserdb - Create a MySQL databse and user.
    * mysqlconnectioncheck - Attempts to connect to MySQL, restarts SQL if necessary.
    * mysqldeluserdb - Delete a MySQL databse and user.
    * mysqlinfo - (OLD)
    * mysqlpasswd - Change MySQL password.
    * mysqlrpmpingtest - Checks your connection speed for downloading mySQL rpms.
    * mysqlup - Updates mySQL.
    * mysqlup~ - (INTERNAL)
    * ndbmcheck - Checks to see if the nbdm module is loaded (kills in RedHat 7.2)
    * netftpsslpatch - PAtches FTPSSL.pm.
    * newdomains - (OLD)
    * newdomains-sendmail - (OLD)
    * newexim - Installs the latest version of exim.
    * newftpuser - (NOT USED)
    * newpop - (NOT USED)
    * nofsck - Make fsck always use -y
    * nomodattach - Removes mod_attach from httpd.conf.
    * nomodauthmysql -Removes mod_auth_mysql from httpd.conf.
    * nomodbwprotect - Removes mod_bwportect from httpd.conf.
    * nomodgzipconfmods - Removes mod_gzip from httpd.conf.
    * nomodperl - Removes mod_perl from httpd.conf.
    * oldaddoncgi2xaddon - Updates old addons to X addons.
    * park - Parks a domain.
    * patcheximconf - Fixes exim.conf.
    * pedquota - (INTERNAL) - Part of editquota (for editting quota).
    * perlinstaller - Installs perl.
    * phpini - Create a php.ini file.
    * pingtest - Checks your download time from cPanel mirrors.
    * pkgacct - backup an account
    * pkgaccount-ala - backs up an Alab*nza account for transfer.
    * pkgacct-ciXost - backs up a ci*ost account for transfer.
    * pkgacct-dXm - backs up a d*m account for transfer.
    * pkgacct-enXim - backs up an en*im account for transfer.
    * pkgacct-pXa - backs up a p*a account for transfer.
    * proftpd128 - Installs proftpd-1.2.8.
    * ptycheck - Fixes permissoins on /dev/ptmx.
    * pwck -Verifies the integrity of system authentication information.
    * quickkernel - Updates your kernel.
    * quicksecure - Quickly kill useless services.
    * rebuildcpanelsslcrt - Rebuilds the cPanel SSL Certificate.
    * rebuildcpusers - Rebuilds /var/cpanel/users.
    * rebuildetcpasswd - Rebuilds /etc/passwd.
    * rebuildeximbsd - Rebuilds exim on FreeBSD.
    * rebuildhttpdconffromproftpd - Rebuild httpd.conf from the proftpd.conf file.
    * rebuildinterchangecfg - Used after moving a domain with Interchange to the server.
    * rebuildippool - (INTERNAL)
    * rebuildnamedconf - Restore named.conf from files in /var/named.
    * rebuildproftpd - Restore proftpd.conf from httpd.conf.
    * reinstallmailman - Reinstalls mailman.
    * relocatevartousr - Relocates files from /var to /usr in case of disk space issues.
    * remdefssl - Remove default SSL vhost.
    * reseteximtodefaults - Resets exim's default settings.
    * resethorde -
    * resetimappasswds - Resets all imap passwords.
    * resetmailmanurls -
    * resetquotas - Change quotas to what they should be .
    * restartsrv - Restart a service.
    * restartsrv_apache - Restart apache.
    * restartsrv_bind - Restart bind.
    * restartsrv_clamd - Restart clamd.
    * restartsrv_courier - Restart courier imap.
    * restartsrv_cppop - Restart cppop.
    * restartsrv_entropychat - Restart entropy chat.
    * restartsrv_exim - Restart exim.
    * restartsrv_eximstats - Restart exim statistics.
    * restartsrv_ftpserver - Restart your ftp server.
    * restartsrv_httpd - Restart httpd.
    * restartsrv_imap - Restart impad.
    * restartsrv_inetd - Restart inetd.
    * restartsrv_interchange - Restart Interchange Shopping Cart.
    * restartsrv_melange - Restart melange chat.
    * restartsrv_mysql - Restart mysqld.
    * restartsrv_named - Restart named.
    * restartsrv_postgres - Restart postgresql.
    * restartsrv_postgresql - Restart postgresql.
    * restartsrv_proftpd - Restart proftpd.
    * restartsrv_pureftpd - Restart pure-ftpd.
    * restartsrv_spamd - Restart spamd.
    * restartsrv_sshd - Restart sshd.
    * restartsrv_syslogd - Restart syslogd.
    * restartsrv_tomcat - Restart tomcat.
    * restartsrv_xinetd - Restart xinetd.
    * restoremail - Restores a user's mail.
    * reswhostmgr - Restart whostmgr.
    * rpmup - Upgrade redhat/mandrake errata/security.
    * rrdtoolinstall - Installs RRD Tool.
    * runstatsonce - Runs statistics (should be used from the crontab).
    * runweblogs - Run analog/webalizer/etc. for a user.
    * safeperlinstaller - Installs perl safely.
    * safeup2date - Runs up2date safely.
    * safeyum - Runs yum safely.
    * secureit - Remove unnecessary suid binaries.
    * securemysql - Attempts to secure the MySQL configuration.
    * securetmp - Adds securetmp to system startup.
    * setupfp - Install FrontPage 3 on an account.
    * setupfp4 - Install FrontPage 4 (2000) installer on an account.
    * setupfp5 - Install FrontPage 5 (2002) installer on an account.
    * setupfp5.nosueuxec - Install FrontPage 5 (2002) installer on an account when not using suexec.
    * setupmakeconf -
    * showexelist - Shows exe processes.
    * simpleps - Display the process list.
    * smartcheck - Checks hard drive integrity.
    * smtpmailgdionly - Enables SMTP Mail Protection.
    * spamboxdisable - Disables SpamAssassin's spambox delivery for all accounts.
    * suspendacct - Suspends an account.
    * sysup - update cPanel RPMs.
    * unlimitnamed - Installs the latest version of bind patched to support greater than 512 ips on the server.
    * unblockip - Unblocks an IP blocked by portsentry.
    * unsetupfp4 - Removes FrontPage 4 or 5 from an account.
    * unslavenamedconf - If the user accidentally sets a DNS master as local server, this will repair named.conf after the loop.
    * unsuspendacct - Unsuspends an account.
    * upcp - Updates cPanel.
    * updated - Updates /scripts.
    * updatefrontpage - Updates FrontPage
    * updatemysqlquota -
    * updatenow - Updates /scripts NOW.
    * updatephpconf - Updates PHP configuration files.
    * whoowns - Finds out who owns a domain.
    * wwwacct - Creates an account.
    * xaddonreport - Reports the current addon scripts installed.

Tuesday, January 4, 2011

pwd command in linux

pwd - Print the full directory path of the current working directory.


Syntax :

pwd [option]


Options : 

pwd command has only two options

--help - To display help message
and
--version - To display the version



Example:

# cd /usr/local/lib/ - brings you to the corresponding directory.
Then by giving pwd command without any option you can see the output like.
/usr/local/lib

cd linux command

cd - To change the current directory.

Syntax :
cd /path/to/the/directory


cd .. :  Used to go back one directory on the majority of all Unix shells. It is important that the space between the cd and the ..

Examples:


cd hope 
The above example would go into the hope directory if it exists.

cd ../home/users/computerhope
The above example would go back one directory and then go into the home/users/computerhope directory.

cd ../../
Next, the above example would go back two directories.

cd
Finally, typing just cd alone will move you into the home directory. If you're familiar with MS-DOS and how typing cd alone prints the working directory. Linux and Unix users can print the working directory by using the pwd command.

Linux Directory Structure

Click on this link for Linux Directory Structure

History Of Linux

Click here for the history of Linux

Sunday, January 2, 2011

at command

at command executes or edit commands scheduled for a later time


Syntax : 



at [-f filename] [-m] -t time [date] [-l] [-r]




Examples :
at 5pm Tuesday -f commands.txt


In this example the at command will run a job as specified in a commands.txt file on following Tuesday at 5pm 



at -l = This command will list each of the scheduled jobs as seen below.

1072250520.a Wed Dec 24 00:22:00 2003



at -r 1072250520.a = Deletes the job just created.

Options :

-f         Specify the pathname of a file to be used as the source of the at-job, instead of standard input.

 -l        (The letter ell.) Report all jobs scheduled for the invoking user if no at_job_id operands are specified. If  at_job_ids  are  specified, report only information for these jobs. The output shall be written to standard output.

 -m     Send  mail  to  the invoking user after the at-job has run, announcing its completion. Standard output and standard error produced by the
              at-job shall be mailed to the user as well, unless redirected elsewhere. Mail shall be sent even if the job produces no output.



-r          Delete the job  that you have set in the past.

-date  Specifies in what date you wish to run the command job. We can use date in the  format month, date, year. The following formats can also be used.

today - Indicates the current day.
tomorrow - Indicates  the day following the current day.




-t       Specifies at what time you want run the command. hh:mm. am / pm time format or 24-hour time format can be used.

The following time formats can also be used

midnight - Indicates the time 12:00 am (00:00).
noon - Indicates the time 12:00 pm.
now - Indicates the current day and time. Now submit an at-job for immediate execution.