Mint 6: 3 new commands

Written by Clem on Monday, October 6th, 2008 @ 10:01 am | Main Topics

Three new commands made their way into Romeo last night: search, apt contains and apt content. All three of them are provided by mintSystem 5.5.

If you have Romeo set up as a repository simply type “apt update” and “apt install mintsystem”. Otherwise you can get the deb from here:

http://packages.linuxmint.com/pool/romeo/m/mintsystem/mintsystem_5.5_all.deb

apt content package

“apt content” shows the content of package, it’s a shortcut for “dpkg -L”. For instance, if you type “apt content mintsystem” you should see the following:

clem@mars ~/Desktop $ apt content mintsystem
/.
/usr
/usr/local
/usr/local/bin
/usr/local/bin/apt
/usr/lib
/usr/lib/linuxmint
/usr/lib/linuxmint/mintSystem
/usr/lib/linuxmint/mintSystem/icon.png
/usr/lib/linuxmint/mintSystem/python
/usr/lib/linuxmint/mintSystem/python/configobj.py
/usr/lib/linuxmint/mintSystem/templates
/usr/lib/linuxmint/mintSystem/templates/apt.conf
/usr/lib/linuxmint/mintSystem/templates/preferences
/usr/lib/linuxmint/mintSystem/GPL.txt
/usr/lib/linuxmint/mintSystem/version
/usr/lib/linuxmint/mintSystem/version/mintInstall
/usr/lib/linuxmint/mintSystem/version/mintInstall/portals.list
/usr/lib/linuxmint/mintSystem/version/mintInstall/release.id
/usr/lib/linuxmint/mintSystem/version/mintInstall/sources.list
/usr/share
/usr/share/doc
/usr/share/doc/mintsystem
/usr/share/doc/mintsystem/copyright
/usr/share/doc/mintsystem/changelog.gz

apt contains filename

“apt contains” tells you which package contains a particular file. It’s a shortcut for “dpkg -S”. For instance if you type “apt contains /usr/lib/linuxmint/mintSystem/GPL.txt” you should see the following:

clem@mars ~/Desktop $ apt contains /usr/lib/linuxmint/mintSystem/GPL.txt
mintsystem: /usr/lib/linuxmint/mintSystem/GPL.txt

search for keyword in directory

“search” lets you search for files containing a particular keyword. You can get a list of options by typing “search –help”:

clem@mars ~/Desktop $ search help

usage: search [arguments] [options]
arguments:
for text
in directory
options:
-c | –case-sensitive
-s | –show-filenames-only

“search” is easy to use. Let’s take an example and search for “workgroup” in /etc/samba. We type “search for workgroup in /etc/samba” and we see the following:

clem@mars ~/Desktop $ search for workgroup in /etc/samba
/etc/samba/smb.conf.ucf-old:26:# Change this to the workgroup/NT-domain name your Samba server will part of
/etc/samba/smb.conf.ucf-old:27:   workgroup = MSHOME
/etc/samba/smb.conf:26:# Change this to the workgroup/NT-domain name your Samba server will part of
/etc/samba/smb.conf:27:   workgroup = MSHOME

We can refine the search by adding “–case-sensitive” or only show filenames by adding “–show-filenames-only”. For instance:

clem@mars ~/Desktop $ search in /etc/samba for workgroup –case-sensitive –show-filenames-only
/etc/samba/smb.conf.ucf-old
/etc/samba/smb.conf

Let us know what you think and if you find any bugs. These will eventually be backported into Elyssa and will be featured as some of Mint 6′s improvements.

9 Responses to “Mint 6: 3 new commands”

  1. Roberto Says:

    Hi,

    Mint’s Review on Distrowatch (Overviews)

    http://distrowatch.com/weekly.php?issue=20081006#feature

    MINT GNOME MAIN EDITION COMMANDS TEST

    Commands (3) – search – apt contains – apt content – has been added

    Romeo enabled (sources.list) and – apt-get update
    mintUpdate has installed mintUpload 2.0 – mintsystem 5.5

    Test:

    roberto@roberto-desktop ~ $ apt content mintsystem
    /.
    /usr
    /usr/lib
    /usr/lib/linuxmint
    /usr/lib/linuxmint/mintSystem
    /usr/lib/linuxmint/mintSystem/templates
    /usr/lib/linuxmint/mintSystem/templates/preferences
    /usr/lib/linuxmint/mintSystem/templates/apt.conf
    /usr/lib/linuxmint/mintSystem/icon.png
    /usr/lib/linuxmint/mintSystem/GPL.txt
    /usr/lib/linuxmint/mintSystem/python
    /usr/lib/linuxmint/mintSystem/python/configobj.py
    /usr/lib/linuxmint/mintSystem/version
    /usr/lib/linuxmint/mintSystem/version/mintInstall
    /usr/lib/linuxmint/mintSystem/version/mintInstall/portals.list
    /usr/lib/linuxmint/mintSystem/version/mintInstall/release.id
    /usr/lib/linuxmint/mintSystem/version/mintInstall/sources.list
    /usr/local
    /usr/local/bin
    /usr/local/bin/apt
    /usr/local/bin/search
    /usr/share
    /usr/share/doc
    /usr/share/doc/mintsystem
    /usr/share/doc/mintsystem/copyright
    /usr/share/doc/mintsystem/changelog.gz
    roberto@roberto-desktop ~ $

    ——————————————————————-

    roberto@roberto-desktop ~ $ apt contains /usr/lib/linuxmint/mintSystem/GPL.txt
    mintsystem: /usr/lib/linuxmint/mintSystem/GPL.txt
    roberto@roberto-desktop ~ $

    ——————————————————————

    roberto@roberto-desktop ~ $ search –help
    usage: search [arguments] [options]
    arguments:
    for text
    in directory
    options:
    -c | –case-sensitive
    -s | –show-filenames-only
    roberto@roberto-desktop ~ $

    ———————————————————————-

    roberto@roberto-desktop ~ $ search for workgroup in /etc/samba
    /etc/samba/smb.conf:26:# Change this to the workgroup/NT-domain name your Samba server will part of
    /etc/samba/smb.conf:27: workgroup = MSHOME
    roberto@roberto-desktop ~ $

    roberto@roberto-desktop ~ $ search in /etc/samba for workgroup –case-sensitive –show-filenames-only
    usage: search [arguments] [options]
    arguments:
    for text
    in directory
    options:
    -c | –case-sensitive
    -s | –show-filenames-only
    roberto@roberto-desktop ~ $

    roberto@roberto-desktop ~ $ search in /etc/samba for workgroup -s
    /etc/samba/smb.conf
    roberto@roberto-desktop ~ $ search in /etc/samba for workgroup -c
    /etc/samba/smb.conf:26:# Change this to the workgroup/NT-domain name your Samba server will part of
    /etc/samba/smb.conf:27: workgroup = MSHOME
    roberto@roberto-desktop ~ $

    ————————————————————————–

    Please, take a look at my results.
    Roberto

  2. tim Says:

    Thanks Clem for this useful new features
    but for “apt contains” I don’t need a path?
    {~._.~}
    ( Y )
    ()~*~()
    (_)-(_)
    tim@mint-felicia ~ $ apt contains GPL.txt
    mintsystem: /usr/lib/linuxmint/mintSystem/GPL.txt
    mintupdate: /usr/lib/linuxmint/mintUpdate/GPL.txt
    I like the “search” command, because I’m not a big fan of tracker!
    its powerful to find text also in binaries
    Now I can find my stuff ;)
    cheers
    Tim

  3. Eder Says:

    Very good..
    Thats features are realy util..
    All distros maybe adopt this.. ;)

  4. Angelo Says:

    Nice marketing hype, but
    apt content = dpkg -L
    apt contains = dpkg -S
    search for text in directory = find directory -type f -exec grep -iH text –color=auto -n {} \;
    New commands? Hardly. “search” could be useful, but then, it could be better without “for” and “in”.
    Sorry, I usually appreciate your work, but this thing looks really like a n00b bait.

    P.S. Does “{}” work? Shouldn’t it be “\{\}”?

  5. Clem Says:

    Angelo: We don’t do marketing hype, this has one purpose only: to simplify your usage or Mint and make it more comfortable. I personally use the search command A LOT, and that’s the reason it’s here.. because for simple things we shouldn’t have to google up complicated commands. Read the blog post and you’ll see, it’s no secret these commands are indeed just shortcuts but they make our life easier and yes, I do believe they add a lot to this particular release.

  6. Sorpigal Says:

    @Angelo

    {} works. Curly braces are not special enough that you need to escape them.

    Also, consider using + instead of \; when you want to operate on a bunch of files and don’t need to do one at a time (as in your example). It works like piping to xargs instead of using -exec, but you avoid the extra process. man find for details.

  7. Angelo Says:

    > {} works.

    You’re right, in bash it works. In fish I need to escape them. Stupid me to not have tried in bash before asking…

  8. oes tsetnoc Says:

    Does anyone know what I have to change for showing the thumbnail and just the excerpt with it?? on my /etc/samba/smb.conf


Trackbacks & Pingbacks

  1. fosron.lt » Linux Mint 6 "Felicia" RC1 Says:

    [...] O komandinės eilutės megėjams atsirado trys naujos komandos – search, apt content ir apt contains. Apie jas plačiau – Linux Mint blog’e. [...]