Damn Small Linux (DSL) Forums
Welcome,
Guest
. Please
login
or
register
.
December 05, 2023, 03:31:35 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
The new DSL forums are now open.
Stats
11609
Posts in
311
Topics by
291
Members
Latest Member:
mik3ca
Search:
Advanced search
Get
The Official Damn Small Linux Book
.
Great VPS hosting provided by
Tektonic
Damn Small Linux (DSL) Forums
Damn Small Linux
DSL Ideas and Suggestions
$locate ? would be a nice addittion
« previous
next »
Pages:
[
1
]
Author
Topic: $locate ? would be a nice addittion (Read 8957 times)
kswoodsman
Newbie
Posts: 8
$locate ? would be a nice addittion
«
on:
September 08, 2012, 08:56:52 PM »
OK so realising that a full blown database of where all the files reside isn't feasible for a <50 meg distro. How about adding an alias to bashrc or bash_aliases that reads similar to
alias locate="du -ah / 2>&1| cut -f 2 | grep" for an output simular to full locate
or
alias locate="du -ah / 2>&1| grep" to show the file allocation size ?
The first instance takes a minute to complete. Every instance afterwards it is read from cached memory and the results are nearly instantaineous.
In ways, the alias is a bit better than using updatedb, which only runs once per day, any new files or newly mounted filesystems are immediately available and no diskspace is used on a read-only fs.
I haven't looked at the kernel cache useage before and after first use. Low memory machines (<32M) haven't seemed to suffer from this alias. The kernel keeps track of stale caches and flushes them regularly. Symlinks are shown as 0K in size if not piped through cut. And you get a quick ide of file size wlithout having to run ls -l once the file you are looking for is found.
Thanks for your eforts making DSL what it has evolved into, a great distribution that is portable and consistant from one machine to the next.
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Damn Small Linux
-----------------------------
=> Site News
=> Release Candidates
=> User Feedback
=> DSL Tips and Tricks
=> USB booting
=> DSL Ideas and Suggestions
=> DSL Embedded
=> HD Install
=> Laptops
=> Other Help Topics
-----------------------------
MyDSL Extensions
-----------------------------
=> The Testing Area
=> Apps
=> Games
=> Gtk2
=> Multimedia
=> Net
=> System
=> Themes
=> Window Managers
=> Extension Development
-----------------------------
DSL Not
-----------------------------
=> DSL-N
-----------------------------
Non-DSL Topics
-----------------------------
=> water cooler