Hi Linux power users, I was wandering how you do search for files

I think maybe what you might be looking for is Midnight Commander? I think the command to run it is “mc” - it’s supposedly a clone of the old Norton Commander for MS-DOS (but for UNIX / Linux) systems. I can install it on Ubuntu with “sudo apt install mc”. It’s a console tool you can run in a terminal window, but you can still even use a mouse if you want (e.g. open the menus at the top).

At the very bottom of the MC screen, i.e. in the “black space” under the “Hint:” you can still use shell commands - e.g. cd /home/x

I issued the “mc” command from ~/MPZ folder - and it presents that as the default view (note: ~/MPZ is a shortcut to /mnt/BARGEARSE/MPZ - my music collection on my NAS [over NFS]):


I typed “cd /home/x” to go to my home folder.

And now the left pane is in my $HOME (/home/x)

Note also - as you navigate the tree - the very bottom “pane” of the blue part, of that pane, will show stuff - e.g. if the cursor (where you’ve stopped navigating) is over ~Music, it will show that this is a symlink to /home/x/ResilioSync/Music :

As for searching / finding :
Top menu : Command → Find file :
Screenshot from 2022-12-18 11-06-41

I chose “shit” as the search item - because I use that string in a lot of file and folder names :smiley: so it’s bound to yield some hits :


You can see at the bottom of the results, there’s options there to e.g. “Chdir” to that folder that has a result… Neat…

Me - I personally don’t use it… I mostly use all the GNU commands at my disposal :

  • cd
  • ls
  • pwd
  • tree (not very often mind you)
  • find
  • chmod, chown, chgrp
  • du
  • df
  • file
  • cp, mv, mkdir, rmdir
  • on debian and ubuntu systems, I often use the “rename” command, it uses Perl/Sed style regex to rename files (e.g. remove space chars from filenames) - but - on Fedora / RedHat systems, “rename” is an entirely different command, and the only way to get it on RPM based distros is to enable CPAN and install it from the Perl repos, e.g. as the command “prename” (mnemonic for Perl Rename)

I’ll often use find with exec - e.g. one thing that bugs me on my NAS is some stuff is stored in folders with 777 - now I don’t remember doing that - in fact, I NEVER do that (I think sometimes it might be stuff I downloaded as a ZIP file and they get unzipped with 777 :rage: ) … I prefer 775 or 755 (drwxr-x-r-x) - and 777 shows up in an ugly colour in the terminal (and probably due to my colourblindness - I mostly cannot even read it sometimes as it’s BLOCKED out in green or orange or some other colour) - so I’ll often do something like this :

find . -maxdepth 1 -type d -exec chmod 755 {} \;

And I guess if I can be arsed, doing it all in one big hit :

find . -type d -perm 777 -exec chmod 755 {} \;

(Note : I’d use EXTREME CAUTION doing the above - i.e. even I sometimes make mistakes after 30 years of using UNIX - this is the MAIN reason I only do it on a case by case basis, and only
with -maxdepth 1 - it could potentially take hours on my 900 GB of music files and too much potentiall for human error) **

And I used to use this to find BIG folders :

find . -maxdepth 1 -type -exec du -sh {} \; | sort -h

But then I realised “du” itself had a maxdepth argument so

du -d 1 -h |sort -h

Except for the SHITTY fact that Solaris can do NEITHER of those neat tricks, doh (and I do get filesystem at 80, 90, 100% calls at 3:00 am for Solaris servers!)! A lot of times ~15-20 years ago, you could get the GNU versions of tar and find and grep and ALL those goodies as Solaris Sparc binaries from SunFreeware, but around 2012 - Oracle sent the Sunfreeware Org people a nasty cease and desist letter - but DID NOT OFFER THEIR OWN ALTERNATIVE!

Oracle are doing their damnedest to kill off Solaris.

** I’ve had cases before where some “web developer” (i.e. using Dreamweaver on a Mac) did a chmod 777 and there was NO way to recover from this moronic act. The only way I can think of, is to either BEFORE you do something so utterly STUPID, run “getfacl > file” (or similar) and record the perms BEFORE you change them (you can always replay that “file” later on to set them back to what they were before when the Dreamweaver user used their “passion fingers”…

5 Likes