Solved

what does this command mean?

Posted on 2013-05-28
3
481 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 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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