Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

zsh

How to define and load your own shell function in zsh

August 9, 2022 by Magenaut

I am having a hard time defining and running my own shell functions in zsh. I followed the instructions on the official documentation and tried with easy example first, but I failed to get it work.

Categories Q&A, Unix & Linux Tags shell-script, zsh Leave a comment

What is the best way to detect (from a script) whether software is installed?

August 9, 2022 by Magenaut

I’ve been frustrated before with differences in output from the which command across different platforms (Linux vs. Solaris vx. OS X), with different shells possibly playing into the matter as well. type has been suggested as a better alternative, but how portable would that be?

Categories Q&A, Unix & Linux Tags bash, standard, which, zsh Leave a comment

.zshrc shortcut working on Arch but not Ubuntu

August 9, 2022 by Magenaut

I use the zsh shell as default shell on both Ubuntu and Arch.

Categories Q&A, Unix & Linux Tags keyboard-shortcuts, shell, zsh Leave a comment

pushd, popd vs cd, cd- in bash and zsh

August 9, 2022 by Magenaut

Is there a difference between the behavior of pushd/popd in bash vs zsh? It seems in zsh cd, cd- behaves exactly the same as pushd/popd (which adds/pops directory automatically when cd) while in bash cd doesn’t affect the dir stack.

Categories Q&A, Unix & Linux Tags bash, cd-command, pushd, zsh Leave a comment

Start zsh with a custom zshrc

August 9, 2022 by Magenaut

I want to be able to start zsh with a custom rc file similar to the command: bash --rc-file /path/to/file

Categories Q&A, Unix & Linux Tags linux, oh-my-zsh, shell, zsh Leave a comment

cp hidden files with glob patterns

August 9, 2022 by Magenaut

Situation :

Categories Q&A, Unix & Linux Tags cp, dot-files, wildcards, zsh Leave a comment

When do you use brace expansion?

August 9, 2022 by Magenaut

I understand what brace expansion is, but I don’t know how best to use it.

Categories Q&A, Unix & Linux Tags bash, brace-expansion, ksh, shell, zsh Leave a comment

How to delete part of a path in an interactive shell?

August 9, 2022 by Magenaut

Is there a shortcut in bash and zsh to delete one component of a path? For example, if I type ls ~/local/color/, and the cursor is at the end of line, is there a shortcut to delete the color/ at the end? Ideally I want solutions in both vi-mode and emacs-mode

Categories Q&A, Unix & Linux Tags bash, shell, zsh Leave a comment

Where are zsh and mksh incompatible with bash?

August 9, 2022 by Magenaut

To what extent can other POSIX-compatible shells function as reasonable replacements for bash? They don’t need to be true “drop-in” replacements, but close enough to work with most scripts and support the rest with some modification.

Categories Q&A, Unix & Linux Tags bash, mksh, zsh Leave a comment

Getting relative links between two paths

August 9, 2022 by Magenaut

Say I have two paths: <source_path> and <target_path>. I would like my shell (zsh) to automatically find out if there is a way to represent <target_path> from <source_path> as a relative path.

Categories Q&A, Unix & Linux Tags files, shell, symlink, zsh Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 Page4 … Page7 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress