Announcement

Collapse
No announcement yet.

No Such File!

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    No Such File!

    Out of interest, I tried to open a file using libreoffice from the command line.

    The file: Full CV.doc exists in the folder, but when I type libreoffice Full CV.doc I see the message no such file.

    Advice please.
    kubuntu version: 16.04.5 LTS

    Laptop: Toshiba-Satellite-L350

    #2
    If there is a space in the filename, put quotes around it (libreoffice "Full CV.doc") or escape the space (libreoffice Full\ CV.doc)...otherwise the command will try to open two files "Full" and "CV.doc" neither of which exists.

    Comment


      #3
      kubicle got in before me. I'll just add:

      At the bash prompt, you can use what's called "completion", (by default the Tab key), and bash will fill things in for you, f.ex. with <Tab> meaning press the Tab key:
      Code:
      libr<Tab>Full<Tab>
      This can be very convenient if you've got files with long text names, or with punctuation. All of
      Code:
      ~ ` ! $ & * ( ) [ ] { } \ | ; ' " < > ? #
      have to be "escaped" at least some of the time.
      Regards, John Little

      Comment


        #4
        Originally posted by kubicle View Post
        If there is a space in the filename, put quotes around it (libreoffice "Full CV.doc") or escape the space (libreoffice Full\ CV.doc)...otherwise the command will try to open two files "Full" and "CV.doc" neither of which exists.
        Yes, works with either " or ' quotation marks
        kubuntu version: 16.04.5 LTS

        Laptop: Toshiba-Satellite-L350

        Comment


          #5
          Originally posted by jlittle View Post
          kubicle got in before me. I'll just add:

          At the bash prompt, you can use what's called "completion", (by default the Tab key), and bash will fill things in for you, f.ex. with <Tab> meaning press the Tab key:
          Code:
          libr<Tab>Full<Tab>
          This can be very convenient if you've got files with long text names, or with punctuation. All of
          Code:
          ~ ` ! $ & * ( ) [ ] { } \ | ; ' " < > ? #
          have to be "escaped" at least some of the time.

          I only get libreoffice Full
          kubuntu version: 16.04.5 LTS

          Laptop: Toshiba-Satellite-L350

          Comment


            #6
            On another point, there is a file on my system but I have forgotten its location. I have tried locate, but without success. I have tried to use find but it just seems to list everything non-stop.

            What programme would you use to locate a file?
            kubuntu version: 16.04.5 LTS

            Laptop: Toshiba-Satellite-L350

            Comment


              #7
              Originally posted by anonprivate View Post
              On another point, there is a file on my system but I have forgotten its location. I have tried locate, but without success. I have tried to use find but it just seems to list everything non-stop.

              What programme would you use to locate a file?
              I'd use locate, but that's just me

              Two things to remember when using locate; first locate's database needs to be newer than the file you're trying to find (updatedb as root does this - it also runs as a nightly cron job) and locate won't display files the user doesn't have permission to read, if I'm not looking for something in my home directory I run it as root so it'll return everything

              What happens when you try to use locate?
              we see things not as they are, but as we are.
              -- anais nin

              Comment


                #8
                Originally posted by wizard10000 View Post
                I'd use locate, but that's just me

                Two things to remember when using locate; first locate's database needs to be newer than the file you're trying to find (updatedb as root does this - it also runs as a nightly cron job) and locate won't display files the user doesn't have permission to read, if I'm not looking for something in my home directory I run it as root so it'll return everything

                What happens when you try to use locate?
                Nothing.

                Perhaps it needs to be updated

                Would this command update the package

                apt-get update locate
                kubuntu version: 16.04.5 LTS

                Laptop: Toshiba-Satellite-L350

                Comment


                  #9
                  Originally posted by anonprivate View Post
                  Nothing.

                  Perhaps it needs to be updated

                  Would this command update the package

                  apt-get update locate
                  The package doesn't need to be updated, locate's database most likely does.

                  Code:
                  sudo updatedb
                  then

                  Code:
                  sudo locate [I]filename[/I]
                  or if the filename has spaces or certain special characters,

                  Code:
                  sudo locate "[I]filename[/I]"
                  Hope this helps -
                  we see things not as they are, but as we are.
                  -- anais nin

                  Comment


                    #10
                    Originally posted by wizard10000 View Post
                    The package doesn't need to be updated, locate's database most likely does.

                    Code:
                    sudo updatedb
                    then

                    Code:
                    sudo locate [I]filename[/I]
                    or if the filename has spaces or certain special characters,

                    Code:
                    sudo locate "[I]filename[/I]"
                    Hope this helps -
                    I typed sudo updatedb

                    and gave my password.

                    I did not see any on screen messages, the command prompt appeared a little later. Is this the expected behaviour?

                    I noticed:
                    andrew@andrew-Dell-DM061:~$ sudo updatedb
                    [sudo] password for andrew:

                    I was surprised when I did not see any messages, so I repeated the update - sudo updatedb. This time, I was not asked for my password and the prompt re-appeared, but this time almost instantly. Is this to be expected?

                    I am still unable to locate the file!

                    Does locate search all kubuntu folders?

                    Thanks
                    kubuntu version: 16.04.5 LTS

                    Laptop: Toshiba-Satellite-L350

                    Comment


                      #11
                      Yes, everything you described is 'normal behavior'.
                      Using Kubuntu Linux since March 23, 2007
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Originally posted by anonprivate View Post
                        On another point, there is a file on my system but I have forgotten its location. I have tried locate, but without success. I have tried to use find but it just seems to list everything non-stop.

                        What programme would you use to locate a file?
                        What's the files name?
                        Using Kubuntu Linux since March 23, 2007
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Why are no messages given - how does one know that updating has taken place?

                          escp2-sx100
                          Last edited by anonprivate; Jul 19, 2016, 12:10 AM.
                          kubuntu version: 16.04.5 LTS

                          Laptop: Toshiba-Satellite-L350

                          Comment


                            #14
                            Originally posted by anonprivate View Post
                            Why are no messages given - how does one know that updating has taken place?

                            escp2-sx100
                            When the command prompt returns updatedb is done. It only gives a message if there's an error.

                            So -

                            Code:
                            sudo locate escp2-sx100
                            doesn't return any results?
                            we see things not as they are, but as we are.
                            -- anais nin

                            Comment


                              #15
                              Originally posted by wizard10000 View Post
                              When the command prompt returns updatedb is done. It only gives a message if there's an error.

                              So -

                              Code:
                              sudo locate escp2-sx100
                              doesn't return any results?
                              No

                              I don't think that sudo locate searches all folders.

                              For example, I seacrhed for lp0 (zero)

                              /usr and /var were searched, but /dev/usb was not (lp0 is in the latter)

                              While I am here, if I wanted more information about the file lp0, what would be the best command?
                              Last edited by anonprivate; Jul 19, 2016, 06:10 AM.
                              kubuntu version: 16.04.5 LTS

                              Laptop: Toshiba-Satellite-L350

                              Comment

                              Working...
                              X