≡ Menu

shell script

UNIX Source Command: Read And Execute Commands From File

What is the use of UNIX source command under bash or any other shell? How do I use source command under UNIX / OS X / Linux operating systems?
[click to continue…]

Reboot Linksys WAG160N / WAG54 / WAG320 / WAG120N Router / Gateway

I‘m using a Cisco Linksys WAG320N Router to connect my OS X UNIX and Linux systems to the Web. How do I reboot my Linksys WAG series router / gateway (modem) from UNIX / Linux / OS X bash command prompt or using a shell script?
[click to continue…]

Bash Shell Generate Random Numbers

How do I create or generate random numbers (sequence of numbers that lack any pattern), under Bash shell?
[click to continue…]

Iptables Limits Connections Per IP

How do I restrict the number of connections used by a single IP address to my server for port 80 and 25 using iptables?
[click to continue…]

Linux fdupes: Get Rid (Delete) Of Double Duplicate Files In Directory

How do I find duplicate files in a given set of directories and delete them using a shell script or a command line options? How do I get rid of double duplicates files stored in ~/foo and /u2/foo directory on a Linux operating systems? How can I remove duplicate files on a Linux based server?
[click to continue…]

Bash: Continue In a For / While Loop

How do I continue in a for or while loop in Bash under UNIX or Linux operating systems?
[click to continue…]

Linux Iptables: Add / Delete An IP Address Remotely Using A Shell Script

I’ve root ssh access and need to add / delete a few IP address on fly using the IPtables command via local shell script. How do I add or delete an IP address remotely over the SSH session under CentOS / Redhat / RHEL / Debian / Ubuntu Linux?
[click to continue…]

How To Use awk In Bash Scripting

How do I use awk pattern scanning and processing language under bash scripts? Can you provide a few examples?
[click to continue…]

UNIX Get An Alert When Disk Is Full

I want to get an alert when my disk is full under UNIX and Mac OS X? How do I set a a specified threshold and run the script via cron?
[click to continue…]

Shell Script While Loop Examples

Can you provide me a while loop control flow statement shell script syntax and example that allows code to be executed repeatedly based on a given boolean condition?
[click to continue…]