Results 1 to 10 of 10

Thread: How to copy long file path

  1. #1
    Join Date
    Nov 2011
    Beans
    64

    Question How to copy long file path

    Is there an easy method of copying the filepath; for instance using Nautilus; to a particular file once it is found ? A long file path scrolls along the top of a window above a tab, I can make a note, and copy by writing down the information.

    Presumably this may be done easily from the CLI.

    I know I may click on the file and check the file properties, but these sometimes truncate.

    Also are there any particular constraints on length of filepath ?

    I am using 64 bit Ubuntu 12.04 LTS on ext4 filesytem

  2. #2
    Join Date
    Feb 2008
    Location
    Planet earth, for now.
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to copy long file path

    Not sure I follow, but ... From memory, you have a choice of whether to see an address bar in Nautilus /like/this/to/your/file or as 'blobs' with directory names. In the former you can just select the path in the address bar and paste it into a terminal as the path rather than writing it down. Remember: You can copy from all sorts of places in Linux.

    I use PCmanFM myself and the address bar is /just/like/that. Makes life easier, at least for me.

    PS: If you want to dabble with this in a terminal:

    dir = directory; cd = change directory; therefore:

    Code:
    dir /home
    ... will give you the contents of your home directory.

    Code:
    cd /media/music/Beatles
    ... will change the current 'working' directory to /media/music/Beatles. Now, issuing just:

    Code:
    dir
    ... will give you a listing of what's in the directory /media/music/Beatles as you are 'in' that directory.

    Have fun ...

    [PS: Google 'maximum filepath length linux'.]
    Last edited by Bucky Ball; July 22nd, 2012 at 02:18 PM.

  3. #3
    Join Date
    Jan 2010
    Location
    Illinois
    Beans
    118
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: How to copy long file path

    When I right-click a file in Nautilus, and select 'copy', I can paste into a text editor (I used gedit), and it pastes the full path. It is in my copy buffer in ClipIt also.

    Example:

    Code:
    /boot/grub/locale/en_GB.mo
    Is that what you want? edit/add - there is no apparent limit on the path length, I was able to do very deeply nested files also

    -NTL2009
    Last edited by NTL2009; July 22nd, 2012 at 04:38 PM.

  4. #4
    Join Date
    Feb 2010
    Location
    Washington, DC Area
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to copy long file path

    In nautilus, press the keys
    Code:
    Ctrl + L
    or click go in nautilus > location, this will change the information in the address bar to something you can copy then paste in the terminal.

    In a terminal to find something, you will need to use the find or locate command if you know the name of the file you want.
    Last edited by dcsoldschool53; July 22nd, 2012 at 06:03 PM.

  5. #5
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How to copy long file path

    You can just drag-and-drop from a file icon in Nautilus to a terminal window, and the /path/and/filename is written. You can do the same with the 'blobs' describing the working directory ('blobs' as defined in post #2 by Bucky Ball).

  6. #6
    Join Date
    Feb 2008
    Location
    Planet earth, for now.
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How to copy long file path

    Quote Originally Posted by dcsoldschool53 View Post
    In nautilus, press the keys
    Code:
    Ctrl + L
    or click go in nautilus > location, this will change the information in the address bar to something you can copy then paste in the terminal.
    Quote Originally Posted by sudodus View Post
    You can just drag-and-drop from a file icon in Nautilus to a terminal window, and the /path/and/filename is written. You can do the same with the 'blobs' describing the working directory ('blobs' as defined in post #2 by Bucky Ball).
    Both great tips, cheers! The latter; guess you could drag and drop the icon from any file manager ...

  7. #7
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to copy long file path

    Hi ,
    also Ubuntu has pre-installed the bash-completion package. This package help user to auto-fill the path (or command) with Tab key. So if you know the first and/or second path , then you can search (kinda) the next path (until the last file) by pressing Tab key. But this method requires to know where the file is , it just help you to fill the path (kinda automatically)
    Thanks
    # How to mark the Thread as [SOLVED] when done.
    # Ubuntu Greek Community
    # Gain 20GB of space on copy.com when sign up with my referral link.

  8. #8
    Join Date
    Nov 2011
    Beans
    64

    Re: How to copy long file path

    Thanks to everyone for the replies. This is not a subject I have had time to get back to yet. I was noticing some truncation, but have not had time to study and try the answers yet.

  9. #9
    Join Date
    Nov 2011
    Beans
    64

    Smile Re: How to copy long file path

    Thanks again for all the information.

    I had not noticed the tiny scroll tiny arrows at the end of the blobs|breadcrumbs, so although the displayed info was truncated it was in fact all still available.

    I also was not aware of the Ctrl + L option to display the Location path as text (and Esc to reverse the option).

    I have now been trying the advice and putting it to use; so have now marked the thread as solved. As often the case there is more than a single method of achieving the objective.

  10. #10
    Join Date
    Oct 2012
    Beans
    874

    Re: How to copy long file path

    Quote Originally Posted by aka-John99 View Post
    Is there an easy method of copying the filepath; for instance using Nautilus; to a particular file once it is found ? A long file path scrolls along the top of a window above a tab, I can make a note, and copy by writing down the information.

    Presumably this may be done easily from the CLI.

    I know I may click on the file and check the file properties, but these sometimes truncate.

    Also are there any particular constraints on length of filepath ?

    I am using 64 bit Ubuntu 12.04 LTS on ext4 filesytem
    I like to be able to cut and paste the file path from Nautilus. The fancy way Nautilus displays path by default is not useful for my purpose.

    To fix this install dconf-tools, then open the dconf-editor from the dash, choose on the left panel org > gnome > nautilus > preference and check the box "always use location entry" on the right panel.
    Last edited by monkeybrain2012; December 17th, 2012 at 09:46 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •