Skip to content

Instantly share code, notes, and snippets.

@stark
Last active August 29, 2015 14:21
Show Gist options
  • Save stark/abd4da69719484785246 to your computer and use it in GitHub Desktop.
Save stark/abd4da69719484785246 to your computer and use it in GitHub Desktop.
LinuxBBQ Academy

Lesson 7 - Terminal III: Productivity without overhead

Most daily tasks, like reading and answering emails, listening to music, reading some RSS feeds, calculating the BMI, creating and extracting zip archives, surfing the internet, copying files from one computer to the other or checking the weather forecast can be accomplished in the terminal.

Some of the people here at the BBQ even say, that this is the preferred way of doing something.

Why?

To answer this question, check the links at the end of this lesson.

There are people who have written huge articles about the topic - and they are right :)

In this lesson you can lay back and relax. It's really just about choice now, and hopefully you will remember some of the tips when you build up your own productivity systems.

Of course, we first have to know what your daily computer tasks are. Let's put the browsers aside for a moment, they are usually GUI applications and under the hood they really just render websites, plus or minus a few extras.

Let's take a look at file managers instead. They can come handy when you want to move stuff around, in a more visual way than the core utilities. We fire up apt-cache search:

search file | grep manager | more

So we search for packages that have 'file' in the description or package name.

The '|grep' will filter out results that contain the word 'manager' additionally.

Let's add a '|more' because we'll get a huge list, and we prefer to scroll through it.

Damned, still too much choice!

There's everything inside, from nautilus to ytree.

But the BBQ is a nice place, so here's a list of file managers for the console, to save you from installing bullshit:

clex

fdclone

gnuit (gitfm)

lfm

mc

ranger

vifm

vfu

ytree

Well, what's the difference between clex and fdclone, or vifm and vfu, for example?

Firstly, they look and work different. You can have file managers with a single pane, some with two panes, others have a preview mode, some can be navigated with the 'home row'. But most importantly, they have different dependencies. Dependencies are packages that are needed by the (main) program to run. For example, 'ranger' (a very nice file browser with on-the-fly preview of images and file contents) depends on Python. If you program in Python anyway, this would be an OK choice as file manager. If you want to keep your system lean and clean, you would rather prefer to install a file manager that does not depend on extra packages.

How to find out? Use apt-cache depends:

depends ranger

which spits out:

ranger

Depends: python

Depends: python

Suggests: atool

Suggests: caca-utils

Suggests: elinks

Suggests: elinks-lite

Suggests: lynx

Suggests: w3m

Suggests: highlight

Suggests: less

Suggests: poppler-utils

Recommends: file

Recommends: python-chardet

Recommends: sudo

sudo-ldap

Recommends: w3m-img

And now let's compare it with one of the lightest file managers that is in the repos, clex:

depends clex

clex

Depends: libc6

Depends: libncurses5

Quite a difference!

And that's how clex looks like: clex

A nice file manager is vfu. It's similarly lean, and it's a bit easier to use: vfu

And this is ytree, with a nice layout and shortcut help in the bottom row: ytree

Now just to continue the terminal brainwash, here is the dependency count of one of the lightest graphical (!) file managers, using GTK2 and depending on policykit and more:

depends pcmanfm

pcmanfm

Depends: libatk1.0-0

Depends: libc6

Depends: libcairo2

Depends: libfm-gtk4

Depends: libfm4

Depends: libfontconfig1

Depends: libfreetype6

Depends: libgdk-pixbuf2.0-0

Depends: libglib2.0-0

Depends: libgtk2.0-0

Depends: libpango-1.0-0

Depends: libpangocairo-1.0-0

Depends: libpangoft2-1.0-0

Depends: libx11-6

Recommends: gvfs-backends

Recommends: gvfs-fuse

Recommends: policykit-1-gnome

Recommends: lxsession

Recommends: mate-polkit

Recommends: lxpolkit

Recommends: lxde-icon-theme

Recommends: gnome-icon-theme

Recommends: oxygen-icon-theme

Recommends: tango-icon-theme

And hey, there's more. One of the dependencies is libgtk2.0-0. And guess what, this package has another bunch of dependencies that have to be satisfied:

depends libgtk2.0-0

libgtk2.0-0

Depends: libgtk2.0-common

Depends: libatk1.0-0

Depends: libc6

Depends: libcairo2

Depends: libcups2

Depends: libfontconfig1

Depends: libfreetype6

Depends: libgdk-pixbuf2.0-0

Depends: libglib2.0-0

Depends: libpango-1.0-0

Depends: libpangocairo-1.0-0

Depends: libpangoft2-1.0-0

Depends: libx11-6

Depends: libxcomposite1

Depends: libxcursor1

Depends: libxdamage1

Depends: libxext6

Depends: libxfixes3

Depends: libxi6

Depends: libxinerama1

Depends: libxrandr2

Depends: libxrender1

Depends: shared-mime-info

PreDepends: multiarch-support

Suggests: librsvg2-common

Suggests: gvfs

Recommends: hicolor-icon-theme

Recommends: libgtk2.0-bin

... and so on, and so on.

So, before you bloat up your system with dependencies of dependencies, check the repositories first if there is a CLI program that can do what you actually want to do.

See also the most important article of every LinuxBBQ user:

The BBQ Philosophy: http://ow.ly/NkY9P

Further Reading:

K. Mandla's old blog

http://ow.ly/NkPmI

K. Mandla's Inconsolation blog, a must read

http://ow.ly/NkPnU

Fellow griller DebianJoe's X11 Must Die

http://ow.ly/NkPul

The UNIX toolbox

http://ow.ly/NkPww

CommandlineFu

http://ow.ly/NkPy4

Fellow griller GekkoP's blog (Italian)

http://ow.ly/NkPBl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment