To shutdown the system at a particular time
# shutdown -h hours:minutes &
To find the files with an extension .html,
# locate \*.html
To list the files having SUID configured in the system, use the command:
# find / -perm -u+s
Its All About to Share...
To shutdown the system at a particular time
# shutdown -h hours:minutes &
To find the files with an extension .html,
# locate \*.html
To list the files having SUID configured in the system, use the command:
# find / -perm -u+s
To shutdown the system at a particular time
# shutdown -h hours:minutes &
To find the files with an extension .html,
# locate \*.html
To list the files having SUID configured in the system, use the command:
# find / -perm -u+s
| Syntax | Description | Example(s) |
| rpm -ivh {rpm-file} | Install the package | rpm -ivh mozilla-mail-1.7.5-17.i586.rpm rpm -ivh --test mozilla-mail-1.7.5-17.i586.rpm |
| rpm -Uvh {rpm-file} | Upgrade package | rpm -Uvh mozilla-mail-1.7.6-12.i586.rpm rpm -Uvh --test mozilla-mail-1.7.6-12.i586.rpm |
| rpm -ev {package} | Erase/remove/ an installed package | rpm -ev mozilla-mail |
| rpm -ev --nodeps {package} | Erase/remove/ an installed package without checking for dependencies | rpm -ev --nodeps mozilla-mail |
| rpm -qa | Display list all installed packages | rpm -qa rpm -qa | less |
| rpm -qi {package} | Display installed information along with package version and short description | rpm -qi mozilla-mail |
| rpm -qf {/path/to/file} | Find out what package a file belongs to i.e. find what package owns the file | rpm -qf /etc/passwd rpm -qf /bin/bash |
| rpm -qc {pacakge-name} | Display list of configuration file(s) for a package | rpm -qc httpd |
| rpm -qcf {/path/to/file} | Display list of configuration files for a command | rpm -qcf /usr/X11R6/bin/xeyes |
| rpm -qa --last | Display list of all recently installed RPMs | rpm -qa --last rpm -qa --last | less |
| rpm -qpR {.rpm-file} rpm -qR {package} | Find out what dependencies a rpm file has | rpm -qpR mediawiki-1.4rc1-4.i586.rpm rpm -qR bash |
| Syntax | Description | Example(s) |
| rpm -ivh {rpm-file} | Install the package | rpm -ivh mozilla-mail-1.7.5-17.i586.rpm rpm -ivh --test mozilla-mail-1.7.5-17.i586.rpm |
| rpm -Uvh {rpm-file} | Upgrade package | rpm -Uvh mozilla-mail-1.7.6-12.i586.rpm rpm -Uvh --test mozilla-mail-1.7.6-12.i586.rpm |
| rpm -ev {package} | Erase/remove/ an installed package | rpm -ev mozilla-mail |
| rpm -ev --nodeps {package} | Erase/remove/ an installed package without checking for dependencies | rpm -ev --nodeps mozilla-mail |
| rpm -qa | Display list all installed packages | rpm -qa rpm -qa | less |
| rpm -qi {package} | Display installed information along with package version and short description | rpm -qi mozilla-mail |
| rpm -qf {/path/to/file} | Find out what package a file belongs to i.e. find what package owns the file | rpm -qf /etc/passwd rpm -qf /bin/bash |
| rpm -qc {pacakge-name} | Display list of configuration file(s) for a package | rpm -qc httpd |
| rpm -qcf {/path/to/file} | Display list of configuration files for a command | rpm -qcf /usr/X11R6/bin/xeyes |
| rpm -qa --last | Display list of all recently installed RPMs | rpm -qa --last rpm -qa --last | less |
| rpm -qpR {.rpm-file} rpm -qR {package} | Find out what dependencies a rpm file has | rpm -qpR mediawiki-1.4rc1-4.i586.rpm rpm -qR bash |
Go_GrEen^ThiNk_GReeN~LoVE_GreEn - PushkarGo_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar
Go_GrEen^ThiNk_GReeN~LoVE_GreEn - PushkarGo_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar
find . -type f | xargs grep stringfind . -type f -printf '"%p"\n' | xargs grep stringfind . -type f -print0 | xargs -0 grep string
Today I came across a neat, but pointless shell command. By running the following in shell, it will hide any commands you run.
root@server2 [/]# stty -echo
In order to disable this mode, simply remove the “-” before echo.
root@server2 [/]# stty echo
I guess there really is no point to the command, though you could always mess with your coworkers if they leave their shell prompt open
This is really the most handy tool for mysql databases. A built in mysqldump can be used via shell to dump mysql databases within a few minutes. Sometimes dumping backups using phpmyadmin is too hazardous. So it’s really a necessary tool and fast too. I have listed this commands and i believe this should be useful to lots of system admins
mysqldump -uuser -pmysqluserpassword database_name > database_name.sql
mysql -uuser -pmysqluserpassword database_name < database_name.sql
Netstat command Shows network status.
netstat [-g | -m | -p | -s | -f address_family ] [-n] [-P protocol]
netstat [ -i ] [ -I interface ] [ interval ]
netstat -r [-a] [-n] [-v ]
netstat -M [-n] [-s ]
netstat -D [ -I interface ]
-a | Show the state of all sockets and all routing table entries; normally, sockets used by server processes are not shown and only interface, host, network, and default routes are shown. |
-n | Show network addresses as numbers. netstat normally displays addresses as symbols. This option may be used with any of the display formats. |
-v | Verbose. Show additional information for the sockets and the routing table. |
-g | Show the multicast group memberships for all interfaces. |
-m | Show the STREAMS statistics. |
-p | Show the address resolution (ARP) tables. |
-s | Show per-protocol statistics. When used with the -M option, show multicast routing statistics instead. |
-i | Show the state of the interfaces that are used for TCP/IP traffic. |
-r | Show the routing tables. |
-M | Show the multicast routing tables. When used with the -s option, show multicast routing statistics instead. |
-d | Show the state of all interfaces that are under Dynamic Host Configuration Protocol (DHCP) control. |
-D | Show the status of DHCP configured interfaces. |
-f address_family | imit statistics or address control block reports to those of the specified address_family, which can be one of:
|
-P protocol | Limit display of statistics or state of all sockets to those applicable to protocol. |
- I interface | Show the state of a particular interface. interface can be any valid interface such as ie0 or |
Examples:
netstat
Displays generic net statistics of the host you are currently connected to.
netstat -an
Shows all connections to the server including the source and destination ips and ports if you have proper permissions.
netstat -rn
Displays routing table for all ips bound to the server.
netstat -an |grep :80 |wc -l
Display all active connections on port 80.
© 2009 Servertechs · Proudly powered by Blogger & Servertechs 2 by Prisha.