Not able to install tree comand in ubuntu

472

Package tree is available in Universe. Check that you have it enabled:

enter image description here

Then just do the usual

$ sudo apt-get update
$ sudo apt-get install tree

All Ubuntu repositories (main, universe, restricted, multiverse) can be enabled by following command:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
Share:
472

Related videos on Youtube

vinni
Author by

vinni

Updated on September 18, 2022

Comments

  • vinni
    vinni over 1 year

    I'm trying to filter a text that has new lines in open refine.

    The input is:

    Them Spanish girls love me like I'm Aventura
    I'm the man, y'all don't get it, do ya?
    Type of money, everybody acting like they knew ya
    Go Uptown, New York City, bitch
    Them Spanish girls love me like I'm Aventura
    Tell Uncle Luke I'm out in Miami, too
    Them Spanish girls love me like I'm Aventura
    

    The expected Result would be:

    Type of money, everybody acting like they knew ya
    Go Uptown, New York City, bitch
    Them Spanish girls love me like I'm Aventura
    

    I'm trying to get the line with the keyword and the lines before and after.

    My code to do it with standard regex looks like that:

    /((.*\n){2})^.*\b(New York)\b.*((.*\n){3})/m

    But that doesn't work in open refine. I tried the following, but it only returns 'null'

    value.match(/.*(\New York)/.*)

    Any one has an idea how I could do it? I really need to keep the lines, so I cant do a replace(/\n/,'') before the match.

    • chaos
      chaos almost 10 years
      @Tim there IS a package called tree in the official repo: packages.ubuntu.com/trusty/tree
    • Ron Rosenfeld
      Ron Rosenfeld almost 6 years
      Could it be that the newline is a <cr><lf> sequence and you need \r\n?
  • KhoPhi
    KhoPhi over 8 years
    Not able to install in Ubuntu 15.10, although universe is enabled.
  • geethujoseph
    geethujoseph over 8 years
  • KhoPhi
    KhoPhi over 8 years
    but I havedeb http://archive.ubuntu.com/ubuntu wily main restricted in my sources.list ?
  • geethujoseph
    geethujoseph over 8 years
    Well I can't see universe anywere in that line... Make sure universe is not commented and dont forget to run sudo apt-get update. Either way in that link you can download the file and install it using Software Center
  • iMitwe
    iMitwe almost 6 years
    Bro, he asked in OpenRefine, you come up with Excel. What's wrong with just sticking to openrefine ?
  • Vityata
    Vityata almost 6 years
    @iMitwe - nothing is wrong with sticking with openrefine. But the question is tagged with Excel as well, thus I come up with it.
  • vinni
    vinni almost 6 years
    How would I need to change it, to get 2 lines before and after?
  • vinni
    vinni almost 6 years
    Ok, I got it with value.find(/(.*\n){2}.+New York.+(\n.*){2}/).join('\n'). Thanks!
  • vinni
    vinni almost 6 years
    I found a small bug in the regex. It doesn't match if the searched word is just before a new line. .+ doesn't match new line characters. Do you have any idea how I could also match for a word in front of a new line? I tried [\s\S] but this matches each line
  • Ettore Rizza
    Ettore Rizza almost 6 years
    @vinni It's often better to use multiple Regex rather than trying to build one that covers all cases. But you can try something like this : value.find(/(.*\n){2}.+New York.+(\n.*){2}|(.+\n){2}.*New York(\n.*){2}/i).join('\n') (note : I added a "i" at the end of the regex, so this one is case insensitive. It finds "New York" as well as "New york")
  • vinni
    vinni almost 6 years
    Ah, that's a good hint. Thanks! This seems to work: (.*\n){2}(.+|)Kreuzberg(.+|)(\n.*){2} Do you think there is an issue with that?
  • vinni
    vinni almost 6 years
    Ok, this is my final solution: (.*)\n(.*)\n(.*(Kreuzberg).*)\n(.*)\n(.*)