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.
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.
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
deleted by creator
deleted by creator
I recommend to installed starship, fish and ZSH. I just tried them recently with config files from a friend and am pleasantly surprised:
You could make aliases that are easier to remember for you.
If you e.g. had trouble remembering that
mv
does a rename, you couldalias rename=mv
. Ideally just put whatever you would have googled in “linux command to x” as the alias.That’s the power of Linux; you can tweak everything to your preferences and needs.
Wild had no idea—this is so cool. If you do this, does the original command also still function (so like I could rename to something easier for me, but hopefully transition to the real deal at some point/ properly follow help forums or suggested pasted commands)
The originals remain untouched.
It is possible to override existing commands with aliases though. This is useful for setting flags by default. I have
alias ls='ls --color'
for instance such that whenever I runls
, it actually runsls --color
, providing colourful output.Note that aliases are only a concept within your command line shell though. Any other program running
ls
internally won’t have the flag added and wouldn’t be able to use any of the other aliases either (not that it would know about them).It’s very easy to program your own “proper” commands though on Linux. If you had some procedure where you execute multiple commands in some order with some arguments that may depend on the outputs of previous commands, you could write all that as a shell script, give it some custom name, put it in your
$PATH
and run it like any other command.Also very cool—the building in default modifiers to the command. Thanks for the great tips.
Use GUIs for all the things.
Linux users are obsessed with the command line because it’s faster if you can type fast and remember everything. If you can’t, GUIs are actually much much faster because you are visually guided towards what you’re looking for and have to spend little time looking for the correct commands and syntax and everything.
because it’s faster if you can type fast and remember everything.
No. That’s just wrong. You only need to type ONCE and you don’t have to remember it all, that’s why
reverse-i-search
(aka Ctrl-r) is so powerful. It allows you to search within your command history so you only need to remember few letters of the command (which you can annotate, e.g.commandname parameter #it does this
) and can even edit after, e.g. changing parameters.But, more fundamentally, that is NOT the point of the command line!
The whole point of the command line is… to be able to repeat things, namely to script actions that can be customizes and combined to YOUR unique needs. So it’s absolutely not about typing speed or memory. In fact, once I do have a good command, what do I do? I save it as a script precisely so that I do NOT have to type it again. Think of commands as Lego bricks that can be combined to together, build on top of. That is basically impractical with GUIs. Sure there are some tools to automate the click on GUIs but it’s unreliable, nor can it be easily shared.
PS: I’m not saying anyone should use the command line over GUIs. I’m not being prescriptive. I’m only trying to clarify what the point of the CLI is.
TL;DR: command line is about combining tools to your unique needs, repetitively and reliably.
True of course. If you look at my comment though, I haven’t said that speed is the point of the command line. Just that Linux users are obsessed with it. For most users most of the time, the repetition/automation is not the point and ability to write scripts is not the most important thing. And you can combine tools with GUIs as well, it’s just slower. Same with reliability, GUIs don’t have to be and usually aren’t unreliable, so command line only has the automation and speed going for it.
you only need to remember few letters of the command
I believe that is exactly the problem in this thread. The command history only works if you remember in the first place.
For most users most of the time, the repetition/automation is not the point and ability to write scripts is not the most important thing.
Well if that’s the case then it’d be like somebody buying a bike, removing the wheels, and complaining that truly it’s not as fast as a car or as convenient as walking. Sure, it’s true but… if one is missing the point of a tool then they can’t really complain about how “bad” it is.
Honestly I do not know how the CLI is most popularly used. I do have usage data for that (and I’m not sure who might, maybe Ubuntu?) but again, if people are using it to “type fast” then they are wrong.
Regarding memorizing and the problem of this thread, yes it IS a problem but that’s precisely why I also commented https://lemmy.ml/post/24395107/15908795 before, namely that someone learning the CLI (namely … ALL of us, even people like me who have been using it for decade, at home and professionally) should actually admit they are learning and thus rely on tools as they otherwise normally would.
It happens to you, to me and to every UNIX user since the 70s. Your system is (or should be) full of docs and tools to get help. One thing that I noted over the years, when we have new people at work, is that they don’t known how to get help from programs or they don’t known how to get help from their systems and when they struggle with anything, doesn’t matter how basic, they go to the web for help. I always show them this:
apropos
man
help
What was that command to compress files?
apropos compress
Oh! it was gzipWhat was that command to do whatever with the GRUB?
apropos grub
Oh yeah! update-grubWhat about that command to download files?
apropos download
Oh! it’s wgetThe next tip should be learn how to use and navigate in the
man
pages, man have it’s own man page;man man
There are different sections, section 1 is the default, you don’t need to specify, so you can just;
man bash
But if you want to get help from configuration files you should type;
man 5 sysctl.conf
Also, almost every program have a built in help compiled with the program code, you usually call it with --help or -h, sometimes just help and other times just call the program without parameters and it should print it.
Other people already suggest the cheat sheets, very useful especially for programas like vim or emacs, some of them come like a template to create a cube, so you print it and then craft it (like an origami) and you can have it in your physical desktop.
Last thing; be patience, your are in the rigth path, there’s always more than one way to do things, you just need to find your own way.
I made a comment about how easy it was to learn VMS was (an 80s/90s OS). How do I print a file? I’ll try PRINT. Okay, that works. How do I make 6 copies? PRINT /COPIES=6. Great! But how do I print to a file? I’ll try PRINT /OUTPUT=filename. Well whaddya know!
I loved that OS like a brother. Sadly it eventually went the way of every proprietary system.
deleted by creator
Not a boring story at all, in fact it’s Awesome! It’s been so long since I touched VMS I would probably be lost now, but I wrote tons of apps and was a sysadmin for a couple years - which I really enjoyed, as 90% of that job was running backups and installing updates, leaving plenty of time to just play around. I missed writing apps, so I made a visual status monitor that let me look at running processes and pause, restart or kill them. My last exposure to VMS was when I worked at Fred Hutchinson Cancer Research Center in 2007 or 8 - a group there still had a VaxCluster running, but I never worked on it. Today there is still OpenVMS, mostly run on emulators by retro computing hobbyists I think.
Thank you!
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!
You can make a cheatsheet and keep it on your desk
I just use guis
I keep bash scripts on my desktop to do common things
Anything you have trouble remembering, or just find yourself doing often, create an alias (or bash script if it constitutes a multi line command). Name the alias something you can easily remember that also lets you know what that command does.
Then, and here’s he trick, don’t rely on the alias. Use it when you can’t remember, say “aww, damn it I had to use the alias again”, and then use
which
followed by the alias name to see what the command was again. Do this over and over and eventually some commands will stick.Ones that you don’t care about or are just super long, just keep using the alias and don’t worry about remembering them. Use aliases as both commands and notes.
Apart from fzf that helps me find recently used commands and also files and directories easily, I also use tldr that gives you a simple cheat sheet for every command and very often saves you trawling through endless man pages.
I partly remember the first letter and press arrow up.
I use ZSH shell with oh-my-zsh. It autofills the rest with history at the point you write. So arrow keys make you scroll through the history which is beginning with the thing you wrote
Man is great to check quickly what something does. I use atuin as my shell history to make it a lot easier to search
You know atuin is legit because the demo gif on their site is using GruvBox, the most bestest color scheme.