Displaying keyword search results 71 - 80
Created by Dr. Xi on September 26, 2008 22:13:05 Last update: September 26, 2008 22:13:05
The SHELL environment variable is set to your login shell after you log in. It doesn't change even when you spawn a different sub-shell:
$ echo $SHELL /bin/ksh $ bash [peache...
Created by Dr. Xi on September 26, 2008 21:49:35 Last update: September 26, 2008 21:51:53
The ulimit command (builtin for bash ) controls resource limits available to the shell and subprocesses. ulimit -a displays all current limits.
peaches@peachesv:~$ ulimit -a core file siz...ulimit accepts options -H and -S , which specifies hard or soft limit. The resource options are listed below: Option Description -a All current limits are reported -c The maximum size of core files created -d The maximum size of a process’s data segment -e The maximum scheduling priority ("nice") -f The maximum size of files written by the shell and its children -i The maximum number of pending signals -l The maximum size that may be locked into memory -m The maximum resident set size -n The maximum number of open file descriptors (most systems...
Created by Dr. Xi on September 26, 2008 19:18:56 Last update: September 26, 2008 19:18:56
Use chsh to change your login shell.
# login shell is bash oracle@bashful:~$ ech...
Created by Dr. Xi on September 26, 2008 16:08:21 Last update: September 26, 2008 16:08:21
To list files containing the word limit in the current directory:
grep -l limit *However, the wild card * does not expand to include hidden files. To include hidden files, use:
ls -a | xargs grep -l limit
Created by Dr. Xi on September 05, 2008 23:28:14 Last update: September 05, 2008 23:28:14
In order for a user to run sudo , he must be in the sudoers file. You can use your favorite editor to change the file:
sudo gedit /etc/sudoersOr, if you use vim , you can use:
sudo visudoScroll down to the line
root ALL = (ALL) ALLand add
the_user_to_add ALL = (ALL) ALLIf you are not a sudoer but have root password, you should do su - to become root before editing /etc/sudoers . If you are using Ubuntu, this works too:
sudo adduser username admin
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 December 11, 2007 19:42:17 Last update: December 11, 2007 19:44:06
In .vimrc, or _vimrc on Windows, add line:
" will try to open file in dos, unix, or mac forma...
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
Created by Dr. Xi on August 29, 2007 02:10:21 Last update: August 29, 2007 02:10:21
In vi mode ( set -o vi ), hit ESC-\ (escape-backslash) for file name completion. In emacs mode, hit ESC-ESC . For file list hit the ESC key followed by the = key.
Created by Dr. Xi on June 02, 2007 02:11:54 Last update: August 20, 2007 03:26:54
Use the ldd command to display shared library (dynamic) dependencies of an executable or shared library object. This is a typical output:
[patrick@dellpc ~]$ ldd /bin/ls linux-g...If ldd complains that some library can't be found, you can set the environment variable LD_LIBRARY_PATH to alter the search path for shared libraries.