Reputation
Next tag badge:
98/100 score
37/20 answers
Badges
19 150 296
Newest
 Good Answer
Impact
~4.7m people reached

2h
comment Which is the command for show all property of my PC on terminal
Sounds more like it. At least it's more functional that that archey script.
3h
comment How do I find a file name that's exactly 8 levels deep?
POSIXly, you can use -path '*/*/*/*/*/*/*/*' -prune -name '*XYZ*'. Note that some BSDs also have -mindepth/-maxdepth but also -depth 8.
4h
comment Why does ln -s accept a single argument
Note that that behaviour is not specified by POSIX but seems to be fairly common (GNU, busybox, FreeBSD, Solaris, Ultrix at least, and was already like that (though -s wasn't supported of course) in the first version of Unix in the early 70s).
5h
comment Why does ln -s accept a single argument
Another way to put it: ln -s /path/to/file is short for ln -s /path/to/file .. Like ls is short for ls ..
5h
comment Unix equivalent of smart folders
What do you mean by Unix? OS/X (at least some versions) is a certified Unix, Linux-based systems currently are not. Any particular other Unix you had in mind?
6h
comment How to print the name of missing files in a folder?
See also the {0000..1800..600} form.
9h
comment How to recursively check if a specfic user has read access to a folder and its contents?
@DirkHartzerWaldeck. Thanks. Note that this answer was copy-pasted, adapted and simplified from this other answer that dealt with write access which you may like as well ;-).
1d
comment How to find all .zip and .rar files recursively and sort them by size
@Marko-A, I did say with zsh. zsh is a different shell from bash.
1d
comment Add 30 days in date
Please include the output of describe the-table;
1d
comment List all commands that a shell knows
Another edge case is for values of $PATH like /bin:/usr/bin: (trailing :), where it would fail to list the executable files in the current directory.
1d
comment List all commands that a shell knows
Note that compgen -c will include things like { or while that are not strictly speaking commands.
Jul
23
comment Loop through a multidimensional array in bash 4
@rubo77, in that case, the while loop runs in a subshell.
Jul
23
comment Loop through a multidimensional array in bash 4
@rubo77, I just meant process_gws() while...; done; process_gws <<... which you may find neater. That's all cosmetic considerations.
Jul
23
comment Loop through a multidimensional array in bash 4
@rubo77, no, but you could use a function if you want to make it neater.
Jul
23
comment Convert ls -l output format to chmod format
Note that expr -rwsr-sr-x : ".\{$i\}\(.\)" doesn't work on FreeBSD (invalid option), while expr -- -rwsr-sr-x : ".\{$i\}\(.\)" won't work with busybox. So you'd need expr "x$var" : "x.\{$i\}\(.\)"
Jul
23
comment Grep for a string in file without using pipe
Note that $(...) uses a pipe.
Jul
23
comment How to influence a bash while loop with a timed global variable?
Note that you can use "EXIT" instead of "0" to make it more self-explanatory. Note that POSIXly it should be kill -s USR1 though kill -USR1 will work as well on most systems covered by U&L (and if the shell is bash)
Jul
23
comment Convert ls -l output format to chmod format
Yes, I realised that later, which is why I deleted the comment.
Jul
23
comment Convert ls -l output format to chmod format
Note that seq is not a POSIX command. You may be able to use the ${var#?} operator to avoid expr. Not that LC_COLLATE will not override LC_ALL
Jul
23
comment Convert ls -l output format to chmod format
Sorry about l/L [[, I read too quickly. Yes, -- and ++ are not POSIX. POSIX allows shells to implement them, that means you have to write $((- -a)) if you want a double negation, not that you may use $((--a)) to mean a decrement operation.