List X random files from a directory
Is there a way to list a set of say, 30 random files from a directory using standard Linux commands? (in zsh)
Is there a way to list a set of say, 30 random files from a directory using standard Linux commands? (in zsh)
Following on from this question about stripping newlines out of text, I want to turn this into a zsh alias as follows:
I’m looking for guidelines on what one should and should not include in the various startup files for zsh.
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.
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.
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?
${!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.
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
I currently have the following line in my .zshrc:
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.