How do you remember bits of sudo code?

Chat about Linux in general
Waka
Level 1
Level 1
Posts: 8
Joined: Mon Jun 05, 2017 2:44 pm

Re: How do you remember bits of sudo code?

Post by Waka »

A lot of is what I would describe as "muscle memory". There are some commands that I can never get right without looking them up, or at least failing them once and get them right the second time. For example I can never remember if it's "xstart" or "startx". Other commands I even use in the windows cmd, even though they don't exist there and then I wonder why the command doesn't work. It even went so far that I specifically created a ll.cmd that executes a dir, because EVERY. SINGLE. TIME I open up a cmd the first thing I type is "ll" only to be greeted with a "unknown command" message... :lol:

The only commands I have never mistakenly used on the platforms are ipconfig (windows) and ifconfig (linux). Don't know why that is... propably "muscle memory". ;)

User avatar
Portreve
Level 9
Level 9
Posts: 2559
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida
Contact:

Re: How do you remember bits of sudo code?

Post by Portreve »

AZgl1500 wrote:
Mon Feb 10, 2020 9:15 pm
[screenshot of notebook]
I like your documentation writing style, for what little I can see of it.
Please be polite and remember to mark your fixed problem [SOLVED].

Presently running Linux Mint Cinnamon 19.3.

“The avalanche has already started. It is too late for the pebbles to vote.” — Ambassador Kosh

Still looking for a new job.

User avatar
AZgl1500
Level 12
Level 12
Posts: 4335
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains
Contact:

Re: How do you remember bits of sudo code?

Post by AZgl1500 »

Hoser Rob wrote:
Fri Feb 14, 2020 8:56 am
AZgl1500 wrote:
Thu Feb 13, 2020 10:14 am
.... for the life of me, I just cannot figure out how CherryTree works.....
I've found that going into preferences > toolbar and removing everything from it that I don't need (which is most of it) helps a lot. Programs that do a lot more than I need are fine if I can clean up the menu, and better than underpowered ones.
I have made several attempts at CherryTree, and for me, it just simply is a piece of gobbledegook, that is NOT worth my time.
I have found that Evernote is completely safe, does not allow any of my data to escape to the outside world, and is immediately accessible to me no matter where I am. Via my cellphone, or any PC that is available that I can log into Evernote.

CherryTree does not have that access, nor does the way it store notes meet with my satisfaction.
Too damn convoluted. So, I have uninstalled it. If it won't work with my Smartphone, it is useless.
Linux Mint 19.3 Cinnamon

ajgreeny
Level 5
Level 5
Posts: 533
Joined: Mon Nov 19, 2007 3:27 pm

Re: How do you remember bits of sudo code?

Post by ajgreeny »

Like a lot other posters I also have a cheat sheet of useful commands, but more useful than that is to use many aliases where typing a single word or phrase can be a shortcut for a long complicated command.

As I said in a recent post my .bash_aliases file contains 40 or 50 aliases which saves me a lot of time and typing.

all41
Level 15
Level 15
Posts: 5932
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How do you remember bits of sudo code?

Post by all41 »

I replied to a post in a different category but pertinent in this thread as well:
viewtopic.php?p=1763139#p1763139

User avatar
BG405
Level 8
Level 8
Posts: 2020
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: How do you remember bits of sudo code?

Post by BG405 »

smurphos wrote:
Mon Feb 10, 2020 1:41 am
Another trick which will allow you to type the start of a partially remembered command in the terminal and then use the up/down arrows to find the last time you used it is to create a file called ~/.inputrc and add the content

Code: Select all

$include /etc/inputrc

# command history search
"\e[A": history-search-backward
"\e[B": history-search-forward

# extended command completion with tab
set show-all-if-ambiguous on
set completion-ignore-case on
You will need to log of and back on for that to take effect.
Very handy, thanks! I had been looking for this info as had seen something like it before but couldn't remember where. Note: logout wasn't necessary in my case; simply opening a new Terminal provided use of this feature.
all41 wrote:
Mon Feb 10, 2020 12:08 pm
my ~/.input.rc also contains some further entries:

Code: Select all

$include /etc/inputrc

# command history search
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char

# extended auto-completion with tab
set show-all-if-ambiguous on
set completion-ignore-case on


# colors
set colored-completion-prefix on
set colored-stats on

# misc
set blink-matching-paren on
set mark-symlinked-directories = on
I do not know the functions of the extra lines--do you?
Without trying, I don't. But it's easy to test with a couple of Terminals side-by-side, one opened after the first version of the file is written and the second after changing it to match yours here. One of the beauties of Linux! I'll probably have a go at this later. Those descriptions look pretty self-explanatory to me; I assume "set blink-matching-paren" means "parenthesis" (brackets), but we'll see. :)
Waka wrote:
Fri Feb 14, 2020 3:12 pm
Other commands I even use in the windows cmd, even though they don't exist there
I've come a cropper in that way too, so to speak. Typing Arch-specific commands in an Ubuntu-based environment (Mint) or occasionally the other way round. Sure I've done it in Windows CMD in the past too. :oops:
ajgreeny wrote:
Sat Feb 15, 2020 10:20 am
use many aliases where typing a single word or phrase can be a shortcut for a long complicated command
This saves a lot of typing as well, but useful if you get the alias to display the full command to help you to remember how things work, as I described in the thread I want to be a linux guru in months linked above by all41.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 8GB - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------K7S5A AMD 1.2GHz - LM17.3 Xfce 32 & WinXP-Pro
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Dell PII 350 64MB - Puppy 4.3 & Win98-SE

rickNS
Level 5
Level 5
Posts: 677
Joined: Tue Jan 25, 2011 11:59 pm

Re: How do you remember bits of sudo code?

Post by rickNS »

smurphos wrote:
Mon Feb 10, 2020 1:41 am

Another trick which will allow you to type the start of a partially remembered command in the terminal and then use the up/down arrows to find the last time you used it is to create a file called ~/.inputrc and add the content....snip
That is a slick bit of code for sure @smurphos.

Having a look at my own .bash_history (some 1600+ lines in about a year) I see a lot of duplication, (probably more than 50%) things like ; ls, cd, inxi -Fxz, clear, etc. appear over, and over.
So was thinking that if the duplication was removed one (or myself as one example) might not need to increase the HISTSIZE so much ?

I went ahead and added the "erasedups" to HISTCONTROL, but it seems to have no effect / doesn't work ?
I started a thread about it not working, that got put in the bash section, maybe you might have a look at it ?
Mint 19.0 mate on 2 identical Thinkpad T420's

all41
Level 15
Level 15
Posts: 5932
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How do you remember bits of sudo code?

Post by all41 »

Why care about duplicates though--they don't interfere at all, especially using the custom .inputrc
I have 9545 entries and that only uses 251 kB storage--minuscule

rickNS
Level 5
Level 5
Posts: 677
Joined: Tue Jan 25, 2011 11:59 pm

Re: How do you remember bits of sudo code?

Post by rickNS »

True, I can't argue about the size of the space used...less than one small picture.

I guess it just bugs me that erasedups don't work as it should. And they are not hard to remove manually either.
Mint 19.0 mate on 2 identical Thinkpad T420's

NuBz
Level 2
Level 2
Posts: 92
Joined: Fri Feb 21, 2020 2:11 pm

Re: How do you remember bits of sudo code?

Post by NuBz »

For one thing sudo code is another subject and not terminal commands

mediclaser
Level 4
Level 4
Posts: 385
Joined: Tue Mar 20, 2018 2:28 pm

Re: How do you remember bits of sudo code?

Post by mediclaser »

RIH wrote:
Sun Feb 09, 2020 10:44 pm
...So what I have done is create a little text file on my desktop called 'Useful terminal Commands'.
It contains commands that others with knowledge have posted in the Forum in response to past queries & my own brief explanation of what the command does....
Whoa! That is exactly how I named my document where I list all terminal commands I had to use which are not easy to remember. :shock:
If you're looking for a greener Linux pasture, you won't find any that is greener than Linux Mint. ;)

Post Reply

Return to “Chat about Linux”