Search a string in directory
Shell Script
for i in `ls *`
do
echo $i
cat $i | grep search-string
done
Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts
Monday, 21 February 2011
Monday, 9 November 2009
X forwarding. : Error - xterm Xt error: Can't open display:
ERROR:
connection to "host23.0" refused by server
Xlib: Client is not authorized to connect to Server
xhost: unable to open display "host23.0"
xterm Xt error: Can't open display:
You should enable X forwarding. Note that should be enabled in ssh daemon settings.
$ ssh -X user@host
Link
http://www.linuxquestions.org/questions/linux-software-2/xterm-xt-error-cant-open-display-697237/
connection to "host23.0" refused by server
Xlib: Client is not authorized to connect to Server
xhost: unable to open display "host23.0"
xterm Xt error: Can't open display:
You should enable X forwarding. Note that should be enabled in ssh daemon settings.
$ ssh -X user@host
Link
http://www.linuxquestions.org/questions/linux-software-2/xterm-xt-error-cant-open-display-697237/
Monday, 21 September 2009
How to email the file attachment from unix ?
/usr/bin/uuencode daily.zip daily.zip | /usr/bin/mailx -s "Daily Report" xyz@yahoo.com
Ref Link:
http://www.cyberciti.biz/faq/howto-unix-sending-files-as-mail-attachments/
Ref Link:
http://www.cyberciti.biz/faq/howto-unix-sending-files-as-mail-attachments/
Friday, 11 September 2009
Explore process Information in unix
Each process has an entry in the
Commands :
ls -l /proc/pid/fd | wc -l
ls -l /proc/pid/lwp | wc -l
/proc filesystem identified by its PID. The following are the important files in /proc directory: pid/cmdlinecontains the command that was used to start the process (using null characters to separate the arguments)./proc/pid/cwdcontains a link to the current working directory of the process./proc/pid/environcontains a list of the environment variables that the process has available./proc/pid/execontains a link to the program that is running in the process./proc/pid/fd/is a directory containing a link to each of the files that the process has open./proc/pid/memcontains the memory contents of the process./proc/pid/statcontains process status information./proc/pid/statmcontains process memory usage information./proc/pid/lwpcontains the threads running in the process with the process id
Commands :
ls -l /proc/pid/fd | wc -l
ls -l /proc/pid/lwp | wc -l
Subscribe to:
Posts (Atom)