How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

Boost Productivity with Z and Zsh on CentOS

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
119
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
  2. Setup & Installation
    1. Installing and Using Z
    2. Installing and Using Zsh
    3. Using Z with Zsh
  3. Conclusion
    1. Other Versions
  4. Want to contribute?


Introduction

Working on Linux systems means that one is using the command line more often than not. Having to type long directory names over and over as well as guessing command names eats up valuable time. This can add up very quickly. Z is a tool that records every directory you browse and compiles a weighted list of the most frequent/recently used ones. Zsh is an alternative to bash (the default shell that come with most Linux distros) that adds subtle improvements like spelling correction of words/commands and better tab-completion.

Setup & Installation

Spin-up a Vultr instance running CentOS (either version 6 or 7) and follow the steps below to add a new admin (sudo) user. We’re doing this because it is along the lines of best practices to create a new user and assign it admin rights to access the server, rather than use the root user.

  1. Connect to your Vultr instance ssh [email protected][vultr-ip-address].
  2. Add a new user adduser <newuser>.
  3. Set the password for the new user passwd <newuser>.
  4. Make the new user an admin user usermod -a -G wheel <newuser>.
  5. (CentOS 6 only) Add to sudoers: echo ' <newuser> ALL=(ALL) ALL' >> /etc/sudoers.
  6. Disconnect from instance exit.
  7. Reconnect to instance, but this time as the new user ssh <newuser>@[vultr-ip-address].

Installing and Using Z

You should be in your home directory after you logon as “newuser” (otherwise, run cd ~). Follow the next set of steps to install Z. Note that since Z is a script, what we do is download it to our home directory and tell our default shell to run Z anytime it starts.

  1. Download wget https://raw.githubusercontent.com/rupa/z/master/z.sh.
  2. Install printf "/n/n#initialize Z (https://github.com/rupa/z) /n. ~/z.sh /n/n" >> .bashrc. This command appends . ~/z.sh to your .bashrc file, which in turn tells it to run Z upon start-up.
  3. Reload shell source ~/.bashrc.

To test how Z works, browse to these directories:

cd /etc/cloud/templates
cd /usr/share/nano
cd /etc/pki/java
cd ~

Now, from your terminal, type in z clo and push the tab button, then enter. Next, type z nano and hit the tab button, then enter again. You will see in both cases that Z automatically knew to cd into the first and second directories where we initially browsed.

Installing and Using Zsh

  1. Install sudo yum update && sudo yum -y install zsh.
  2. Check version to verify installation zsh --version.
  3. Make Zsh your default shell chsh -s /bin/zsh. You will be prompted to enter your password.
  4. Logout exit.
  5. Log back into the system ssh <newuser>@[vultr-ip-address].

If you are greeted with a Zsh shell configuration prompt, select “2”, then “1”, then “0” to accept the default settings.

To test things out, type “kill ” and push the tab button (there is a space after kill). Zsh will automatically show you a list or processes to kill as oppose to doing nothing.

Zsh also shares your terminal history across multiple windows/sessions, and has tons of other useful features. There are also frameworks built on top of Zsh that even add more dazzling features to it, such as oh-my-zsh and prezto.

Using Z with Zsh

  1. Run printf "/n/n#initialize Z (https://github.com/rupa/z) /n. ~/z.sh /n/n" >> .zshrc. This command appends . ~/z.sh to .zshrc file, which tells it to run Z on start-up.
  2. Reload shell source ~/.zshrc.

Note: If you do not like the default settings, you can update the Zsh shell configuration by editing the .zshrc file (in your home directory), or by running the following commands:

autoload -U zsh-newuser-install
zsh-newuser-install -f
    source ~/.zshrc

Conclusion

Z and Zsh are useful tools that may drastically help increase your productivity.

Other Versions

Ubuntu

CentOS

Written by Lami Adabonyan

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install BoltWire CMS on CentOS 7
CentOS

How to Install BoltWire CMS on CentOS 7

February 14, 2020
Showterm.io – A Terminal/Shell Recording, Upload and Share Tool for Linux
CentOS

Setup HTTP Authentication With Nginx on CentOS 7

February 14, 2020
Next Post

Install Ruby on Rails with Rbenv on CentOS 7

How to Install Gradle on CentOS 7

How to Install TaskBoard 0.3.1 on CentOS 7

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

Running WordPress on OpenBSD 6.5 with OpenBSD’s HTTPD

3 years ago

How to Add a CentOS 7 Sensu Client

3 years ago
Backing Up Your Data

Backing Up Your Data

4 years ago

How to Install Paste 2.1 on a Fedora 26 LAMP VPS

3 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.