I’m a Windows user of all life. But I love Linux. And these last two years after so many time I started learning it in deep . But one thing is bugging me is that I am those persons that has bad times remembering names, words… imagine commands… Even after using it so much I remember some basics but I’m struggling a lot and I have to go back to notes constantly to do some basic operations. Even worst after trying multiple distro from from different upstreams that commands are … Different. What would be your recommendations to help me. Are there tools to help this issue ? My guess is that A LOT of people happens the same. And it’s one of the reasons Linux has such a slow adption . Because is excellent and full of capabilities.
strg + r
Idea 1:
Print out some of the various CLI cheat sheets and pin them to your wall by where you work on your computer.
Maybe this one:
Then, print a page with commands you commonly use, either with more complex syntax or that aren’t on the sheet. (Like, “ls” is on there, but “ls -s -h” is not, for example.
Idea 2:
Write bash scripts to automate some of your commonly used tasks. Comment them. Imagine someone else is going to have to use them, even if you’re the only one who’s ever going to look at them. Not only will this help you learn lots of commands and force you to describe what they do (which will help you retain the information), it will be there as a record of how it works that you can go back and look at months or years later, to remind yourself how to do something.
Yes, write automation. This will lead you to learning new commands that solve problems as you go. Debugging until they work correctly also helps make them more familiar. This is the best way to learn for sure. At least in my own experience, could be different for you, but I strongly suspect this’ll work well.
Here is my personal approach to this.
-
I have set my bash history to a ridiculous 1000000 max length, so that I can use CTRL+R to search for commands that I have ran before
-
I write down a lot of commands in a searchable note text document
-
Ask chatGPT
-
Use the
tldr
command -
Added A LOT of verbose custom aliases and scripts. For example instead of
inotifywait -m -r --exclude "(/tmp.*|/var/cache.*|/dev/pts/|/var/log.*)" -e MOVED_TO -e CREATE -e CLOSE_WRITE -e DELETE -e MODIFY .
(nobody can remember that alphabet gibberish)I just type
watch_for_changes .
Since it is verbose, straight from my brain, I always remember it and it works with autocomplete. I have like ~30 such commands so far.
Rather than a text file, using a command snippet manager like pet might be more convenient.
Great concept, but I don’t live in the terminal and prefer GUI text editor features (like jumping the cursor with a mouseclick).
The workflow on the git page looks extremely clunky compared to a good old textfile.
That’s an interesting little program. Not sure if it’s for me - I’ll either remember/lookup commands or create bash scripts for more complicated things - but it’s good to know about.
-
How often do you need commands you cant remember? The ones i use are typically memorized via regular use, or i just look it up for the one off ones. You can use some distros without ever touching the terminal too if thats what you prefer.
Fish
What does Fish that Bash does not, specifically to help the person remembering the program names and options??
It automatically suggests commands, you’ve run before, if you start typing the first letters, like so:
You can also press the Up-Arrow at any point to show other commands from your history which contain the text that you just typed.
So, it is similar to Ctrl+R in Bash, but easier to use and you don’t have to actively think about it.
And, if you can’t remember the options for commands, fish will offer you suggestions. So, if you type
ls -
and press tab, fish will give you a list of all of the valid switches and a brief description.
repetition…repetition…repetition…repetition…repetition…repetition…repetition…repetition…lol
I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.
~ Bruce Lee
I keep bash scripts on my desktop to do common things
My solutions are:
- Just arrow up until you find the command from last.
- Learn to use CTRL-r and search for old commands.
- Bash completion helps with arguments
- Save stuff in shell scripts
Keep a “cheat sheet” of common commands printed out nearby-- either something from the internet and/or a custom one for your own commands.
Also, nobody can remember all the commands. We mostly just remember the ones we use most often. Otherwise, we have to look things up! It’s not to bad since you know that the command exists and you just need to know the exact way to type it.
Find mnemonics to help remember certain things. For example if you want to decompress a .tar file, you remember “xtract zee file” or: tar -xzf
tealdeer and writing them down in a document
I recommend to installed starship, fish and ZSH. I just tried them recently with config files from a friend and am pleasantly surprised:
you don’t need to remember anything, except commands you use the most often but even then it becomes muscle memory after a while. If you ever need some specific command to use, just look it up online.
Online
Ok but what if my Wi-Fi isn’t working
use your phone to look up the commands on how to get internet working again
alternatively, connect computer to your router via cable
Then use the commands help or read the local man document. In example for grep it would be
grep --help
andman grep
. You don’t need an online connection for this.Containers become problematic, some don’t have man pages or other common commands installed. Debugging applications on them requires a wide knowledge of all sorts of primitive commands and workarounds to achieve common tasks. My biggest fear is a container without grep.
How do I remember what the command even is? Like how would I discover the grep tool without using the Internet?
Discovering tools is not what the question and solution presented here was. But for that question, I recommend downloading a book about Linux as a reference or something like that. Or a basic tutorial series to read and remember basics about Linux.
You can also just list the
ls /usr/bin
directory to see what programs are there.There is actually a command to search the man pages for terms, to list the commands:
apropos
$ apropos -s 1 search apropos (1) - search the manual page names and descriptions find (1) - search for files in a directory hierarchy flatpak-search (1) - Search for applications and runtimes gamemodelist (1) - search for processes running with gamemode rg (1) - recursively search the current directory for lines matching a pattern zipgrep (1) - search files in a ZIP archive for lines matching a pattern
Note: I cut some parts out in the output to make it shorter. The option
-s 1
means, it will list man pages from section 1 only.
history | grep command you’re searching for
That will return all commands you’ve typed that contain that keyword. Helps if you remember part of a command, but can’t remember the specific flags or the proper format.
If there are common commands that you use over and over, turn them into a Bash script and name the script something descriptive.
I do that for long commands that I don’t want to type out, like my whole system update workflow: sudo apt update -y && sudo apt upgrade -y && sudo flatpak update -y
I saved that as a Bash script and called it “update.sh” then I saved it in my home directory. Now whenever I want to do a full system update, I just type ./update.sh and it asks me for my password, then updates my whole system without me having to do anything else. I do this with several different tasks like my remote Ansible server updates.
Other than that, you can buy/make a linux command cheat sheet with the most common commands. Keep it with you or next to your computer. Look at it whenever you need a refresh.
Ctrl-r!