Solved

what does this command mean?

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
awk sed variable in file 3 98
windows 7 starter missing password 21 99
CentOS 7 Linux for HP DL380 G4 32Bits 7 79
Moving from Mcrypt to OpenSSL 18 66
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

733 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