≡ Menu


Unix / Linux: Maximum Character Length of Arguments In a Shell Command

What is the maximum character length of arguments in a shell command? How do I find out the maximum length of arguments for a new process under Linux or Unix like operating systems?
[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…]

Linux / UNIX: TZ Environment Variable

What is the correct format for a TZ (time zone) environment variable for use with the Linux or UNIX operating system?
[click to continue…]

Linux / UNIX: Convert Epoch Seconds To the Current Time

How do I convert Epoch seconds to the current time under UNIX or Linux operating systems?
[click to continue…]

Linux Date Command: Convert Named Stats Dump Date

The rndc stats commands created /var/named/chroot/var/named/data/named_stats.txt file under RHEL 5.x or CentOS 5.x BIND 9 server. However, date is not is correct format. The date is in the following format:
grep 'Dump' /var/named/chroot/var/named/data/named_stats.txt

+++ Statistics Dump +++ (1263408025)
--- Statistics Dump --- (1263408025)
+++ Statistics Dump +++ (1263408071)
--- Statistics Dump --- (1263408071)
+++ Statistics Dump +++ (1268304218)
--- Statistics Dump --- (1268304218)
+++ Statistics Dump +++ (1268304248)
--- Statistics Dump --- (1268304248)

How do I convert date (e.g., 1263408025) in a human readable format?
[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…]

Q. When I run make install clean for php5-extensions port, I'm dumped with the following error:

===> php5-posix-5.2.6 has known vulnerabilities:
=> php -- input validation error in posix_access function.
Reference: < http://www.FreeBSD.org/ports/portaudit/ee6fa2bd-406a-11dd-936a-0015af872849.html >
=> Please update your ports tree and try again.
*** Error code 1

Stop in /usr/ports/sysutils/php5-posix.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.

How do I fix this error?
[click to continue…]

Linux / UNIX killing a process and restarting the same

Q. How do I kill a process called inetd or foo and restart the same so that configuration file get updated?

A. Both UNIX and Linux supports POSIX reliable signals and POSIX real-time signals. Each signal has a current disposition, which determines how the process behaves when it is delivered the signal.

Generally following command is used
kill -1 process-pid

First get pid of inetd:
ps -e | grep inetd
Now force read inetd.conf:
kill -1 xinetd-pid

You can also use pkill command used to send signals. The pkill command allows the use of extended regular expression patterns and other matching criteria.
pkill -HUP process-name

Make syslog reread its configuration file
# pkill -HUP syslogd

Make xinetd reread its configuration file
# pkill -HUP inetd

Understanding command line shell

Q. I’ve migrated from Windows NT to Linux workstation. Most documents refer to a command line shell. Can you explain me command line shell?

A. A shell allows you to type the commands such as date or clear. There are many shell available. BASH (bourne again shell) is default shell for most Linux distributions.

It also known as a command interpreter which takes command from user and pass the same to kernel for execution. Bash shell supports aliases, filename completion, command history, POSIX compatibility and many other features.

Other UNIX / Linux shell

  • csh / tcsh
  • sh / ksh

Where is My Linux GNU C or GCC Compilers Are Installed?

Where is my GNU C compiler? Where does the GNU C (gcc) compiler reside in the RHEL / Fedora / Debian / Ubuntu / CentOS Linux installation? How do I install GNU c/c++ compiler in Linux operating systems?
[click to continue…]