Wiped my son's windows installation today!

Thanks for the link and info wish I knew this before. No idea how many times I have re typed a command before discovering copy paste sometimes works.

On su or sudo
I only use sudo is that wrong to do
Yes know su works but never think down that path

1 Like

No, nothing wrong with that. Sudo is safer.
When I started in Unix sudo did not exist… I stick with the old method.

3 Likes

I think it’s please :grin: It’s like asking my dear computer to do something…

For me the bash completion with pressing TAB was a thing that changed everything. I wish I would’ve known that before YouTube came. Saw one video where someone just used it and I was wondering how to do it. Like if you have a long file name you need to unzip. Earlier I typed the full name but now I use TAB with all commands. It also helps to notice if there’s a typo. The bash completion won’t work if you have a typo. Like if you write ‘sduo dd if’ and press TAB nothing happens because of the typo.

4 Likes

Have never used that… did not know about it.

3 Likes

Here’s more info Mastering Bash Completion for Effortless Command Line Magic

Let’s say I want to check my /etc/fstab. I just use the TAB when I write

cat /e[TAB]fs[TAB][ENTER]

instead of

cat /etc/fstab[ENTER]

5 Likes

I use “sudo -i” - interactive super user session - I see a lot of colleagues instead type “sudo su” or “sudo su -” (to load root’s profile) - I don’t understand if there is a difference - but “sudo -i” is less keystrokes… And I usually invariably have “x ALL=NOPASSWD: ALL” in my sudoers… In “sudo -i” I get root’s shell, profile and shell history… I always leave “root” with the default shell (i.e. usually bash).

I’m constantly doing “sudo !!” - e.g. when I try to rm a file on my NAS (in my shell on the NAS : FreeBSD zsh) but I don’t have permission…

I never used to use it - but - I do all the time these days (since last 10 years or so?) - and shell completion is even more “betterer” in zsh than it is in bash… And it’s often smart enough to look through apt for a package name “sudo apt install gnome-[TAB]” will show the packages with “gnome-” in the name… and it will even pre-emptively read /etc/hosts and ~/.ssh/config - so “ssh BLAH[TAB]” will find hosts with “BLAH” in my ssh config file and/or /etc/hosts file…

4 Likes

Cant use that. I tried… it messes my typing.
Completion in firefox is a real pain, especially with file://…
I have had to install another browser just to be able to look at an html file

1 Like

It works with bash also.

Old habits… For me it was a blessing to find out. Especially with the file names with version numbers like 6.4-r2… like when manually removing kernel/initramfs you can write rm vm tab, and add first number (or two) and again press tab to get the vmlinuz-x.x.x file removed. I don’t like to use * when using rm.

I only use Firefox and have no issues with file://

It’s just those things that you are used to or not.

3 Likes

How do you cope with this

I keep getting all those .bash_history.nnnnn.tmp files
I delete them occasionally.
This is in MX. Not sure if other distros do it.

3 Likes

I have never seen those (is this) in root. I think ~/.bash_profile is the right place for these files. I’m not on my computer at the moment but will check where they are later.

Edit: it seems they are in your home directory?

1 Like

I don’t think the .bash_history file is updated live. It updates that when you exit your session. These are probably created to use until you exit. Maybe you have many stranded SSH sessions?

2 Likes

On Debian it has .bash_history and .bash_logout in home folder.

1 Like

Yes , in my home directory.

2 Likes

Yes, I do save sessions in Xfce… only one session… the state when I logout.
I do have about 10 terminal windows spread over 4 workspaces… it session saves all of them.
There are more than 10 of those .bash_history.nnnn.tmp files
I will do an experiment… turn off session save.

3 Likes

I never looked but I have several too.

3 Likes

I think I am onto it

That is way too small

bashhistorywc

it limits the size of .bash_history

If the limit is reached, it starts writing .tmp files, I think
Session saving would not help as it prolongs the life of terminal sessions.

I need to set it to something larger

export HISTSIZE=20000

and I read somewhere if you set it to NULL or -1 that means no limit?

Also, I have no idea how .bash_history copes with multiple terminal windows?
Can anyone shed some light on that?

4 Likes

I think it only saves the history of the last terminal which is open when you close it. I found a good read: https://www.howtogeek.com/465243/how-to-use-the-history-command-on-linux/

3 Likes

I think you are right
Here is another article on the topic

https://www.baeldung.com/linux/preserve-history-multiple-windows

It seems you can configure things to improve the situation, but it is really messy.
The shell history mechanism has never moved out of the days of a single console terminal with no windows.

That is for archiving history after a terminal is closed.
While a terminal is open, it uses the .bash_historynnnnn.tmp files, and that works fine…each active terminal has its history accessible.
It is only if you close a terminal, then want its history, that the system falls over.

I might ask Jimmy(@Akatama )if his Atuin history database copes with multiple terminals

4 Likes

It’s a good idea! He’s not in too much pain?

Personally, I’m (almost) 16 years old too @TypeHrishi, it’s been 3.5 years since I had my first computer, 2 since I discovered GNU-Linux because the windaube taskbar (pun intended untranslatable French meaning windows=daube, the pronunciations are close) I didn’t like it :sweat_smile:. But GNU-Linux is infinitely more customizable than Windows…

Finally, if today I use Fedora 41 Workstation (GNOME vanilla), it is as much for the customization possibilities of GNOME, as for the lightness of GNU-Linux, the free software…

@ihasama I have a problem similar to yours: convincing my little brothers to install Linux :penguin: :goat: on “their” chromebook (which they only partially paid to replace the computer they had demolished during an epic fight…), compatible with chrultrabook.

The PC of my idiot brothers:
https://www.darty.com/nav/achat/informatique/ordinateur_portable-portable/portable/acer_cb314-2h_mtk_8_128.html

Translated from french :fr: to english :uk: :us: with Googhell Translate.

7 Likes

Hi @Francois_GUERIN

That is indeed one of the main advantages of Linux.

I would like to say that we appreciate the efforts to participate, by people for whom English is not their first language. We also appreciate hearing from young people.
Keep at it, you are doing well.

Regards
Neville

6 Likes