Skip to content

Magenaut

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

zsh

List X random files from a directory

August 10, 2022 by Magenaut

Is there a way to list a set of say, 30 random files from a directory using standard Linux commands? (in zsh)

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

Escaping quotes in zsh alias

August 10, 2022 by Magenaut

Following on from this question about stripping newlines out of text, I want to turn this into a zsh alias as follows:

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

What should/shouldn’t go in .zshenv, .zshrc, .zlogin, .zprofile, .zlogout?

August 10, 2022 by Magenaut

I’m looking for guidelines on what one should and should not include in the various startup files for zsh.

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

How to edit command line in full screen editor in ZSH?

August 10, 2022 by Magenaut

In bash, using vi mode, if I hit Esc,v, my current command line is opened in the editor specified by $EDITOR and I am able to edit it in full screen before ‘saving’ the command to be returned to the shell and executed.

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

Dynamic zsh autocomplete for custom commands

August 10, 2022 by Magenaut

I’m trying to write completion functions for some custom functions I wrote, but seem to be really struggling with even the most basic ones.

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

Avoiding “BASH-isms” in shell scripts

August 10, 2022 by Magenaut

Does there exist a tool similar to Perl::Critic that will inspect your shell scripts and point out flaws, portability issues, uses of non-standard programs without fallbacks, depreciated program uses, etc?

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

${!FOO} and zsh

August 10, 2022 by Magenaut

${!FOO} performs a double substitution in bash, meaning it takes the (string) value of FOO and uses it as a variable name.
zsh doesn’t support this feature.

Categories Q&A, Unix & Linux Tags bash, for, variable-substitution, zsh Leave a comment

mv * folder (avoiding ‘cannot move’ error)

August 10, 2022 by Magenaut

Anytime I want to move thousands of files to a new folder, I always encounter the same problem. > mkdir my_folder > mv * my_folder mv: cannot move 'my_folder to a subdirectory of itself 'my_folder' While I think that the error above is harmless (is it?) I am wondering if there is a way of … Read more

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

autocomplete weirdness as a result of ugly hack for zsh prompt

August 10, 2022 by Magenaut

I currently have the following line in my .zshrc:

Categories Q&A, Unix & Linux Tags prompt, terminal, zsh Leave a comment

Are there problems with hyphens in functions, aliases, and executables?

August 9, 2022 by Magenaut

In my testing (in Bash and Z Shell), I saw no problems with defining functions or aliases or executable shell scripts which have hyphens in the name, but I’m not confident that this will be okay in all shells and in all use cases.

Categories Q&A, Unix & Linux Tags bash, csh, ksh, shell, zsh Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … 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