≡ Menu

shell scripts

HowTo: Unix / Linux Remove (Delete) OpenSSH Server

I'm new to Linux and my boss told me to remove ssh server as we don't need to provide the remote login and file transfer capabilities of SSH. How do I disable and remove OpenSSH server?
[click to continue…]

Linux / Unix: SysVinit Services Restart vs Reload vs Condrestart

Can you tell me differences between the following sysvinit /sbin/service command:

service httpd restart

service httpd condrestart

service httpd reload

[click to continue…]

Linux: What is Dash ( /bin/dash ) Shell?

What is /bin/dash? I noticed that the default system shell /bin/sh was changed to /bin/dash. Why was this change made?
[click to continue…]

UNIX / Linux: Increment The Date

I want to increment the date under UNIX or Linux operating system while writing shell scripts. For example Apr/27/2011 should be incremented as Apr/28/2011 and so on. How do I increment a date in UNIX or Linux shell?
[click to continue…]

Explains: echo Command (echo $”string”) Double-quoted String Preceded By a Dollar Sign

I noticed that many shell scripts in /etc/init.d/ directory use the following syntax:

echo $"Usage $prog start|stop|reload|restart"

Why a double-quoted string preceded by a dollar sign ($"string") using the echo command under Linux / UNIX bash scripts?
[click to continue…]

UNIX / Linux: Shell Scripting With mail Command

How do I send e-mails from a shell script including file attachments?
[click to continue…]

Linux incrond inotify: Monitor Directories For Changes And Take Action

I want to copy (rsync to remote server) a directory tree whenever file uploaded or deleted in /var/www/html/upload/ directory under Linux operating systems for backup purpose and/or load balancing purpose without getting into complex file sharing setup such as NFS or GFS iscsi storage. How do I monitor /var/www/html/upload/ and its subdirectory for new files and executes rsync command to make copy back to www2.example.com:/var/www/html/upload/?
[click to continue…]

HowTo: Use cat Command In Linux / UNIX

How do I use cat command in Linux? How do I use cat command in UNIX? How can I use cat command in UNIX or Linux shell scripts?
[click to continue…]

Iptables: Invert IP, Protocol, Or Interface Test With !

How do I invert a protocol or ip address test while writing iptables based shell scripts?
[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…]