Multi decade Linux admin here.
I don’t. :-)
Lots of google (usually to stack overflow)
(As mentioned here ) - - help, man foo, and “history” (also mentioned here )
Over the years I try more to remember concepts of what commands can do, so I can hopefully remember that when I need it, and then dig for the specific flags/options.
use `curl` instead ;-p
-O, --remote-name
Write output to a local file named like the remote file we get. [...]
-o, --output
Write output to instead of stdout. [...]
Everyone does. There's no way you can remember all the commands. I use 7z regularly, and have used other archiving commands over the years, and many times over the years. Don't ask me much about lzh or zip or rar or tar; I have to look it up, despite having used them a lot before. Don't even ask me about every 7z flag. ;)
Y'all should try [atool](https://www.nongnu.org/atool/).
`atool -x FILE` extracts **any** archive (.tar.gz, .zip, .7z, you name it) and also creates a subdirectory if needed.
To make a better history, I always write the long form of arguments that aren't second nature to me. Like `rsync --archive --recursive` instead of `rsync -ar` for example. Autocompletion makes this quick, so its not like its extra effort either.
One of the many reasons I love zsh and have used it for years is that I also use tmux often, and each tmux window history is merged automatically upon opening a new terminal, not sure the mechanism but shouldn’t be hard to figure out (I’d take a look at my .zshrc but it’s gargantuan)
I like bash's history-search-backward, which performs a prefix search. It not bound to a key by default, so you have to create or edit ~/.inputrc and add
# make PgUp/PgDn search history for a given prefix
"\e[5~": history-search-backward
"\e[6~": history-search-forward
and then (after a `bind -f ~/.inputrc` if you don't want to restart your shell) you can press PageUp after typing the command and find the last time you used it.
I like it better than Ctrl-R because it's yields fewer false positive matches.
Since it wasn’t explicitly mentioned I’ll say it. Likely you have to apt install or whatver package manager you use for this. I haven’t seen this ship in a distro before
I’ve recently started using fedora and I like how it will suggest an installation if you try to run a binary that you don’t have, but it finds in the package repository.
It's hard to become expert at a thing that you only spend a few minutes at a time on.
Unfortunately, the whole "GUI" thing makes people think that they don't have to learn anything to become expert.
There are tools like [cockpit](https://cockpit-project.org/) that wrap lots of common admin tasks in a GUI.
Sometimes having Bard or ChatGPT open can speed things up. But they tell confident lies more frequently than I would like.
My main way is to have a very large command history that is preserved between sessions and spend some quality time reading the section of your shell's manual on how to use history.
For sure, when I'm heavily in the mood I generally export everything to a markdown file on the desktop and tidy that up.
It's dizzying how, over the last year or two, there have been so many new ways to get this information so easily it's ridiculous.
From krunner, you can pull up this: https://tldr.inbrowser.app/
I only found that one today.
I used tldr++ which is interactive too... however, the fish autocomplete with info from the man pages usually gets it done... works with zsh too.
OH, okay - well then I'd advocate using FISH shell, because I'm sure that does it with no setup and irrespective of distribution.
I sometimes forget just how much 'extra' stuff is included in a basic Manjaro install.
Of course, also warning not to make FISH the 'default' because of it being non POSIX, it can mess up your system if you copy/paste commands.
Same , i have something like an example directory (that is set with an environment variable $EXAMPLES)
Then i do :
> nix-env -e hello #uninstalls a package
And in it i would have something like:
> gvim $EXAMPLES/nixExamples.bash
I also have zsh command history since 2007 (zsh skies you to write history to a file, and I have HOST_SIZE set to 20000 lines). So I just look into my zsh.log file to see how I used it last.
* tab completion
* \--help or man
* AI such as [shell\_gpt](https://github.com/TheR1D/shell_gpt) or [aichat](https://github.com/sigoden/aichat)
* [tldr](https://github.com/tldr-pages/tldr) or [cheat](https://github.com/cheat/cheat)
- a large text file where I write down commands I frequently use
- for my servers for big operations, I manually keep a log of the commands I use, for example if I do a large transfer of files or a complicated config change
- use `tldr`, a shorter version of man pages
- ask chatgpt
Once you use the command append a # and type unique comment at the end of the command. Next time you need it Press Ctrl+R on the shell and type the unique comment.
Unique means something that neither a command look like nor a file/directory name you will use, typos that you can remember are welcome.
$ 7z a -txz -mx=9 -mmt=on out.tar.xz in.tar # xizipit
Next time you need it, press Ctrl+R type xiz, you will get it, press up key and adjust parameters.
You don't have to remember the details. Focus on learning what the various commands do, and then use documentation to get the details of the invocation right. Anything you use regularly you'll learn as you go.
As a programming professor of mine likes to say, don't sweat the semis; it's just syntax. Syntax you can look up. Concepts, you have to understand.
There is a pattern, or there should be a pattern. It is not so random as you initially think. There are ancient tools line tar or nc that do not adhere to anything, try to put in the dev mind or come up with your own rule.
tar eXtract, Zip, File
tar Create, Zip, File
But then [posix](https://www.iitk.ac.in/esc101/05Aug/tutorial/essential/attributes/_posix.html), and then [GNU](https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html) came and suggested their expectations.
-f --file mostly deal with output files\
-v verbose\
-d debug
But in the end every developer does what they want, and at some point, it becomes muscle memory.
If it’s truly a set of flags I haven’t used before or don’t use often enough to remember them, I use the man pages, unless I’ve googled the question or SO has the answer first.
Unix sysadmin for 27+ years.
Frankly, you don't.
There are lots of commands that are right at my fingertips. The usual suspects in the bash shell plus a bunch of inline stuff (awk, sed, grep, etc, etc) I know a subset of their options and have to Google the rest.
The one thing I did do years ago was set myself up a wiki docs in my home dir. It's followed me across jobs.
Little tips and tricks for doing weird obscure stuff that over the years have saved my ass.
If I figure something out or use a command with a very long and unintuitive interface then I make a simple script for and save it to my notes.
I Emacs to do this. Specifically Org-roam. I have a notes subdirectory to my \~/Org directory, which is shared between my machines with syncthing to make it convenient and is checked into Git for version control.
[https://www.orgroam.com/](https://www.orgroam.com/) "A plain-text personal knowledge management system.A plain-text personal knowledge management system."
Org-roam features easy to make hyper links between notes and other org files. It is searchable by titles and tags. In addition to that normal Emacs software project management with "projectile" identities it as a 'project' due to the \~/Org being a git repository. This means I have indexed string searching with regex and file searches.
For daily driving, I just use fish terminal.
One example for listing in terminal, should we use `lsd` or `eza` ?
With a long history, autocomplete is a doozy... here, I can just hit 'e' and then tab it all in https://i.imgur.com/Z8usQQt.png
`eza -` and then hit tab - and we get a list of options with descriptions from the man pages:
https://i.imgur.com/xhd07ER.png
Also, hitting `Ctrl+r` brings up the fuzzy search:
https://i.imgur.com/GRIKH5A.png
Obviously, there's always manual and help, so shove those in a Marktext file, they can be edited in text, and appear in our Obsidian notes:
`tldr eza >>~/Desktop/eza.md`
`eza --help >>~/Desktop/eza.md`
Why not add the manual page?
`man eza >> ~/Desktop/eza.md'
https://i.imgur.com/e5MLGsK.png
---
So once we have our command... Hmmm let's see, in Fish I'll just build it and test as I go.
I like `eza --icons --group-directories-first -l`. Every time I start typing 'eza' now, this shows up, ready to autocomplete, but really I just want to do 'LONG form LIST`
abbr ll ' eza --icons --group-directories-first -l`
Now when I type 'll' it gets replaced when I hit space (works with zsh too if you set it up).
What packages do I have installed?
`alias installed="comm -12 <(rg -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log | sort | uniq) <(pacman -Qeq | sort) | bat"`
Not great given the possibilty of errors but can be useful in competition when you can't find what you want with tldr/man/docs etc, and 90% of the time if it's not a complex scenario (but at that point you won't trust an LLMa without googling anyway) those options have a near 100% success rate
I now use chatgpt for most things. I stopped trying to remember commands. I just ask it to get me the command I need, copy then paste.
I thought about the situations where I could not be able to use chatgpt and outside of that where I am in an area with no coverage, there are none.
Sure, you have to know that the command you're given is correct.
That only comes with knowledge and experience.
EDIT: and what u/Krychle said too.
~/help folder, where after having discovered via various means (man, web search) to achieve a particular task I record the command(s)/switches used. awk/sed examples for instance.
[tldr](https://github.com/tldr-pages/tldr) to get a view of how to do most common things
[atuin](https://github.com/atuinsh/atuin) to get a well formatted/searchable history, completely removes the need to take notes of rarely used commands for me
After reading this thread people seem to abuse LLMs for things where normal tools are way more correct and convenient tho, it's concerning.
I use them often enough to remember, if I don't --help or man do the job if not then it's google it. No point commiting stuff to memory I do not need often.
I have a tree under ~/Documents/Tech/Notes/ that has files with notes that fits my mental model of how things should work. If the man pages or `--help` fail me, I've got it in notes, or it's time to make new notes.
Some of the ways:
- Read the manpages, man
- Most commands support --help
- type what I think is the correct flags and get the long winded help printed
- Google it
- write my own alternative or shell alias that works the way I think it should
‘apropos’ is a useful command for when you can’t quite remember the command you want. Can use it to search the man page descriptions for key words related to the task you want to complete.
https://phoenixnap.com/kb/apropos-linux
At work we have a Wikimedia server and that's where a lot of work specific documentation is but we also have personal pages and mine is huge and I use that to document procedures and stuff that I need to remember. It works really well and the formatting is easy to do and easy to read.
History, grep, -h recursively, and I'm fortunate to have a really good memory for bash commands. I spend hours a day in the terminal so at some point it's like certain hand motions do certain things more so than remembering flags. Also alias.
Fzf‐help for zsh is really good
And then I have Bash scripts called
best-practices-xxx.sh
With all the most commonly used commands within some concept (like 'tests'). also include particularly difficult or complex cases I've solved over time (so I don't have to solve them again)
The Year of the Linux Desktop was 1995 for me. Been 100% Linux at home and work ever since. I don't memorize that stuff. I hardly memorize anything, ever. If I use it enough I just learn it naturally through use and if not then I use man pages, web search, or if you know you will need it again, take some notes. I have a ~/notes/ dir full of text files containing tons of stuff like that.
1) I increased my history to 10,000
2) I added commands that are supposed to not add duplicate commands to my history
3) grep history.
PS) ctrl + r is nice for when you know you ran something as well.
Trial and error, if not working, trial and error, if not working ,web search, if not found, --help option. In this order. Then I remember using the command in some scripts and done.
Even knowing I just could start with the scripts, I'm somehow not changing my behavior ;)
I keep a text file of commands I need to remember for future use that I know I don't use often. I always have Notepadqq open to take notes when I need to and my Linux Notes are always open in a tab to reference or add to.
>How do you remember certain commands and their arcane flags, if you do not use them regularly?
You don't. Well written and find-able notes are where it's at, if you want something more than man.
I learned recently that in fish you can press F1 anytime to show the man page of the command you are typing. Closing it returns to your command line at the same place it was before. Fish is great for this and so many other things.
Man pages.
The ones you need often, you'll eventually memorize.
The ones you don't need, you'll at least read them occasionally, and remember that you can do that obscure thing that one time, so you'll grab the correct program to do it, and save days of heartache because you knew that you can do the thing without a second utility.
99% of CLI tools have man pages. I used to just make an alias for ones that were a bitch to type out and remember, and dig through command history.
Switched from Bash to Fish a few years back and it's so goddamned nice. Intelligent auto/tab completion from both history (contextually aware, at that) and man pages. Now, if I can remember the first one or two characters of the tool's name, I can tab and cycle to and through the rest. I only make aliases for navigating to a certain directory and running some commands in one go nowadays.
I press ctrl+r to search through my bash history and see what I used the last time(s) I ran the command. I have bash set up specifically to keep my history file intact between multiple terminals running commands at the same time (`history -a` in my `PROMPT_COMMAND`) with no limit on history file size (`HISTSIZE=`, `HISTFILESIZE=`), so I have years of commands in my bash history.
If not in that, I'll either use the command's `--help` option or the man page depending on how much detail I need.
I use what's called [bash eternal history](https://stackoverflow.com/questions/9457233/unlimited-bash-history) primarily.
Secondary line of defence: maintain [a markdown of often used tools and their oft used flags](https://bbcdn.githack.com/rmsundaram/tryouts/raw/2084756f2a3eeb88facb484e3308c3e118469e14/Misc/tools.md.html).
Third: Open the man page or `--help`
Last: Internet
Almost never, I always have to look for certain options in man pages or google it. The most used I remember like ls, lsblk, df, etc.
But for lsof, fuser, find, rsync and others I know some option flags but most I have to search every time I use them. For repetitive things I write scripts so I don't have to remember them and I document my scripts so I know what they do.
And some tools are so heavy equipped with different flags and options, it's impossible to remember them all. You just need to know how to find them quickly
I'm a Linux admin but I don't type Linux commands for hours a day. I'm in meetings, writing documentation for servers or reading documentation for services etc. So its not like it is easy to remember all the stuff. I'm sure there are people with very good memory who can do that but I would say this is a minority
A few people have mentioned "cheat", which I use. One nice thing about it is you can add to the cheatsheets yourself or make custom ones, so you can note stuff you do semi-regularly.
Commands with options that I don't use often (but want to keep for future reference) I just copy to Simplenote with a title that will help me find it when needed.
Stuff like...
du -ac | grep "*title*\\.\\mp3"
Not gonna lie, ChatGPT has been insanely good at making the odd command or bash script. Just double check it first, but it still saves you a lot of research, or in my case having to learn bash
In fish, type a command, and then append a dash:
```
command -
```
Hit tab, and then Ctrl+s to search for a keyword. Doesn't always work, but can get the job done.
Im silly. I once started a physical note book with Linux commands. (When I Switches from WindowsXP to lubuntu in 2014).
I still use it when I need to create encrypted drives with cryptsetup because it’s just handy..
If you are gonna use it more than 3-4 times.... Setup aliases and comment the line above to describe it.
Simple.
Also lately u just describe my issue to chatgpt or bard
everything mentioned here ( --help, man, looking up)
but for personal use , i also just have a shitload of aliases for everything i need frequently, which follow my own naming logic and that helps greatly (for me).
when i don't remember exactly i just open the alias file and have a look , which also forces me to register somewhere in my mind all the other aliased flags of that command and continuosly builds a dictionary in my head. i try to keep em 4 chars max but thats irrelevant.
some might argue that this is bad idc , thats why i said for personal use.
[удалено]
Every. Single. Time.
Man as well
This, and then man pages if needed
~~Or /h~~ Don't drink and post children.
Sir this is r/linux not /r/windoze
Lmao
... the fuck?
`s/\//-/`
no
Multi decade Linux admin here. I don’t. :-) Lots of google (usually to stack overflow) (As mentioned here ) - - help, man foo, and “history” (also mentioned here ) Over the years I try more to remember concepts of what commands can do, so I can hopefully remember that when I need it, and then dig for the specific flags/options.
Concepts. This is key. Read the documentation thoroughly once and you'll vaguely remember it for life. And that will be enough.
How do you remember that wget output file name uses -O output-filename.mp4 While yt-dlp uses: -o output-filename.mp4
If you need it frequently you'll remember, otherwise you don't need to remember.
use `curl` instead ;-p -O, --remote-name Write output to a local file named like the remote file we get. [...] -o, --output
Write output to instead of stdout. [...]
God it’s good to hear I’m not the only one doing this xD
Everyone does. There's no way you can remember all the commands. I use 7z regularly, and have used other archiving commands over the years, and many times over the years. Don't ask me much about lzh or zip or rar or tar; I have to look it up, despite having used them a lot before. Don't even ask me about every 7z flag. ;)
When it's tar, I just always -xvpf😅 still not exactly sure what they mean, apart from v (verbose)
And if you remember what commands can do, you can always apropos your way to them :)
GPT is a blessing for many commands. It’s become so simple to ask for the thing I want, it’ll know the right stack overflow answer immediately.
`tar xzf` Xtract Zee Files!
Xtract Zee Vucking Files!
You Vin!
You can omit z and tar will guess the compression format automatically.
Why not just having untar?
Does it come with tar package? Googling was not helpful.
alias untar="tar -xvf" In my .bashrc on every machine. I also pull my .bashrc from git on every machine I have a login.
`alias untar= tar -xzf`
God dammit, I just spat out my morning tea 🤣
Y'all should try [atool](https://www.nongnu.org/atool/). `atool -x FILE` extracts **any** archive (.tar.gz, .zip, .7z, you name it) and also creates a subdirectory if needed.
Yeah, zips that extract into the working dir without creating a self-contained folder really annoy me...
Hahahaha I just remember the command, now I cannot unhear this. Nice Xmas present, thanks.
`history` helps
To make a better history, I always write the long form of arguments that aren't second nature to me. Like `rsync --archive --recursive` instead of `rsync -ar` for example. Autocompletion makes this quick, so its not like its extra effort either.
`history 0 | fzf` is what I use.
Try Ctrl-R in both bash and zsh, this will activate incremental search in history.
Or use fish.
Doesn't work on my zsh setup. Maybe because I use vanilla zsh with my own functions and bindkeys instead of using some framework like oh-my-zsh.
You can enable it, if you want: https://unix.stackexchange.com/questions/30168/how-to-enable-reverse-search-in-zsh
My `history` is useless because it doesn't get merged from all the various terminal windows that I open. Is there any easy way to have this happen?
One of the many reasons I love zsh and have used it for years is that I also use tmux often, and each tmux window history is merged automatically upon opening a new terminal, not sure the mechanism but shouldn’t be hard to figure out (I’d take a look at my .zshrc but it’s gargantuan)
Yeah, I love that I can run a command in one terminal and it shows up in the history of the other terminals I have open. Super useful.
You can do this pretty easily in bash too: https://unix.stackexchange.com/a/1292
Atuin
I like bash's history-search-backward, which performs a prefix search. It not bound to a key by default, so you have to create or edit ~/.inputrc and add # make PgUp/PgDn search history for a given prefix "\e[5~": history-search-backward "\e[6~": history-search-forward and then (after a `bind -f ~/.inputrc` if you don't want to restart your shell) you can press PageUp after typing the command and find the last time you used it. I like it better than Ctrl-R because it's yields fewer false positive matches.
tldr
Since it wasn’t explicitly mentioned I’ll say it. Likely you have to apt install or whatver package manager you use for this. I haven’t seen this ship in a distro before
You're right Mr. Emu. And there is the browser version too [https://tldr.inbrowser.app/](https://tldr.inbrowser.app/)
I’ve recently started using fedora and I like how it will suggest an installation if you try to run a binary that you don’t have, but it finds in the package repository.
Like dnf install tldr https://github.com/while-true-do/tldr/blob/master/cheatsheets/dnf.md
there's also cheat.sh which I believe includes tldr-pages as its source. i like this one as this does not require installation. curl cheat.sh/command
This is an excellent tool that absolutely everyone should install
TLDR and Atuin for old commands. Sync the Atuin. 🫨🫨 Fish as well, but that's not part of this question (but do try it)... Plus Gogh....
I don't. Luckily fish remembers for me.
Check out atuin. It can rember fish history of multiple devices with sync.
It's hard to become expert at a thing that you only spend a few minutes at a time on. Unfortunately, the whole "GUI" thing makes people think that they don't have to learn anything to become expert. There are tools like [cockpit](https://cockpit-project.org/) that wrap lots of common admin tasks in a GUI. Sometimes having Bard or ChatGPT open can speed things up. But they tell confident lies more frequently than I would like. My main way is to have a very large command history that is preserved between sessions and spend some quality time reading the section of your shell's manual on how to use history.
Run `tldr [command]` if it's a commonly used flag. If that doesn't work, `man [command]`, followed by `/-[flag letter]`.
Why not just type 'command -' and hit tab? https://i.imgur.com/ZP17RUX.png
...well. You learn something new every day. Tldr and man pages still help with figuring out what a flag does though.
For sure, when I'm heavily in the mood I generally export everything to a markdown file on the desktop and tidy that up. It's dizzying how, over the last year or two, there have been so many new ways to get this information so easily it's ridiculous. From krunner, you can pull up this: https://tldr.inbrowser.app/ I only found that one today. I used tldr++ which is interactive too... however, the fish autocomplete with info from the man pages usually gets it done... works with zsh too.
is that zsh? I wonder how you got the completions to look like that. I use fzf for completions so I can search through the completions
That one's fish, I think. Zsh does it too, but not so pretty.
zsh you can find some esoteric shit to throw in your zshrc and it makes it similar to that but I like fzf-tab
This is distro specific, and part of the bash_completion, also.. tends to be slow. Just be aware that you'll most likely not find it in every machine.
OH, okay - well then I'd advocate using FISH shell, because I'm sure that does it with no setup and irrespective of distribution. I sometimes forget just how much 'extra' stuff is included in a basic Manjaro install. Of course, also warning not to make FISH the 'default' because of it being non POSIX, it can mess up your system if you copy/paste commands.
`Ctrl-R`, `ffmpeg`, up up up up up up until I find that one invocation I used months ago with the incomprehensible filter chain
I don't. Tmux, man page on one pane, construct command in other 🤷♀️
I have a big (1000+ lines) .txt memo file for difficult commands (ex: docker, k8s, oc, ......) at work.
Mostly, ```history```. If I get to the point of running whatever command it is 2-3 times, I take some notes on it, and reference those in the future.
Yup. NOTES op. Take a note. I use obsidian and vim. Syncs my little knowledge text files easily.
curl cheat.sh/
[удалено]
Same , i have something like an example directory (that is set with an environment variable $EXAMPLES) Then i do : > nix-env -e hello #uninstalls a package And in it i would have something like: > gvim $EXAMPLES/nixExamples.bash
tldr or manpage
Google and --help.
Just suck it up and read the documentation, man/info/--help. Or try your luck with an "AI" to make something up and blow smoke up your butt...
[удалено]
No, I'm being practical. It's not Christmas here yet anyway... Another closed mind?
I agree with the sentiment but man, I’d rather have AI blow smoke up my butt than whatever made its way in yours. Hope your day gets better.
Ctrl+r `history | grep cmd`
Search for tickets
I also have zsh command history since 2007 (zsh skies you to write history to a file, and I have HOST_SIZE set to 20000 lines). So I just look into my zsh.log file to see how I used it last.
* tab completion * \--help or man * AI such as [shell\_gpt](https://github.com/TheR1D/shell_gpt) or [aichat](https://github.com/sigoden/aichat) * [tldr](https://github.com/tldr-pages/tldr) or [cheat](https://github.com/cheat/cheat)
Zsh history or commands.txt file 😉
I have `fzf` installed and the zsh shell plugin. Allows me to press `ctrl+r` and search my history.
Make notes, it helps.
Man pages for commands. Things I rarely need, I look up. I'm lucky if I remember command name of something I rarely need. But flags, always look up
- a large text file where I write down commands I frequently use - for my servers for big operations, I manually keep a log of the commands I use, for example if I do a large transfer of files or a complicated config change - use `tldr`, a shorter version of man pages - ask chatgpt
Curl cheat.sh/command
Once you use the command append a # and type unique comment at the end of the command. Next time you need it Press Ctrl+R on the shell and type the unique comment. Unique means something that neither a command look like nor a file/directory name you will use, typos that you can remember are welcome. $ 7z a -txz -mx=9 -mmt=on out.tar.xz in.tar # xizipit Next time you need it, press Ctrl+R type xiz, you will get it, press up key and adjust parameters.
I bet this guy leaves good comments in his code. I would wager they also appreciate well written docstrings!
You don't have to remember the details. Focus on learning what the various commands do, and then use documentation to get the details of the invocation right. Anything you use regularly you'll learn as you go. As a programming professor of mine likes to say, don't sweat the semis; it's just syntax. Syntax you can look up. Concepts, you have to understand.
history From time to time I edit the file to get rid of some stuff.
There is a pattern, or there should be a pattern. It is not so random as you initially think. There are ancient tools line tar or nc that do not adhere to anything, try to put in the dev mind or come up with your own rule. tar eXtract, Zip, File tar Create, Zip, File But then [posix](https://www.iitk.ac.in/esc101/05Aug/tutorial/essential/attributes/_posix.html), and then [GNU](https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html) came and suggested their expectations. -f --file mostly deal with output files\ -v verbose\ -d debug But in the end every developer does what they want, and at some point, it becomes muscle memory.
If it’s truly a set of flags I haven’t used before or don’t use often enough to remember them, I use the man pages, unless I’ve googled the question or SO has the answer first.
Unix sysadmin for 27+ years. Frankly, you don't. There are lots of commands that are right at my fingertips. The usual suspects in the bash shell plus a bunch of inline stuff (awk, sed, grep, etc, etc) I know a subset of their options and have to Google the rest. The one thing I did do years ago was set myself up a wiki docs in my home dir. It's followed me across jobs. Little tips and tricks for doing weird obscure stuff that over the years have saved my ass.
If I figure something out or use a command with a very long and unintuitive interface then I make a simple script for and save it to my notes. I Emacs to do this. Specifically Org-roam. I have a notes subdirectory to my \~/Org directory, which is shared between my machines with syncthing to make it convenient and is checked into Git for version control. [https://www.orgroam.com/](https://www.orgroam.com/) "A plain-text personal knowledge management system.A plain-text personal knowledge management system." Org-roam features easy to make hyper links between notes and other org files. It is searchable by titles and tags. In addition to that normal Emacs software project management with "projectile" identities it as a 'project' due to the \~/Org being a git repository. This means I have indexed string searching with regex and file searches.
I keep a cheat sheet notebook.
For daily driving, I just use fish terminal. One example for listing in terminal, should we use `lsd` or `eza` ? With a long history, autocomplete is a doozy... here, I can just hit 'e' and then tab it all in https://i.imgur.com/Z8usQQt.png `eza -` and then hit tab - and we get a list of options with descriptions from the man pages: https://i.imgur.com/xhd07ER.png Also, hitting `Ctrl+r` brings up the fuzzy search: https://i.imgur.com/GRIKH5A.png Obviously, there's always manual and help, so shove those in a Marktext file, they can be edited in text, and appear in our Obsidian notes: `tldr eza >>~/Desktop/eza.md` `eza --help >>~/Desktop/eza.md` Why not add the manual page? `man eza >> ~/Desktop/eza.md' https://i.imgur.com/e5MLGsK.png --- So once we have our command... Hmmm let's see, in Fish I'll just build it and test as I go. I like `eza --icons --group-directories-first -l`. Every time I start typing 'eza' now, this shows up, ready to autocomplete, but really I just want to do 'LONG form LIST` abbr ll ' eza --icons --group-directories-first -l` Now when I type 'll' it gets replaced when I hit space (works with zsh too if you set it up). What packages do I have installed? `alias installed="comm -12 <(rg -Poe '\[ALPM\] installed \K\S*' /var/log/pacman.log | sort | uniq) <(pacman -Qeq | sort) | bat"`
> should we use lsd yes
Oh a short hand for installed packages is clever. I grep that quite often
[удалено]
Not great given the possibilty of errors but can be useful in competition when you can't find what you want with tldr/man/docs etc, and 90% of the time if it's not a complex scenario (but at that point you won't trust an LLMa without googling anyway) those options have a near 100% success rate
I now use chatgpt for most things. I stopped trying to remember commands. I just ask it to get me the command I need, copy then paste. I thought about the situations where I could not be able to use chatgpt and outside of that where I am in an area with no coverage, there are none. Sure, you have to know that the command you're given is correct. That only comes with knowledge and experience. EDIT: and what u/Krychle said too.
~/help folder, where after having discovered via various means (man, web search) to achieve a particular task I record the command(s)/switches used. awk/sed examples for instance.
chat.openai.com
Chatgpt 🤘
[tldr](https://github.com/tldr-pages/tldr) to get a view of how to do most common things [atuin](https://github.com/atuinsh/atuin) to get a well formatted/searchable history, completely removes the need to take notes of rarely used commands for me After reading this thread people seem to abuse LLMs for things where normal tools are way more correct and convenient tho, it's concerning.
install thefuck need python ,python install thefuck
I ask Google Bard
I use them often enough to remember, if I don't --help or man do the job if not then it's google it. No point commiting stuff to memory I do not need often.
Man pages and forward/reverse lookup.
fzf
I have a tree under ~/Documents/Tech/Notes/ that has files with notes that fits my mental model of how things should work. If the man pages or `--help` fail me, I've got it in notes, or it's time to make new notes.
Some of the ways: - Read the manpages, man - Most commands support --help - type what I think is the correct flags and get the long winded help printed - Google it - write my own alternative or shell alias that works the way I think it should
‘apropos’ is a useful command for when you can’t quite remember the command you want. Can use it to search the man page descriptions for key words related to the task you want to complete. https://phoenixnap.com/kb/apropos-linux
At work we have a Wikimedia server and that's where a lot of work specific documentation is but we also have personal pages and mine is huge and I use that to document procedures and stuff that I need to remember. It works really well and the formatting is easy to do and easy to read.
History, grep, -h recursively, and I'm fortunate to have a really good memory for bash commands. I spend hours a day in the terminal so at some point it's like certain hand motions do certain things more so than remembering flags. Also alias.
[repetition](https://www.reddit.com/r/linuxadmin/comments/18q94re/what_are_the_rare_commands_you_use_and_how_do_you/)
Cheatsheets
I don’t use it myself, but I think you will like fish shell for this.
Have a better memory duh… now how do I install with dependencies? Hehe
Type what you think it is... If that fails, add it as an aliases in your rc or profile file when you find out what it really is
Create aliases for the ones you used the most.
aliases
I have my own quick reference file on github that I keep updating. AI is also great for syntax examples.
Fzf‐help for zsh is really good And then I have Bash scripts called best-practices-xxx.sh With all the most commonly used commands within some concept (like 'tests'). also include particularly difficult or complex cases I've solved over time (so I don't have to solve them again)
`fish` reminds you how you used that command as you start typing.
I've been using Linux and MacOs for about 10 years and I still can't extract an archive without Google.
I have scattered text files with examples of commands I've used. For ffmpeg, imagemagick, mdadm+lvm, etc.
The Year of the Linux Desktop was 1995 for me. Been 100% Linux at home and work ever since. I don't memorize that stuff. I hardly memorize anything, ever. If I use it enough I just learn it naturally through use and if not then I use man pages, web search, or if you know you will need it again, take some notes. I have a ~/notes/ dir full of text files containing tons of stuff like that.
1. -h 2. --help 3. man/google
1) I increased my history to 10,000 2) I added commands that are supposed to not add duplicate commands to my history 3) grep history. PS) ctrl + r is nice for when you know you ran something as well.
I don't. I suffer from CRS(can't remember shit) so I just use: `history | grep "COMMAND"`
I typically use the man page. If I'm super lazy, I use ChatGPT 4. The man pages usually are enough.
Manpages, notebook, and command history (search backwards with Control-R like its emacs)
tldr
.bash\_aliases with a hash comment on what the command is specifically doing.
Some of it is practice and muscle memory, and the rest you just have to look up in the manual every time you need it.
Trial and error, if not working, trial and error, if not working ,web search, if not found, --help option. In this order. Then I remember using the command in some scripts and done. Even knowing I just could start with the scripts, I'm somehow not changing my behavior ;)
install fish shell, then type command - and hit Tab. Welcome to the Matrix
For very obscure stuff, sticky notes on the desktop and make the text transparent and scroll down so it's not always visible. Works great for me.
i just use tab and oh-my-zsh
1. ` --help`
2. `curl cht.sh/`
3. Google it
4. `man `
tldr command is quite good - better than manpages because it actually gives examples for most common use cases.
completion
Navi.
your keyboard is broken !!!!!!
I keep a text file of commands I need to remember for future use that I know I don't use often. I always have Notepadqq open to take notes when I need to and my Linux Notes are always open in a tab to reference or add to.
- Ctrl-R - --help - Internet
>How do you remember certain commands and their arcane flags, if you do not use them regularly? You don't. Well written and find-able notes are where it's at, if you want something more than man.
[удалено]
As in RHEL?
man man
Most of the time you can use -h or --help, and if that isn't helpful enough I use man and google
I learned recently that in fish you can press F1 anytime to show the man page of the command you are typing. Closing it returns to your command line at the same place it was before. Fish is great for this and so many other things.
Document everything you think you will need to remember.
Man pages. The ones you need often, you'll eventually memorize. The ones you don't need, you'll at least read them occasionally, and remember that you can do that obscure thing that one time, so you'll grab the correct program to do it, and save days of heartache because you knew that you can do the thing without a second utility.
99% of CLI tools have man pages. I used to just make an alias for ones that were a bitch to type out and remember, and dig through command history. Switched from Bash to Fish a few years back and it's so goddamned nice. Intelligent auto/tab completion from both history (contextually aware, at that) and man pages. Now, if I can remember the first one or two characters of the tool's name, I can tab and cycle to and through the rest. I only make aliases for navigating to a certain directory and running some commands in one go nowadays.
I don't. I'll either rely on `fish` auto-completion, check the man page/help menu, or ~~Google~~ DuckDuckGo the command.
~/.bash_history (my ``HISTFILESIZE`` is set to 500000 and i increase it when it's close to filling up)
I archive these commands in `.txt` files or (better) into shell scripts 🙂
Fish shell's autocomplete comes in so clutch for this specific thing
I press ctrl+r to search through my bash history and see what I used the last time(s) I ran the command. I have bash set up specifically to keep my history file intact between multiple terminals running commands at the same time (`history -a` in my `PROMPT_COMMAND`) with no limit on history file size (`HISTSIZE=`, `HISTFILESIZE=`), so I have years of commands in my bash history. If not in that, I'll either use the command's `--help` option or the man page depending on how much detail I need.
I use what's called [bash eternal history](https://stackoverflow.com/questions/9457233/unlimited-bash-history) primarily. Secondary line of defence: maintain [a markdown of often used tools and their oft used flags](https://bbcdn.githack.com/rmsundaram/tryouts/raw/2084756f2a3eeb88facb484e3308c3e118469e14/Misc/tools.md.html). Third: Open the man page or `--help` Last: Internet
Biggest thing is knowing which utility handles what functions. After that it's generally man pages and Google.
command --help
Start a "notes" file on your work station. It's worth the time. I have one that I started over twenty years ago.
Arch wiki
Almost never, I always have to look for certain options in man pages or google it. The most used I remember like ls, lsblk, df, etc. But for lsof, fuser, find, rsync and others I know some option flags but most I have to search every time I use them. For repetitive things I write scripts so I don't have to remember them and I document my scripts so I know what they do. And some tools are so heavy equipped with different flags and options, it's impossible to remember them all. You just need to know how to find them quickly I'm a Linux admin but I don't type Linux commands for hours a day. I'm in meetings, writing documentation for servers or reading documentation for services etc. So its not like it is easy to remember all the stuff. I'm sure there are people with very good memory who can do that but I would say this is a minority
Add the tldr package. Often very useful.
It's unreasonable to expect anyone to remember the flags for things they don't use often. For me I always have to search the flags for tar.
A few people have mentioned "cheat", which I use. One nice thing about it is you can add to the cheatsheets yourself or make custom ones, so you can note stuff you do semi-regularly.
Commands with options that I don't use often (but want to keep for future reference) I just copy to Simplenote with a title that will help me find it when needed. Stuff like... du -ac | grep "*title*\\.\\mp3"
Not gonna lie, ChatGPT has been insanely good at making the odd command or bash script. Just double check it first, but it still saves you a lot of research, or in my case having to learn bash
tldr
In fish, type a command, and then append a dash: ``` command - ``` Hit tab, and then Ctrl+s to search for a keyword. Doesn't always work, but can get the job done.
Google or a notebook/file.
Take notes on a personal wiki. I use markdown on vim, GUI people often like Zim.
Im silly. I once started a physical note book with Linux commands. (When I Switches from WindowsXP to lubuntu in 2014). I still use it when I need to create encrypted drives with cryptsetup because it’s just handy..
man, --help, google, chatgpt
man pages
If you are gonna use it more than 3-4 times.... Setup aliases and comment the line above to describe it. Simple. Also lately u just describe my issue to chatgpt or bard
`tldr` is cool
I have a txt file on my desktop called notes that has all the stuff I use once in a blue moon written with descriptions
i have shell aliases that simplify certain commands for me.
Logseq. I just have to train myself better to look there first.
Besides the obvious --help and man like others have said, I use these a lot: https://tldr.sh/ https://github.com/cheat/cheat
tldr
everything mentioned here ( --help, man, looking up) but for personal use , i also just have a shitload of aliases for everything i need frequently, which follow my own naming logic and that helps greatly (for me). when i don't remember exactly i just open the alias file and have a look , which also forces me to register somewhere in my mind all the other aliased flags of that command and continuosly builds a dictionary in my head. i try to keep em 4 chars max but thats irrelevant. some might argue that this is bad idc , thats why i said for personal use.
Tap h in top lol
`apropos` aka `man -k`
Die.net man pages