Solved

what does this command mean?

Posted on 2013-05-28
3
452 Views
Last Modified: 2013-05-31
I have some confusion about this command. How could the $ sign been used here? thanks.

ls -l $(locate NodeManager.sh)
0
Comment
Question by:Jason Yu
3 Comments
 
LVL 26

Assisted Solution

by:arober11
arober11 earned 250 total points
ID: 39200455
It will list the attributes (ls -l) of all shell script named NodeManager.sh on your system, assuming the locate file database is up to date, see updatedb. The $(....)  around the locate instruct the shell to execute this section first and pipe the output (a list of files) into ls -l

Note: updatedb creates a DB of all files on a system, while locate offers a mechanism to search the DB for all files, in the db, that match a passed pattern.
0
 
LVL 21

Accepted Solution

by:
Mazdajai earned 250 total points
ID: 39201484
It shows the long listing of the path from the locate command.

The dollar sign parentheses was used for command substitution. It is similar to ls -l `locate NodeManager.sh` but the first form is preferred because it allow nested commands.

Try the following -

ls -l $(locate .bashrc)

Open in new window


Then try the following -
ls -l $(ls -ltr$(locate .bashrc))

Open in new window

0
 

Author Closing Comment

by:Jason Yu
ID: 39211654
thanks experts, you are the best!
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now