Snott

Blog

  • Tips to learn command-line in Linux

    Tips to learn command-line in Linux

    command line interface icon

    This post is intended to instruct Linux users to get on the right track to begin using the command line effectively by providing some guidance in the learning process. This is the way I learnt on how to use the CLI and have worked for me every time.

    First things first, NEVER EVER uninstall your GUI (Graphical user interface) if you aren’t comfortable with the CLI, because if you do and you get stuck doing something then you wont have a fallback method and will become frustrated and probably give up.

    Also its important to note that when you start to notice that people on forums tend to give you instructions/help via CLI commands then you start to understand things and you feel better using the CLI. I started with Ubuntu  and all GUI versions of programs, and have slowly worked my way to have a perfectly working file server at work (using ubuntu server, CLI only) and a perfectly working arch for my Laptop. Pretty much all system maintenance is done via CLI.

    Here are some simple steps with simple tasks to get started:

    Learn the most basic commands first (cp, mv cat, reboot, poweroff, man, ls) and get comfortable using them

    The above commands are critical on any Linux system, It doesn’t matter what distro you use, all this commands will be available and MUST be learned if you want to be GUI free.

    – cp is for copying files

    – mv is to move files

    – cat is for concatenating files and print on the standard output

    – reboot, well, the command name pretty much says everything you need to know

    – poweroff turn off the machine

    – man is for watching man pages (descriptions of swicthes for an specific command and how to use them)

    – ls is to view files and folders structure

    Choose some widely used tools and learn how to work with them

    Applications like nano or vi for text editors (nano it’s very easy to use, vi is more advanced).

    You can learn to use vi by using the included tutorial just type “vimtutor”  and you will get a full tutorial explaining it step by step on how to master it.


    Every time you need to update/remove a package, do it via your package manager CLI commands

    -On Ubuntu you can use apt-get to do this

    -On Arch Linux its pacman

    -On Mandriva is urpmi

    And so on, package upgrade/removal is done a LOT faster if you know the CLI commands

    Make extensive use of the man command

    It gives all the required info to know what you are doing, for example if you are going to use pacman but don’t know what the commands are just  type “man pacman” works with 99% of applications. Also you can use the –help parameter (ie, pacman –help) to give you a brief description of commands.

    the –help and man commands are the most useful and will make you learn fast.

    If you follow this steps you will (probably without noticing) use CLI more often than GUI to do stuff.

  • Fix Firefox crash running Quake Live on ArchLinux

    Fix Firefox crash running Quake Live on ArchLinux

    Quake Live logo

    If you tried to play Quake Live on Arch Linux, you might get this error if you don’t have libpng version 1.2 (run Firefox via terminal to check this)

    libpng warning: Application was compiled with png.h from libpng-1.2.24
    libpng warning: Application  is  running with png.c from libpng-1.4.3
    libpng warning: Incompatible libpng version in application and library

    Terminal will be spammed with this series of warnings and Quake Live wont start or can even make Firefox crash (Screen images don’t load at all and you only see squares).

    The problem here is, as you can tell from the terminal output, the libpng version to compile the software is older than the one arch has installed.

    So, to fix this you have to do two things:

    1) Install the old libpng on arch (available on the AUR)

    sudo yaourt -S libpng12

    2) Tell Firefox to use it on Quake Live page

    Here is the command:

    LD_PRELOAD=/usr/lib/libpng12.so /usr/bin/firefox

    This will load the library and Firefox will open up, then go to the Quake Live page and try a training session to see if it loads correctly.

    If it worked, then you can make the change permanent and automate the process with this command:

    alias quakelive='LD_PRELOAD=/usr/lib/libpng12.so /usr/bin/firefox http://www.quakelive.com'
    

    This way, when you type "quakelive" on the terminal, it will open up Firefox and everything will work right away, no need to remember the previous command.

    Some more tips so you don’t have to search for them:

    – alt+enter makes Quake Live Fullscreen

    – Quake Live supports Firefox ONLY regarding Linux, so don’t bother trying to get another browser to work with Quake Live, but they are working to get other browsers work too (like chrome-chromium). Nevertheless If I find a way to make the game work on chromium (my primary browser) I will put the HOWTO here.