# Can anyone please guide me to how can open the example 4a root file?

**URL:** <https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231>\
**Category:** Newbie\
**Tags:** root\
**Created:** [May 6, 2024, 7:30am UTC](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231 "2024-05-06T07:30:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ratilal\_Meher](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ratilal_meher/32/36440_2.png) [@Ratilal\_Meher](https://root-forum.cern.ch/u/Ratilal_Meher)\
**Post date:** [May 6, 2024, 7:30am UTC](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231/1 "2024-05-06T07:30:30Z")

</div>

root [0] root -l B4.root  
ROOT\_prompt\_0:1:7: error: use of undeclared identifier ‘l’  
root -l B4.root  
^  
root [1] root -l B4.root  
ROOT\_prompt\_1:1:7: error: use of undeclared identifier ‘l’  
root -l B4.root  
^  
root [2] .ls  
root [3] f.ls()  
input\_line\_11:2:3: error: use of undeclared identifier ‘f’  
(f.ls())  
^  
Error in : Error evaluating expression (f.ls())  
Execution of your code was aborted.  
root [4]

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [May 6, 2024, 7:36am UTC](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231/2 "2024-05-06T07:36:18Z")

</div>

Dear @Ratilal_Meher ,

Thanks for writing on the forum. I suggest you take a look at our manual, specifically [here](https://root.cern/manual/first_steps_with_root/), which explains that you have to open the ROOT prompt from the command line, not use the `root` command when you are already inside the prompt.

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 13, 2024, 1:51pm UTC](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231/3 "2024-05-13T13:51:56Z")

</div>

```auto
$ root -l B4.root
root[0] _file0->ls()

```

or:

```auto
$ root
root[0] auto f = new TFile("B4.root")
root[1] f->ls()

```

or (if you only want to see the contain of the file):

```auto
$ rootls B4.root

```

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 27, 2024, 1:52pm UTC](https://root-forum.cern.ch/t/can-anyone-please-guide-me-to-how-can-open-the-example-4a-root-file/59231/4 "2024-05-27T13:52:00Z")

</div>

Closed on May 27, 2024, 1:52pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
