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: 2809
Joined: Mon Apr 18, 2011 12:03 am
Location: Florida

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 remember to mark your fixed problem [SOLVED].

Running Linux Mint Cinnamon 19.3.

Judge a man by his questions rather than his answers.
— Voltaire

User avatar
AZgl1500
Level 13
Level 13
Posts: 4582
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: 552
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 16
Level 16
Posts: 6093
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
libera ab tyrannis

User avatar
BG405
Level 8
Level 8
Posts: 2104
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 ----Two ROMS don't make a write.

rickNS
Level 5
Level 5
Posts: 720
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 16
Level 16
Posts: 6093
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
libera ab tyrannis

rickNS
Level 5
Level 5
Posts: 720
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: 96
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: 388
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. ;)

Minux1
Level 4
Level 4
Posts: 290
Joined: Tue Aug 06, 2019 1:49 am

Re: How do you remember bits of sudo code?

Post by Minux1 »

Got a lot of terminal practice with the MAC OSX terminal which is just about the same thing in appearance and syntax as its Linux counterpart.
Both Unix derivatives.
In MAC I used brew instead of apt in terminal commands when dealing with installation packages and repositories.

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

Re: How do you remember bits of sudo code?

Post by BG405 »

Minux1 wrote:
Sat Apr 11, 2020 7:25 am
In MAC I used brew instead of apt in terminal commands when dealing with installation packages and repositories.
Funnily enough this came up in a Skype chat with my mate last night who has at least one Mac. Also that they are changing from BASH to ZSH due apparently to some licencing issue. Although pretty similar, it seems, there are bound to be some differences, especially as time goes on.
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 ----Two ROMS don't make a write.

Minux1
Level 4
Level 4
Posts: 290
Joined: Tue Aug 06, 2019 1:49 am

Re: How do you remember bits of sudo code?

Post by Minux1 »

BG405 wrote:
Sat Apr 11, 2020 11:10 am
Minux1 wrote:
Sat Apr 11, 2020 7:25 am
In MAC I used brew instead of apt in terminal commands when dealing with installation packages and repositories.
Funnily enough this came up in a Skype chat with my mate last night who has at least one Mac. Also that they are changing from BASH to ZSH due apparently to some licencing issue. Although pretty similar, it seems, there are bound to be some differences, especially as time goes on.
Apparently a Windows 10 iteration is coming some time in the future with a full fledged Linux kernel and a new, improved & fully integrated terminal. The platforms all have their strong & weak points ... I own and operate several examples all 3 platforms (Windows Mac, Linux) and don't have any plans of "quitting" any of them. If eventually we're all speaking the same terminal language all the better. I like different when different means better. But different just for the sake of being different because of some juvenile inter-platform peeing contest I don't have the time of day for.

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

Re: How do you remember bits of sudo code?

Post by BG405 »

Minux1 wrote:
Sat Apr 11, 2020 4:08 pm
I like different when different means better. But different just for the sake of being different because of some juvenile inter-platform peeing contest I don't have the time of day for.
I agree completely with that. However:
Minux1 wrote:
Sat Apr 11, 2020 4:08 pm
If eventually we're all speaking the same terminal language all the better.
I'd really like that as well but there would inherently be some constraints re. commercially produced stuff with respect to pure FOSS.

Not sure of the current and future (in)compatibility issues which may crop up with BASH vs. ZSH & whatever Terminal solution Windows users end up with.
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 ----Two ROMS don't make a write.

Minux1
Level 4
Level 4
Posts: 290
Joined: Tue Aug 06, 2019 1:49 am

Re: How do you remember bits of sudo code?

Post by Minux1 »

ZHS is as yet sight unseen.
“brew” is still the unofficial current MAC answer to “apt”.
One is free source and the other is a proprietary wholly owned for profit O/S and that critical difference will always skew any attempt at direct comparisons of MAC & Linux.

Minux1
Level 4
Level 4
Posts: 290
Joined: Tue Aug 06, 2019 1:49 am

Re: How do you remember bits of sudo code?

Post by Minux1 »

ZHS has shown up on the scene with the latest MAC Catalina updates.

Minux1
Level 4
Level 4
Posts: 290
Joined: Tue Aug 06, 2019 1:49 am

Re: How do you remember bits of sudo code?

Post by Minux1 »

Hoser Rob wrote:
Mon Feb 10, 2020 9:06 am
A lot of it is just repetition, but it halps a lot if you actually understand what the command in question is going to do. Then it's not just memorization.

If you want to be a sysadmin on a server you really do need to know all this CLI stuff because they don't install GUI shells on those. For desktop users, a good notes program will do fine. I like cherrytree.
I can’t see any of the paint on the walls near the computer desk for sticky memos with terminal code snippets on them. ;)

User avatar
busdriver12
Level 2
Level 2
Posts: 61
Joined: Mon Aug 12, 2019 9:34 am
Location: Perth WA

Re: How do you remember bits of sudo code?

Post by busdriver12 »

SoyDodger wrote:
Sun Feb 09, 2020 9:58 pm
So following another discussion on the boards here, and as a new user, I'm now interested to learn how people remember all the bits of sudo code they use.
snip...
I've created a directory in my Documents structure called Linux/Reference. Any goodies I come across online I save to separate files loosely by subject matter which gives me a quick reference. I've only been on Linux for ~6months now and every useful web site, video and tit bits gleaned from forums (mostly from this one) are saved in there in one form or another.

I've mostly used Libre Writer to create these files with the added benefit of becoming familiar with that as well - any useful URLs are usually saved into the text using hyperlinks. This is what I have in there at the time of this post. It's also backed up to the cloud using Dropbox.

Code: Select all

phil@Home-PC:~/Documents/Dropbox/Linux/Reference$ ll
total 708
-rw-r--r-- 1 phil phil  25465 Dec 30 13:29  apt-commands.odt
-rw-r--r-- 1 phil phil   1519 Jan 12 14:44  apt-get-help.txt
-rw-r--r-- 1 phil phil   2253 Jan  7 17:43  apt-help.txt
-rw-rw-r-- 1 phil phil  21197 Dec 15 10:57  bashcmds.odt
-rw-rw-r-- 1 phil phil  26100 Dec 22 06:50 'bash commands from videos.odt'
-rw-rw-r-- 1 phil phil  14530 Oct  4  2019 'Config files.odt'
-rw-rw-r-- 1 phil phil  16133 Apr  4 16:57 'Escape Codes.odt'
-rw-rw-r-- 1 phil phil  17136 Sep 29  2019  Filters.odt
-rw-rw-r-- 1 phil phil  95735 Aug 30  2019  linux-commands-cheat-sheet-A4.pdf
-rw-r--r-- 1 phil phil   3888 Sep 22  2019 'Linux Filesystems Basics.txt'
-rw-r--r-- 1 phil phil  11920 Nov 17 15:24 'Linux Maintainance.odt'
-rw-r--r-- 1 phil phil 310689 Jan 24 14:39  man-bash.txt
-rw-rw-r-- 1 phil phil  21601 Oct  1  2019  Permissions.odt
-rw-rw-r-- 1 phil phil  11152 Dec 21 06:17 'Problems solved.odt'
-rw-rw-r-- 1 phil phil  17526 Nov  5 19:53  redirection.odt
-rw-rw-r-- 1 phil phil  15236 Feb  9 17:01 'Useful_URLs - Linux Reference.odt'
-rw-r--r-- 1 phil phil  15141 Jan  7 08:23  Users_Groups-Commands.odt
-rw-rw-r-- 1 phil phil  12927 Sep 29  2019 'Using cat.odt'
Phil

Linux Mint 19.3 Cinnamon 4.4.8

User avatar
GS3
Level 6
Level 6
Posts: 1151
Joined: Fri Jan 06, 2017 7:51 am

Re: How do you remember bits of sudo code?

Post by GS3 »

Every computer I maintain has a file somewhere, often on the desktop, which has several subfolders. I have a folder there with all the relevant hardware and software configuration. I have a text file with useful commands. I have shortcuts to system tools like Gparted, etc.
HP Compaq Elite 8300 CMT - Linux Mint 18.2 Sonya - Kernel 4.4.0-171-generic x86_64 - Cinnamon 3.4.4 - Nemo
HP Compaq Elite 8300 CMT - Linux Mint 19.3 Tricia - Kernel 5.3.0-51-generic x86_64 - Cinnamon 4.4.8 - Nvidia GF108

Post Reply

Return to “Chat about Linux”