System Administration: On using BASH, vi and no aliases
-
Great points. Even tho I like to use nano whenever it's available, that doesn't mean I can't use vi. The basics really are essential. If nothing else knowing how to do a quick edit, save and exit in vi is one of those essentials you'll need at some point.
-
I've always used vi as it is standard across the board from all flavours of UNIX and Linux. I know it'll always be there for me.
-
Knowing how to use
vi
and choosing to use something better for daily tasks are not mutually exclusive like you are trying to paint here.Additionally, you are calling, or at least grouping,
nano
as uncommon which is far from the truth. It is a core RHEL option, and beyond minimal installs, it is also pre installed. -
I generally use vi but, as I have mentioned in the past, there are some distributions that change how vi works by default which makes it frustrating to use, going from Fedora-esque distributions to Debian-esque distributions is painful as far as vi is concerned, at least for me.
-
@coliver Yes, like Ubuntu.
-
I can hack my way through working with vi... but I need to learn it better.
-
@JaredBusch said:
Knowing how to use
vi
and choosing to use something better for daily tasks are not mutually exclusive like you are trying to paint here.Additionally, you are calling, or at least grouping,
nano
as uncommon which is far from the truth. It is a core RHEL option, and beyond minimal installs, it is also pre installed.That's true, you can know both. Although it is very rare that someone maintains a proficiency in vi while using something else normally.
Nano is relatively rare. Have working in many UNIX environments and tens of thousands of servers, I'm not sure we've had it once until RHEL 7. (I definitely see it on my desktop installs, just servers, I mean.) Did RHEL 6 have it by default?
But, even if it is becoming more standard to include it, it's not ubiquitous. It was extremely common to have Joe installed back when I ran into the need for vi, but it wasn't there. People even in the 1990s often argued that emacs and joe were so common that vi wasn't needed to be known any longer. And that's why no one knew it.
Nano is certainly common today. But in an emergency, you don't know that it will be there. At least nano on RHEL is in /usr/bin. Traditionally those tools were not kept available to single user environments.
-
Scott, let me tell that you're completely right.
I use vi as my primary editor, with little customization.
Vi is everywhere, from the ESXi busybox to router firmware CLI… and I really like how it works.
My only non-standard temptation is ZSH, but I usually can do almost everything with plain bash (set -o vi, of course). -
@Francesco-Provino said:
My only non-standard temptation is ZSH, but I usually can do almost everything with plain bash (set -o vi, of course).
zsh is better than most because it is backwards compatible with bash, so nearly everything that you do is transparent between them. It uses the same conventions and everything, so that falling back to bash you barely notice.
-
The thing about vi is that at first you hate it and then later, you still hate it but you forget that you are using it.
-
@StrongBad said:
The thing about vi is that at first you hate it and then later, you still hate it but you forget that you are using it.
I never forgot I was using it. I learned it, and can use it, but I will never like it.
-
I've applied this same philosophy with my use of Windows server (and desktops). Try my best whenever possible to use the default tools, etc. An example, I never changed the default start menu while so many comrades usually would change the start menu back to an older view.
-
Very good read. I'm sharing your philosophy and like I said yesterday, I'm a console fetishist. You just need to use what you have when you are in a recovery console or when your server just does not have access to that NFS export or SMB share where all your fancy tools and scripts are.
I think it's way more important to understand how things actually work. This will also help a lot when it comes to tracking down errors.
PS: This is not about necro'ing an old thread, but the topic just came up once more.