You are not logged in.

#1 2013-08-02 04:02:35

kasprosian
Member
Registered: 2013-08-02
Posts: 28

How to easily navigate a large filesystem?

I programmed something that will help navigate a large filesystem.

First, the program crawls the whole filesystem, then you can simply type "j [query]" and then it will return the top 5 results matching the query.

https://github.com/mallochine/chestnut

Is anybody interested?

Offline

#2 2013-08-02 04:03:10

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

If there is already a solution to the problem of navigating large file system, then please let me know!

Offline

#3 2013-08-02 04:04:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: How to easily navigate a large filesystem?

kasprosian wrote:

If there is already a solution to the problem of navigating large file system, then please let me know!

mlocate?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2013-08-02 04:55:03

progandy
Member
Registered: 2012-05-17
Posts: 5,279

Re: How to easily navigate a large filesystem?

Simple and effective.

Since you asked for existing tools: mlocate, recoll, regain-desktop, tracker, pinot, ...
There are also immature implementations of tagging file systems.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2013-08-02 11:42:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to easily navigate a large filesystem?

progandy already listed a couple good examples, I'll add a link or two.

I'd call such a tool an indexer or a desktop search engine - Arch wiki and the wikipedia agree with me: https://wiki.archlinux.org/index.php/Li … s#Indexers ;P

Offline

#6 2013-08-02 13:19:02

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

mlocate returns all the results instead of the top 5, so it's very hard to get what you want for a 1 or 2 word nav query on a large filesystem.

If a search engine used your cwd and other heuristics to give you only the most relevant results, would that be a large enough improvement? (just wondering)

Offline

#7 2013-08-02 13:21:15

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

An additional problem (at least in my case) is that mlocate is often installed globally so it's difficult to get mlocate just for your own local account.

Offline

#8 2013-08-02 13:31:01

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to easily navigate a large filesystem?

kasprosian wrote:

An additional problem (at least in my case) is that mlocate is often installed globally so it's difficult to get mlocate just for your own local account.

Not really:

locate -A ~ foo

In other words, pass your home dir as one of the patterns, and tell locate to match all patterns. locate(1) for more details.

Good work though, nothing beats scratching your own itch. smile

Offline

#9 2013-08-02 13:31:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to easily navigate a large filesystem?

Please use the 'Edit' functionality (link is in the bottom right of your post) instead of bumping the thread.

I don't have very many files, so I use locate or find - or find + grep if I want to search inside the text files. My memory isn't perfect so returning just top 5 or 10 results is usually not what I want. I use simple queries to find e.g. 10 biggest or oldest files when I'm doing some cleanup, but that's not what you're after.
I use aliases for stuff that I access often. If the contents of your system don't change very often, I think coming up with a hierarchy or categories / tags could help.

Offline

#10 2013-08-02 14:15:54

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

karol wrote:

Please use the 'Edit' functionality (link is in the bottom right of your post) instead of bumping the thread.

I don't have very many files, so I use locate or find - or find + grep if I want to search inside the text files. My memory isn't perfect so returning just top 5 or 10 results is usually not what I want. I use simple queries to find e.g. 10 biggest or oldest files when I'm doing some cleanup, but that's not what you're after.
I use aliases for stuff that I access often. If the contents of your system don't change very often, I think coming up with a hierarchy or categories / tags could help.

Right, when you're using just a few files at a time that are mostly nearby, navigating to those files is not really a pain.

It's just that from my experience working with a software company's very large codebase, I found it excruciating to simply go between two files that have very far distance from each other in the file system tree. That's why I wrote chestnut.

Offline

#11 2013-08-02 14:19:29

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

tomk wrote:
kasprosian wrote:

An additional problem (at least in my case) is that mlocate is often installed globally so it's difficult to get mlocate just for your own local account.

Not really:

locate -A ~ foo

In other words, pass your home dir as one of the patterns, and tell locate to match all patterns. locate(1) for more details.

Good work though, nothing beats scratching your own itch. smile

Haha thanks smile

On the other though....:

[~]$ locate -A ~ nacl
locate: warning: database `/usr/software/var/locatedb' is more than 8 days old

[~]$ updatedb --localpaths="/home/ec2-user"
/usr/software/bin/updatedb: line 223: /usr/software/var/locatedb.n: Read-only file system

I guess most users on this forum use Linux on their own desktop, so privileges won't be an issue for the most part. Hmph.

**************************

Ideally, a user should not even have to lookup/know which flags to use. Ideally, it should be "Google like" -- just type in your query, and you got what you want.

The problem might be that it's not that big of an upgrade, i.e. not a big deal.

Could you look at https://bbs.archlinux.org/viewtopic.php?id=167567 ? this is a tangential offshoot to what I did here.

Last edited by kasprosian (2013-08-02 14:22:21)

Offline

#12 2013-08-02 14:27:06

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,426

Re: How to easily navigate a large filesystem?

What's the strategy to sort the results?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#13 2013-08-02 14:40:22

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

kokoko3k wrote:

What's the strategy to sort the results?

Shorter paths over longer paths. The heuristic seems naive, but has worked well in my programming environment (~30,000 files).

Last edited by kasprosian (2013-08-02 14:47:30)

Offline

#14 2013-08-02 15:12:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to easily navigate a large filesystem?

kasprosian wrote:

[~]$ locate -A ~ nacl
locate: warning: database `/usr/software/var/locatedb' is more than 8 days old

I think you should run updatedb e.g. daily via cron or systemd timer.

kasprosian wrote:

Ideally, a user should not even have to lookup/know which flags to use. Ideally, it should be "Google like" -- just type in your query, and you got what you want.

I seldom use Google to search for 'foo', usually my queries rely on slightly more advanced tools, like site:, inurl:, I'm interested in results only from last week or month etc.

Offline

#15 2013-08-02 15:15:03

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to easily navigate a large filesystem?

kasprosian wrote:

Ideally, a user should not even have to lookup/know which flags to use

Ehmm... get to know your audience. We're Archers, we make a point of knowing which flags to use. smile

Offline

#16 2013-08-02 15:43:19

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

karol wrote:
kasprosian wrote:

[~]$ locate -A ~ nacl
locate: warning: database `/usr/software/var/locatedb' is more than 8 days old

I think you should run updatedb e.g. daily via cron or systemd timer.

I would do that, except I'm just an employee at a software company, not a sysadmin :\

Offline

#17 2013-08-02 15:46:12

kasprosian
Member
Registered: 2013-08-02
Posts: 28

Re: How to easily navigate a large filesystem?

tomk wrote:
kasprosian wrote:

Ideally, a user should not even have to lookup/know which flags to use

Ehmm... get to know your audience. We're Archers, we make a point of knowing which flags to use. smile

It's the old idealism vs reality thing again.

Offline

#18 2013-08-02 17:36:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,678
Website

Re: How to easily navigate a large filesystem?

Might wanna change the trigger from the single letter j to something else since autojump used j to invoke itself.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB