Displaying keyword search results 1 - 3
Created by Dr. Xi on February 17, 2011 12:59:47 Last update: February 17, 2011 12:59:47
Operator Meaning -e file1 file1 exists -b file1 file1 is a block special file -c file1 file1 is a character special file -d file1 file1 is a directory -f file1 file1 is a regular -g file1 Set Group ID (sgid) bit is set for file1 -h file1 file1 is a symbolic link -k file1 Sticky bit is set for file1 -L file1 file1 is a symbolic link -p file1 file1 is a named pipe (FIFO) -r file1 file1 is readable by the current process -s file1 file1 has a size greater than zero. -t FileDescriptor FileDescriptor is open and associated with a terminal. -u file1 Set User ID (suid) bit is set for file1 -w file1 Write flag (w) is on for file1 -x file1...
Created by Dr. Xi on December 12, 2007 20:30:01 Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf :
LoadModule python_module modules/mod_python.so ...Python script:
import time, os from os.path import basename ...
Created by Dr. Xi on August 29, 2007 03:50:17 Last update: August 29, 2007 03:53:02
The command lsof lists all open files. Here are some simple uses: 1. List what files are in use by process with id 2512:
/usr/sbin/lsof -p 25122. To find the process that has /u/abe/foo open, use:
lsof /u/abe/foo3. To find who's accessing the CDROM:
$ /usr/sbin/lsof /media/cdrom COMMAND PID ...4. To list all files using any protocol on port 80:
lsof -i :80This is a link to the man page: http://www.netadmintools.com/html/lsof.man.html