LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   commands (https://www.linuxquestions.org/questions/linux-newbie-8/commands-835328/)

veeruhs 09-29-2010 11:45 PM

commands
 
Hi,

Can anybody tell me what does the below commands do?

1.ldd $(which vsftpd) | grep libwrap

2.strings $(which vsftpd) | grep hosts


Thanks in advance
Veerendra

quanta 09-29-2010 11:50 PM

RTFM: man ldd, man strings, man which.

prayag_pjs 09-29-2010 11:52 PM

ldd - print's shared library dependencies
which vsftpd -- gives its binary parh---/usr/sbin/vsftpd
grep libwrap-- searches for libwrap (from other lists)

same way:

strings - print the strings of printable characters in files.

veeruhs 09-30-2010 12:30 AM

commands
 
Hi Prayag,

Thanks for your reply...can u pls tell me what does $ symbol do?

Thnaks
Veerendra

vinaytp 09-30-2010 12:37 AM

Hi,

Any thing enclosed in $( ) will be treated as command to execute.

$( ) is same as enclosing in back quotes ` `

Lets take this example

Here hostname inside echo is just treated as text to be displayed.

Code:

[user@CDC ~]$ echo "Host name is hostname"
Host name is hostname

In the below command hostname in echo command is a command. In order to execute it under echo, we need to enclose it under $( ) or ` `
Code:

[user@CDC ~]$ echo "Host name is $(hostname)"
Host name is CDC

# this is also same

[user@CDC ~]$ echo "Host name is `hostname`"
Host name is CDC


prayag_pjs 09-30-2010 12:47 AM

Hi,

Above post explained everything.i.e usage of $

Would suggest you to refer this short guide to quickly learn basics of shell scripting:

http://147.188.192.43/documentation/...xscripting.pdf

Aquarius_Girl 09-30-2010 12:52 AM

veeruhs

Check this out:
http://tldp.org/LDP/abs/html/internalvariables.html
and
http://tldp.org/LDP/abs/html/index.html

veeruhs 09-30-2010 12:56 AM

commands
 
Hi,

Thanks for the reply


All times are GMT -5. The time now is 09:10 AM.