?
Solved

what does this command mean?

Posted on 2013-05-28
3
Medium Priority
?
486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Assisted Solution

by:arober11
arober11 earned 1000 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 1000 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

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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