98

It seems to me learning how to use the terminal is a prerequisite to learning how to use Ubuntu. So I'm trying to figure out the best way to learn. Is there a Quizlet online flash card set out there? A better way?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Capitalism Prevails
  • 1,158
  • 2
  • 10
  • 14
  • 4
    Have you at least tried Google? – mdpc Aug 26 '13 at 06:31
  • or explored Amazon? – mdpc Aug 26 '13 at 06:37
  • 27
    If you want a crash course, "How to Get a GUI Back After I Accidentally Fubared the Config Files So Badly Only the Shell Will Load" is always a winner. Be warned that if you lose the game possible penalties include buying a greybearded friend a case of his beverage of choice or reinstalling the OS. – Dan Is Fiddling By Firelight Aug 26 '13 at 15:38
  • 1
    My favorite UNIX game is called 'bash.' The hardest level on it is called "delete a file called '-rf ~/*'" – fluffy Aug 26 '13 at 22:34
  • 6
    @fluffy: That's not even hard: rm -- '-rf ~/*'. For a real challenge, try deleting a file whose name consists entirely of unprintable control characters. Bonus points if just printing the name messes up your terminal. – Ilmari Karonen Aug 27 '13 at 00:28
  • 3
    That's not too hard either :P rm -i * and just answer yes when you come across the right file. – ooa Aug 27 '13 at 08:36
  • 5
    Does "real life" count as a game? – Jonathan Aug 27 '13 at 10:58
  • I agree with the OP. A game would be cool. Yes, I could read man pages, but a game like duolingo would be uber sweet. – Andrew Grothe Aug 27 '13 at 11:00
  • Codeacademy is a good website that teaches HTML and I believe some other languages... its not exactly games, but it is shows you how to do it and it is relatively easy. – kyle_hamblett Aug 27 '13 at 12:56
  • @DanNeely i feel stupid for actually googling that to see if it exists. – acolyte Aug 27 '13 at 14:52
  • @acolyte try this then: https://www.google.com/search?q=gamification – Dan Is Fiddling By Firelight Aug 27 '13 at 15:12
  • 1
    @IlmariKaronen Yes, I know that, but it used to be a "fun" "prank" that people would pull on each other in college. Of course I did a comic about the modern solution: http://beesbuzz.biz/d/20110224.php – fluffy Aug 27 '13 at 21:49
  • @ovc Except that * expands to start with '-rf ' which would override the -i (although would also fail to work because space and are unrecognized options to rm). The -- really is necessary, to tell rm to stop processing args. – fluffy Aug 27 '13 at 21:52
  • 1
    Amazingly, the easy answer to this question is YES: http://quizlet.com/4216068/terminal-commands-flash-cards/ – Elder Geek Jun 27 '14 at 02:05
  • You might look at CLMystery. You copy a bunch of files & directories to your computer, then follow the instructions & use commands to read case files & solve a mystery. https://github.com/veltman/clmystery – Sherri Sep 14 '18 at 20:06

20 Answers20

130

You can add the following line (command) at the end of your ~/.bashrc file:

echo "Did you know that:"; whatis $(ls /bin | shuf -n 1)

Every time you open the terminal you will learn something about a random command.


If you want some fun, you can use cowsay "utility". To install it, run this in terminal:

sudo apt-get install cowsay

Then add the following line at the end of your ~/.bashrc file:

cowsay -f $(ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1) $(whatis $(ls /bin) 2>/dev/null | shuf -n 1)

Or you can add the above line as alias in ~/.bash_aliases. I added:

alias ?='cowsay -f $(ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1) $(whatis $(ls /bin) 2>/dev/null | shuf -n 1)'

Whenever you get bored, you can type in terminal: ? (followed by Enter). It's like playing dice by yourself.

enter image description here

Radu Rădeanu
  • 169,590
  • Although thats neat, /bin doesn't have very many commands, at least on my distribution. I would at least add /sbin to list. /usr/bin and /usr/sbin get kind of noisy though. Maybe you could do one from each to give you a diversity. – user606723 Aug 26 '13 at 18:08
  • 2
    That's extremely cool, but on my distro (Ubuntu 13.04) using the default shell I get Did you know that: mkdir: nothing appropriate. every time I start a shell (to be pedantically clear, I don't always see mkdir but I do always see nothing appropriate). whatis works if I put your line of code at the top of ~/.bashrc but not at the end. Not sure what it is that messes it up, but I guess others will run into the same problem. – snim2 Aug 26 '13 at 18:17
  • 3
    @user606723 I chose only /bin because over there are the most used commands. But you can use echo "Did you know that:"; whatis $(ls /usr/share/man/man1 | shuf -n 1 | cut -d. -f1) to choose a random page from all man pages. – Radu Rădeanu Aug 26 '13 at 20:01
  • 1
    @RaduRădeanu do not parse the output of ls! – heinrich5991 Aug 26 '13 at 20:05
  • @snim2 There is a problem with your man pages if you get something like mkdir: nothing appropriate. Anyway, to bypass this, you can use: echo "Did you know that:"; whatis $(ls /bin) 2>/dev/null | shuf -n 1. Also there is a problem with your ~/.bashrc file and your guessing is unlikely. – Radu Rădeanu Aug 26 '13 at 20:09
  • If you get that for everything, run mandb as root. – Torvero Aug 26 '13 at 20:15
  • 3
    @heinrich5991 of course you are correct in general, but if anything in your /bin has spaces or newlines in its name then you have bigger problems than bad scripting habits... – evilsoup Aug 26 '13 at 21:40
  • I don't see how a filename with spaces/newlines/etc. is more of a problem in /bin than anywhere else. – heinrich5991 Aug 26 '13 at 23:19
  • 1
    @snim2 I suspect the problem is be an alias for ls that adds -F or some other flag that affects the output. Change ls /bin to /bin/ls /bin. – Gilles 'SO- stop being evil' Aug 27 '13 at 14:40
  • echo "Did you know that:"; whatis $(ls /bin | shuf -n 1) if we add this, we cannot copy anything from remote machine using "scp".... – Naive Dec 10 '13 at 13:27
37

I used to play with whatis. It's not exactly a game, but it's a relatively easy way to learn.

For example, type whatis sudo apt-get update and it returns:

enter image description here

Before I execute any command, I hit it with whatis first. I learn what I'm going to do, then I will do the command with confidence.

If whatis doesn't provide much information or if it's unclear to me, I will go to and read the man.

For example, man sudo.

Google gives you so much info here, sources inside Ask Ubuntu and outside. Here, LMGTFY: best way to learn terminal commands on Ubuntu

Achu
  • 21,237
  • 1
    I'd highly recommend to follow whatis something with a thourough read of man something BEFORE using the "something" command ^^ . Especially for some (most!) commands, ie dd for example... Man would, for example, also explain the "update" parameter in the example you provide yourself... In your example, whatis shows what is "apt-get" and then tries to find definition of "update" command, which doesn't exist (but could have and be something completely irrelevant) – Olivier Dulac Aug 26 '13 at 12:50
27

Yes, Terminus is once such game that will help. There is a live version here, and the code is on github. It's a neat idea, although I rather wish the code was more easily extensible.

snim2
  • 430
21

I do not know of any games, however there are some useful command line utilities that help.

What does a command do?

whatis command
# example:
$ whatis cut
cut (1)              - remove sections from each line of files

How do I?

man -k keyword
# example:
$ man -k "remove empty"
rmdir (1)            - remove empty directories

Alternatively:

apropos keyword  
# defaults to printing every result with at least one of the keywords supplied
#   use --and to only print results matching multiple keywords.
$ apropos zip --and extract
funzip (1)           - filter for extracting from a ZIP archive in a pipe
unzip (1)            - list, test and extract compressed files in a ZIP archive
unzipsfx (1)         - self-extracting stub for prepending to ZIP archives
uz (1)               - gunzips and extracts a gzip'd tar'd archive

How do I use?

man command
# example:
man tar
# use '?' key to search, and 'q' to quit.

Or, some utilities support a help option, such as:

$ umount --help
Usage: umount -h | -V
   umount -a [-d] [-f] [-r] [-n] [-v] [-t vfstypes] [-O opts]
   umount [-d] [-f] [-r] [-n] [-v] special | node...

These may be in the form of command -h, command --help, command -?.

For information:

info command
# example:
$ info cat
# shows an information page

If you have something specific you need to accomplish, Google is your friend. Otherwise there are many books, such as the Bash book from O'Rielly.

azz
  • 311
  • 1
  • 6
  • 1
    Add apropos and info to the list. ;) – Johannes Kohnen Aug 26 '13 at 10:06
  • 3
    i'd avoid using < and > at all, as persons who need direction to use man may not know the danger of redirection . For example : command <something> somethingelse will create a somethingelse empty file (or truncate an existing one!) in the current dir. It's a bad habit. Just using man command is quite self explanatory. Or man __some__command__ or anything safe. – Olivier Dulac Aug 26 '13 at 13:02
  • hmm, actually it's safe if the <something is not an existing file, as otherwise the shell will complain it doesn't exist (apparently does so BEFORE creating the output file)... But still, bad habit – Olivier Dulac Aug 26 '13 at 13:03
  • 1
    Good point. Just used to writing documentation in that format. (edit) Removed them. – azz Aug 26 '13 at 15:38
14

Take a look at command line fu

You can browse some cool command line snippets, and if you want deeper understanding you can read the manuals of the commands they use.

Iftah
  • 241
  • 1
  • 3
13

Ubuntu was designed to be very user friendly. Learning how to use the terminal is not a prerequisite to learning how to use Ubuntu. It is, however, if you want to become a power user or troubleshoot problems yourself.

To answer your question, I don't know of any games designed to help or teach shell commands, but I would highly recommend the following resources bash and system administration related:

Please note that this tutorial uses Red Hat (another Linux distribution) and references some directories that only apply to students of the University of Surrey.

Hosted at The Linux Documentation Project (http://www.tldp.org/), author Mike G

A wikibook from Wikipedia

GNU Bash Reference Manual

Advanced Bash-Scripting Guide (http://linux.die.net/), author Mendel Cooper

Stef K
  • 4,836
Hugo Vieira
  • 1,272
  • 9
  • 10
8

You've got tons of games on http://overthewire.org. The easiest is Bandit, "aimed for absolute beginners".

11684
  • 181
  • 5
  • Excellent link. Seems like there are many wargames in there. Bandit seems to be the game for absolute beginners like me. – Sundeep Nov 20 '13 at 12:20
5

There is a game for learning the VIM commands at http://vim-adventures.com/ which I recommend. I get my apprentices to play it on their first day :-)

Dogsbody
  • 209
  • 1
  • 5
2

The Memrise Tool has a unix and linux command line section. It's a great tool for learning anything in a punch card manner.

deworde
  • 121
  • 3
1

The Linux Documentation Project is having the best and updating sources for learning BASH.

  1. http://www.tldp.org/LDP/Bash-Beginners-Guide/html/

  2. http://www.tldp.org/LDP/abs/html/

  3. http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

Ubuntu Community have collected all the good links which are very much helpful to learn BASH

https://help.ubuntu.com/community/CommandLineResources

Raja G
  • 102,391
  • 106
  • 255
  • 328
1

There is the game Uplink. It's been quite fun and threre are pretty good similarities to a linux shell. But it's got its own commands as well.

Samoth
  • 111
  • 3
  • 1
    While Uplink is a great game, it's command line is limited to cd, dir, delete and reboot. Quite insufficient. I remember there's another hacker game where you actually have to write shell scripts, but I forgot the name. Probably something creative as "hackers" – Tobias Kienzler Aug 27 '13 at 14:04
1

The best tool I have found for long term memorization and learning is Anki

http://www.ankisrs.net/

I use create cards in Anki that require me to type the answer, rather than simply a flash card. It builds the muscle memory. Additionally I perform 15 minutes of training every morning and Anki will sort my cards based on the ones I need to review.

BDubbs
  • 43
  • 5
0

In the early UNIX days (v6 and v7) (yes before Linux), there was a series of very simplistic tutorials under the command called learn. I must admit, I started my training there .. it had tutorials on command line, vi, and a little bit of C programming. It has long since disappeared. And of course, this was before the proliferation of books on this subject, the high amount of easy internet connectivity, basically all you had was basically the man pages.

So now it is quite easy, basically go to Google, either find some documentation posted. Or use amazon to find an appropriate book. Amazon even has ratings and reviews on their books.

mdpc
  • 1,199
0

Well, most of the basics I learned when Linux was still mostly command-line based and SUSE was one of the few Linux with GUI-based installation. I played around with Gentoo these times...just install your system with some tools like pm-sensors and stuff, soon you're back in the terminal for some configuration

I don't know if there is still a distro that is installed via command-line, as I stopped working with Linux till a month ago, when I found out they finally made the step to getting GUI-based and interesting for Users, great thanks to all programmers out there, that made a lot of my old PCs useful again!!!

Stupid MS simply IS too stupid for maintaining their best product any longer...Windows XP...a company that does that, surely is not considering to get an OS fully stable and safe...and in case of Win 7 they may got it very stable and secure, but it takes way to much resources to do so.

Really love the Linux way off controlling hardware without huge compilers or interpreters or other stuff in the way, like on Windows.

But if you want learn more about Linux, Gentoo is a great way of building up your own system, step by step and also learn how Linux works. Gentoo also is able to run on nearly everything, no matter how small the hardware resources, so you can take a other, older PC for these Linux, install-test, fun times!

0

Not exactly a game, but there is this site, where you can learn several different commands.

thiagowfx
  • 845
  • 6
  • 9
0

Not a game but take a look at http://www.stanford.edu/class/cs124/kwc-unix-for-poets.pdf

It covers sed, awk and grep besides others and shows you how to count, sort, compute ngrams etc. It has exercises and all. I've referred to it again and again.

Himanshu
  • 101
  • 3
0

Not a game, but comes handy when you want to learn some command and no linux is available: rextester

ren
  • 101
0

The matrix for game cube is where I learned quite(relative to my 13 year old prior knowledge) a bit about the UNIX terminal. There was a mini-game where you'd "hack" your way into the matrix to drop guns off for pickup later when you are playing that level. Actually bar far one of my favorite features of any game ever.

Colton
  • 109
  • 2
0

inx (is not X) can be used as live cd and teaches terminal stuff in a fun and interactive way

catch22
  • 55
0

I guess bandit is one of the best to learn and understand more about Linux commands and knowing more about linux for beginners. You can get the link from here

Vishnu N K
  • 595
  • 5
  • 22