I am new to Linux, and being dyslexic, find working from a command line a challenge. What aids or advice is available to help work with this issue?
I am new to Linux, and being dyslexic, find working from a command line a challenge. What aids or advice is available to help work with this issue?
You may try a few to things to improve your experience with the command line.
mkdir
followed bycd
).history
, you can view the command history and then use the number of the historical command to re-execute the command (e.g., redo command #352 with!352
). Alias it to simplyh
for quick and easy access.ls
to list contents of a directory, for example, subdirectories print in blue and filenames print in white, making it easier to distinguish the two. For other examples, have a look at the many personalizations people have shared. Some are sure to be worth trying out "as is". One good starting point is the popular Awesome dotfiles repository.I will attempt a comprehensive answer. If I left something out, please comment and I will add it.
Tab completion
Tab completion is your biggest help here. Pressing Tab will complete the command as as far as is uniquely identifiable. Pressing Tab twice will give a list of options. Typing enough caracters to Identify which option you want and pressing Tab again will complete it. This also works with path/file names.
For example, let's say I have a user named Paul, and he has the file text123.txt and text124.txt in his Downloads folder:
I could type /h Tab and bash will give me
/home/
. Then type P Tab and get/home/Paul/
. And continue in this fashion until I have the complete file and path.Path/file name expansion
Auto-completion also accepts wild cards
*
and?
.?
matches a single character, and*
matches all characters (or none). Using the above example, I could type:/h*/P*/Dow*/t*4*
then Tab and bash will give me/home/Paul/Downloads/text124.txt
. If I am sure that I am matching the correct file, I can just hit Enter to execute the command with out expanding it first.Some common directory references are:
~
for your home directory...
parent directory.
current directory; in case you want to absolutely sure that bash looks in the right directory.Keyboard shortcuts
The up arrow ↑ and down arrow ↓ keys lets you navigate through a list of recently used commands. Press Ctrl+G to escape from history searching mode. Alt+. repeats the last argument of the previous command.
Aliases
Bash allows you to specify aliases. If you find that you often mistype a command the same way, you can add custom aliases by editing
~/.bashrc
and adding lines like this:Then relogin to activate them.
The Zsh shell (or at least the version I am using, Oh-my-ZSH) has a feature that corrects you if you make small typos in command and file names:
You can turn it on with the following line in your
.zshrc
:You could try using the open dyslexic font in your terminal. It might help with reading the text. This is assuming that you're using the default ubuntu terminal, which I hope is the same as the GNOME terminal.
https://opendyslexic.org/
To complete @pomsky 's answer, I would like to add some points :
Learn how to automate things, especially learn how
for
loops work, how doesread
works, how doesif
works, what are[ ]
and[[ ]]
, use the unofficial bash strict mode, because once a script is valid, it is easier not to make mistakes.if you can, install the bash-completion package (can come with different names according to versions)
Use
rm
with the-i
switch when in dangerous situations (like withsudo
), or maybe install and usermtrash
(which will put garbage in trash)Use
cp
with the-n
switch, which will not overwrite existing files when copying. (Of course, more useful when copying recursively)Learn how to use the
~/.bashrc
file, it can make the$PS1
variable more clear for you.And maybe the hardest if you are young :
Try to know a little better the state-of-the-art and common tools of what you are doing.
$CXXFLAGS
in your~/.bashrc
. (For instance :export CXXFLAGS=" -std=c++17 -fmax-errors=1 -Wall -Wextra -pedantic -Werror "
according to your c++ version of course, so I guess c++11 for ubuntu), then compile withmake main.cpp
and your options will be carried over. Note that this set of option is pretty harsh : everything correct and standart will be seen as an error and prevent you from compiling.I learnt I was dyslexic after being a Unix engineer and a proficient shell user for many years on many different platforms (Linux, AIX and Solaris).
Dyslexia affects different people to different degrees so the assumption that "we see things out of order" can be an over simplification and frustrating if it doesn't affect you that way - I actually find the default fixed-width font of terminals extremely readable (white-on-black seems nice for me)
Shells are difficult to learn with lots of acronyms and unintuitive conventions to navigate, which often makes it hard to learn for people who enjoy straightforward words with regular patterns.
I now understand that most dyslexics learn and memorise from first-hand experience. We're very poor at rote learning or consuming a load of wordy theory. Once we've digested the theory by application, however, it usually sticks fast with a deep intrinsic understanding. To this end, Focus on finding shell examples and trying them out by typing them out by hand and understanding what each line does. Experiment, break things, stay up all night fixing it.
Over time you'll remember more and more commands and spot patterns in the way developers have implemented their programs which can be applied to the next command. However, not all commands follow the same conventions when passing arguments/parameters so it'll take a while to learn the commands that are similar.
Like anyone else, after a few years it'll become second nature. Over time, however, you may gain the dyslexic advantage where you intuitively know how to solve solutions and perform complex root-cause analysis using your 6th sense-like ability to spot patterns or breaks in patterns.
With the exception of the tab-completion and the up key advice, I find most answers will only make the experience even more overwhelming. Ignore them. Simplification is the key
Try "FISH" Friendly interactive shell. Available in the repos.
I used to struggle with command line using BASH. Fish remembers all last commands and offers completion. sudo apt install fish then in bash type; fish. If you like it look up instructions on how to make it your default shell. There are other shells available; FISH is my choice. Once you get started you might like it.
There is a tool, which sits between a joke and a priceless helper.
https://github.com/nvbn/thefuck
You can try it in addition to other recommendations in this thread. The main idea is that when you f*** up writing something and receive the unknown command or whatever, this tool will correct and re-execute it.
It is not a silver bullet, but may be worth trying it.