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?
8 Answers
You may try a few to things to improve your experience with the command line.
- Use tab completion (automatically fill in partially typed commands by pressing Tab) whenever possible.
- Press ↑ (up arrow key) to automatically print the last command, and keep pressing ↑ & ↓ (up & down arrow keys) to cycle through the command history.
- Drag a file into the terminal to automatically print the complete path.
- Press Alt+. (dot) to insert the last argument from the last command you executed (useful for e.g.
mkdirfollowed bycd). - Use keyboard shortcuts (see this and this).
- Use Bash aliases (see this and this).
- Use
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 simplyhfor quick and easy access. - Use a reverse terminal search (Ctrl + R, then start typing) to match earlier commands; it's a quick way to find things from earlier.
- Use a shell that completes commands and optional arguments such as Zsh or fish.
- Use a font which increases readability for readers with dyslexia, e.g. "OpenDyslexic", in Terminal.
- Hear what is on the screen as you are reading; enable a screenreader like Orca. You can have it read just one word, a whole page, spell out words letter by letter, change speed, volume, level of detail, etc.
- Enlarge a part of the screen as you are reading; take a look at apps that zoom with keyboard shortcuts, like Magnifier.
- Advanced: personalize the way the output displays, like setting conditional text colors. The default Ubuntu distro provides several enhancements to Terminal. When you use
lsto 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:
alias agi='apt-get install'
alias mkdri='mkdir'
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:
$ pyhton scirpt.py
zsh: correct 'pyhton' to 'python' [nyae]? y
zsh: correct 'scirpt.py' to 'script.py' [nyae]? y
...
You can turn it on with the following line in your .zshrc:
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
- 1,191
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.
- Download it.
- Install the font.
- Open a terminal navigate to the menubar and select Edit->Profile Preferences
- Turn on custom font and select the open dyslexic mono font.
- 211
To complete @pomsky 's answer, I would like to add some points :
Learn how to automate things, especially learn how
forloops work, how doesreadworks, how doesifworks, 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
rmwith the-iswitch when in dangerous situations (like withsudo), or maybe install and usermtrash(which will put garbage in trash)Use
cpwith the-nswitch, which will not overwrite existing files when copying. (Of course, more useful when copying recursively)Learn how to use the
~/.bashrcfile, it can make the$PS1variable 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.
- For instance, if you are a student learning how to develop with c++, try setting the
$CXXFLAGSin 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.cppand 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.
- For instance, if you are a student learning how to develop with c++, try setting the
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.
- 43
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.
- 207
- 1
- 13