Navigation


RSS : Articles / Comments


ls

11:29 PM, Posted by कैलास बधान, No Comment

ls - list directory contents



DESCRIPTION
       List  information  about  the FILEs (the current directory by default).


-a, --all
              do not hide entries starting with .


       -A, --almost-all
              do not list implied . and ..


       --author
              print the author of each file


       -b, --escape
              print octal escapes for nongraphic characters


       --block-size=SIZE
              use SIZE-byte blocks


       -B, --ignore-backups
              do not list implied entries ending with ~


       -c     with -lt: sort by, and show, ctime (time of last modification of
              file status information) with -l: show ctime and  sort  by  name
              otherwise: sort by ctime


       -C     list entries by columns
-d, --directory
              list directory entries instead of contents

       -D, --dired
              generate output designed for Emacsâ dired mode

       -f     do not sort, enable -aU, disable -lst

       -F, --classify
              append indicator (one of */=@|) to entries

       --format=WORD
              across -x, commas -m, horizontal -x, long -l, single-column  -1,
              verbose -l, vertical -C

       --full-time
              like -l --time-style=full-iso

       -g     like -l, but do not list owner

       -G, --no-group
              inhibit display of group information

       -h, --human-readable
              print sizes in human readable format (e.g., 1K 234M 2G)

       --si   likewise, but use powers of 1000 not 1024

       -H, --dereference-command-line
              follow symbolic links on the command line

       --indicator-style=WORD append indicator with style WORD to entry names:
              none (default), classify (-F), file-type (-p)

       -i, --inode
              print index number of each file
-I, --ignore=PATTERN
              do not list implied entries matching shell PATTERN

       -k     like --block-size=1K

       -l     use a long listing format

       -L, --dereference
              when showing file information for a symbolic link, show informa-
              tion for the file the link references rather than for  the  link
              itself

       -m     fill width with a comma separated list of entries

       -n, --numeric-uid-gid
              like -l, but list numeric UIDs and GIDs

       -N, --literal
              print  raw entry names (donât treat e.g. control characters spe-
              cially)

       -o     like -l, but do not list group information

       -p, --file-type
              append indicator (one of /=@|) to entries

       -q, --hide-control-chars
              print ? instead of non graphic characters

       --show-control-chars
              show non graphic characters as-is  (default  unless  program  is
              âlsâ and output is a terminal)

       -Q, --quote-name
              enclose entry names in double quotes

       --quoting-style=WORD
              use  quoting style WORD for entry names: literal, locale, shell,
              shell-always, c, escape
 -r, --reverse
              reverse order while sorting

       -R, --recursive
              list subdirectories recursively

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

       -S     sort by file size

       --sort=WORD
              extension -X, none -U, size -S, time -t, version -v

              status -c, time -t, atime -u, access -u, use -u

       --time=WORD
              show time as WORD instead of modification time:  atime,  access,
              use,  ctime  or  status;  use  specified  time  as  sort  key if
              --sort=time

       --time-style=STYLE
              show times using style STYLE: full-iso, long-iso,  iso,  locale,
              +FORMAT

              FORMAT  is  interpreted  like  âdateâ; if FORMAT is FORMAT1
              line>FORMAT2, FORMAT1 applies to non-recent files and FORMAT2 to
              recent  files;  if  STYLE is prefixed with âposix-â, STYLE takes
              effect only outside the POSIX locale

       -t     sort by modification time

       -T, --tabsize=COLS
              assume tab stops at each COLS instead of 8

       -u     with -lt: sort by, and show, access time with  -l:  show  access
              time and sort by name otherwise: sort by access time

       -U     do not sort; list entries in directory order
 -v     sort by version

       -w, --width=COLS
              assume screen width instead of current value

       -x     list entries by lines instead of by columns

       -X     sort alphabetically by entry extension

       -1     list one file per line

       --help display this help and exit

       --version
              output version information and exit

Move(mv)

11:25 PM, Posted by कैलास बधान, No Comment

mv - move (rename) files

--backup[=CONTROL]
              make a backup of each existing destination file

       -b     like --backup but does not accept an argument

       -f, --force
              do not prompt before overwriting equivalent to --reply=yes

       -i, --interactive
              prompt before overwrite equivalent to --reply=query

       --reply={yes,no,query}
              specify how to handle the prompt about an  existing  destination
              file

       --strip-trailing-slashes remove any trailing slashes from each SOURCE
              argument

       -S, --suffix=SUFFIX
              override the usual backup suffix

cat

11:21 PM, Posted by कैलास बधान, No Comment

 cat - concatenate files and print on the standard output



DESCRIPTION
       Concatenate FILE(s), or standard input, to standard output.


       -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

csf options

3:36 PM, Posted by कैलास बधान, No Comment

[root@server ~]# csf -h
csf: v5.03 (cPanel)

ConfigServer Security & Firewall
(c)2006-2010, Way to the Web Limited (http://www.configserver.com)

Usage: /usr/sbin/csf [option] [value]

Option                Meaning
-h, --help            Show this message
-l, --status           List/Show iptables configuration
-s, --start            Start firewall rules
-f, --stop             Flush/Stop firewall rules (Note: lfd may restart csf)
-r, --restart          Restart firewall rules
-q, --startq          Quick restart (csf restarted by lfd)
-sf, --startf           Force CLI restart regardless of LF_QUICKSTART setting
-a, --add ip          Allow an IP and add to /etc/csf.allow
-ar, --addrm ip     Remove an IP from /etc/csf.allow and delete rule
-d, --deny ip         Deny an IP and add to /etc/csf.deny
-dr, --denyrm ip    Unblock an IP and remove from /etc/csf.deny
-df, --denyf           Remove and unblock all entries in /etc/csf.deny
-g, --grep ip          Search the iptables rules for an IP match (incl. CIDR)
-t, --temp              Displays the current list of temp IP entries and their TTL
-tr, --temprm ip     Remove an IPs from the temp IP ban and allow list
-td, --tempdeny ip ttl [-p port] [-d direction]
                            Add an IP to the temp IP ban list. ttl is how long to
                            blocks for (default:seconds, can use one suffix of h/m/d).
                           Optional port. Optional direction of block can be one of:
                            in, out or inout (default:in)
-ta, --tempallow ip ttl [-p port] [-d direction]
                    Add an IP to the temp IP allow list (default:inout)
-tf, --tempf        Flush all IPs from the temp IP entries
-cp, --cping        PING all members in an lfd Cluster
-cd, --cdeny ip     Deny an IP in a Cluster and add to /etc/csf.deny
-ca, --callow ip    Allow an IP in a Cluster and add to /etc/csf.allow
-cr, --crm ip       Unblock an IP in a Cluster and remove from /etc/csf.deny
-cc, --cconfig [name] [value]
                    Change configuration option [name] to [value] in a Cluster
-ccr, --cconfigr [name] [value]
                    Change configuration option [name] to [value] in a Cluster
                    and then restart csf and lfd
-w, --watch ip      Log SYN packets for an IP across iptables chains
-m, --mail [addr]   Display Server Check in HTML or email to [addr] if present
-c, --check         Check for updates to csf but do not upgrade
-u, --update        Check for updates to csf and upgrade if available
-uf                 Force an update of csf
-x, --disable       Disable csf and lfd
-e, --enable        Enable csf and lfd if previously disabled
-v, --version       Show csf version
[root@server ~]#

Whitelisting IP with CSF

5:24 PM, Posted by कैलास बधान, No Comment

How to whitelist the ip address with CSF :

csf -a ipaddress

Blocking IP with CSF

5:22 PM, Posted by कैलास बधान, No Comment

How to block the ip address with CSF :
[root@server]# csf -d ipaddress

CSF firewall and commands

5:06 PM, Posted by कैलास बधान, No Comment

Checking IP block with CSF :
Syntax : csf -g ipaddress


EX :

[root@server ~]# csf -g 190.161.18.37

Chain       num   pkts bytes target     prot opt in     out     source               destination

LOCALINPUT  109    881 46544 DROP       all  --  !lo    *       190.161.18.37        0.0.0.0/0

LOCALOUTPUT 104      0     0 DROP       all  --  *      !lo     0.0.0.0/0            190.161.18.37

csf.deny: 190.161.18.37 # lfd: (PERMBLOCK) 190.161.18.37 has had more than 4 temp blocks in the last 86400 secs - Wed Apr 28 14:58:04 2010
[root@server ~]#
OR


cat /etc/csf/csf.deny | grep ipaddress