11 ms·
Sloth – Mac app that shows all open files and sockets in use
- aboutruby 8y agoI was expecting some ncurses-based interface
- tambourine_man 8y agoGUI, not TUI in the title
- rileymat2 8y agoMaybe it is just me, but I am getting tired of cute names for projects. lsof is easy to remember (list open files), I like that.
- pure-awesome 8y agoSloth sounds like if you tried to pronounce lsof.
- martin_a 8y agoNo, not really. S comes after L when pronouncing, no matter how you do it.
- jsilence 8y agoNo hsit heshlock!
- rileymat2 8y agoMy comment was too negative. Looks very useful. I just have trouble remembering names like this. I don't think this is a name/sound that clicks for me.
- agumonkey 8y agoI get the feeling too. I was just wondering about that this morning. Some times you want a name that is clearly descriptive like lock_and_clean_journal but when you have a new tool that does a lot and in a different way.. a cute name is a good symbol to indicate 'completely new context'. Otherwise we'd get meaningless glue code like pony | lulee --pew | eels | cyan ..
- masklinn 8y ago> Otherwise we'd get meaningless glue code like > pony | lulee --pew | eels | cyan .. I mean we kinda do, it's just that we're used to the bits. ls | xargs cat | grep main >> /dev/nul 2>&1 is not inherently more meaningful than what you wrote above, you just have the experience to interpret it. Incidentally, powershell commands tend to be more "self-explanatory" in their naming, at least in theory.
- agumonkey 8y agoheh, not untrue, although most are bad shortenings.. ls:list, xargs:arguments, cat:concatenate MS did try to avoid explosion of idioms but at a tiny verbosity cost. I believe that map/reduce is a bit a good middle ground
- aaaaaaaaaaab 8y agoI too hate this phenomenon, but this one has version history going back to 2004, so it's not exactly your generic JS framework-of-the-week with nondescript cutesy name.
- president 8y agoNot sure why you're getting downvoted but I can relate. There is sort of a fashion to naming projects that I think many people don't understand. To me "cute" tech project names were fashionable in 2000 - 2010 (Shoes gui toolkit for ruby comes to mind) but like any trend, it was overdone and became lame.
- opportune 8y agoyeah, I don't want to be overly negative but I think this must target a very niche, possibly non-existent set of users: people who need to see all open files and sockets for whom lsof+grep is too complicated. Personally I have "sudo lsof -i | grep <port>" burned into my muscle memory and this tool just seems slower
- phoe-krk 8y agoAre there any alternatives for other Unices and Unixlikes?
- lsiebert 8y agolsof was written by vic abell, who also wrote a graphical java gui for it, glsof. http://glsof.sourceforge.net/ http://glsof.sourceforge.net/
- TheCabin 8y agoAny thoughts about pros / cons when compared with Sloth?
- nacs 8y agoSloth has some features that seem more Mac specific like filtering out non-user applications and such. Also, one is java vs a native (mac-only) app.
- tomc1985 8y agoIt's a wrapper around a tool. Just try it!
- josteink 8y agoLsof is Unix-standard, part of coreutils, and can be used anywhere, piped and automated. Sloth exists only on OSX and is a GUI app. I’d ask the opposite: Any reason anyone would anyone use Sloth over lsof?
- zokier 8y ago> Lsof is Unix-standard lsof is pretty common, but I don't think it is actually standard in any way, for example it is not part of POSIX or SUS which arguably are the two most influential UNIX related standards. http://bhami.com/rosetta.html http://bhami.com/rosetta.html (ctrl-f lsof)
- saagarjha 8y ago
- lsiebert 8y agoThis can be installed using homebrew with: brew cask install sloth
- tjbiddle 8y agoI know Homebrew is vetted, but I personally like to always check where this is pulling in its installer file - and it appears to match the domain as is in the Github repo. https://github.com/Homebrew/homebrew-cask/blob/master/Casks/sloth.rb https://github.com/Homebrew/homebrew-cask/blob/master/Casks/...
- heyoni 8y agoYou might already know this but you can do that by command line with 'brew cask audit sloth' to see where it's pulling from...I'm paranoid enough too :O
- lawnchair_larry 8y agoI did not know that, so thanks for the tip!
- heyoni 8y agoI made a mistake! The command is ‘brew cask cat’ to see where it’s coming from.
- FrankSansC 8y agoWhich version of homebrew are you using? Because when I try this this is what I get: $ brew cask audit sloth audit for sloth: passed
- heyoni 8y agoI made a mistake! The command is ‘brew cask cat’ to see where it’s coming from.
- sjmulder 8y agoThis looks like such a nice app! Proper Mac UI too. I'm going to try it out as soon as I get home.
- Waterluvian 8y agoThis is interesting to me because it's an example of the other side of the "Electron" argument. `lsof` exists in Linux. At least, my Ubuntu 16.04 has it. So if this were an Electron UI, would we instantly have a Linux version as well? Or is it not that simple? I do really enjoy the look and feel of this mac version, though.
- solarkraft 8y ago> if this were an Electron UI, would we instantly have a Linux version as well? Many Electron apps are only written in JS without any (or no neccessary) platform specific code, but some also interface with the platform. In this case, if it just calls lsof through the shell and the versions are the same, it might actually just work. If it ships with its own binary it'd need to be switched out.
- ourcat 8y agoThat's right. Once you've got the equivalent commands for each platform, it should be possible to build and package for all of them (Mac/Win/Linux). I've just done a tri-platform Electron app which handles quite a few platform-specific commands. (For drive listing, SD-card formatting, file decryption (in custom C apps), etc.) It does take a lot more work (and lots of time-consuming testing). But it can be done.
- lawnchair_larry 8y agoTaking something as lightweight as an lsof command line tool and putting an entire web browser and node.js instance on top seems like we are moving in the wrong direction. It’s like we are going to need a terabyte of RAM and a Tesla battery to run basic apps of the future with even half of the performance we got out of our systems 2 decades previously.
- newscracker 8y agoFifteen years of maintenance and updates (by one developer) for a free and open source tool, and just asking for donations if the user finds it useful! I'm impressed! If I were a user, I would certainly donate.
- retSava 8y agoI like to think that when I see such really nice behaviour, I should supply positive reinforcement since I know how much such things can matter to people. Eg I had a really nice commuter bus ride, when about to go off, I went to the driver and said thanks, I enjoyed the ride, it was very smooth etc. I could tell this person took pride and enjoyment in doing it. I also called his employer and gave praise (using the bus number), hopefully this is reflected professionally for him too. So you don't have to be a user to show appreciation ;)
- kossae 8y agoBut weren’t you a user of the bus system in the scenario you laid out as well?
- retSava 8y ago....that's true! :) edit: and re-reading my comment I feel it can come across like a manipulative sociopath comment, but I can assure you all that's not what I am. Though, that's exactly what a manipulative sociopath would say.
- kossae 8y agoNot at all! I think those actions were very kind.
- asudosandwich 8y agoAfter our meal of takeout BBQ last week I called the joint, which was brand new, and thanked them for how good everything was. As a shy telephone-allergic introvert I’d never done that before, but I’m glad I did!
- frou_dh 8y agoThe stock Activity Monitor app provides a sparse-looking version of this (double-click a process, then select 'Open Files and Ports')
- plorkyeran 8y agoActivity Monitor makes it reasonably easy to check which files a process has open, but does not reasonably handle the inverse case of checking which processes have a specific file open.
- Jack5500 8y agoIs there anything like that for Windows?
- marcoperaza 8y agoYes, Process Explorer from Microsoft’s free sysinternals tools.
- stronglikedan 8y agoProcess Explorer for files, but I'm not sure about sockets.
- anonymfus 8y agoIn addition to Sysinternal's Process Explorer, there is also a built-in application "Resource Monitor" (resmon.exe) linked on the Performance tab of the regular Task Manager.
- webninja 8y agoIf you enable Bash for Windows in the developer tools settings, you will be able to run lsof directly from the command line
- torarnv 8y agoIs there any way (in general) to see what processes a pipe is connected to (on both ends)?
- dandigangi 8y agoThis is a nice little tool. The more I find myself running a full stack application local (when not in Docker), lsof is quite useful. Will try this out for sure!
- T3RMINATED 8y agoy is this not on Windows... Windows Sux
- Congeec 8y agoAny reason you choose to build on the command line interface of lsof rather than reusing its api by diving into its source code?
- randomsearch 8y agoCommand line interfaces usually more stable, documented and easy to use.
- Tepix 8y agoStable? You must be joking?
- simias 8y agoFor standard Unix tools? Not really, since they're often used in scripts and everything breaks if the formatting changes. Generally any new feature is hidden behind new flags on the command line to avoid breaking anything. There are exceptions of course but I doubt the output of lsof will change any time soon. Meanwhile kernel ABIs can and do change between versions (the API less so, but it still means that you have to rebuild your code). What can happen however is that a tool of the same name might have a different output or behavior on different operating systems (most notably between the GNU and BSD variants). But in this case the kernel API is probably different as well, so you'll have to implement an abstraction layer anyway.
- akerl_ 8y agoIn this case, `lsof` is a relatively lightweight parser for /proc. The /proc filesystem API is amazingly stable. The unstable ABI is internal to the kernel itself; the interaction with userspace is where backwards compat is held as the highest guiding principle (see Linus's remarks about breaking userspace). By contrast, lsof can change output at any time. I've not done enough parsing of lsof to be familar with past changes, but have seen meaningful changes in the default output of lsblk, df, and other core CLI tools that wrap system information.
- dry-soup 8y agoBruh
- theqult 8y agoFifteen years of maintenance and updates for having what on every normal operative system is available in five minutes. Yep, is definitely a Mac :D
- deleted 8y ago[deleted]
- Angostura 8y agoWell lsof is available on a Mac if you want a command line, as is Activity Monitor. Shrug
- runjake 8y agoIf you like this app, you should also check out Task Explorer by reknown security researcher Patrick Wardle. https://objective-see.com/products/taskexplorer.html https://objective-see.com/products/taskexplorer.html
- gregkerzhner 8y agoHoly fat controller! This whole source code is mostly in just a single file. https://github.com/sveinbjornt/Sloth/blob/master/source/SlothController.m https://github.com/sveinbjornt/Sloth/blob/master/source/Slot... Curious what patterns you iOS developers out there do to avoid code like this? Personally I am a big fan of ReSwift.
- Pulcinella 8y agoThis[1] video with Andy Matuschak helps with refactoring these “Mega” controllers. This[2] article also is good when it comes to breaking down controllers into smaller pieces. I will admit it’s a hard problem for me. Putting everything into one view controller is so easy and makes certain problems go away. e.g. Storyboards are a lot easier to deal with when their outlets are in the massive view controller. Custom UIviews with storyboards are a huge pain to get working with interface builder. [1] https://academy.realm.io/posts/andy-matuschak-refactor-mega-controller/ https://academy.realm.io/posts/andy-matuschak-refactor-mega-... [2] https://www.smashingmagazine.com/2016/05/better-architecture-for-ios-apps-model-view-controller-pattern/ https://www.smashingmagazine.com/2016/05/better-architecture...
- fouc 8y agoThe code is pretty clear though. It is well laid out and doesn't feel cluttered.
- svth 8y agoAuthor of Sloth here. The controller didn't start out quite so fat, the whole thing was quite slim, 400-500 lines, when I first put Sloth together some 15 years ago. It grew as various additional features piled on over the years. However, your point is well taken. I should refactor things at some point.
- openloop 8y agoCool!
- deleted 8y ago[deleted]