Top tag
Next privilege 500 Rep.
Access review queues
3 9
 Nice Answer
~74k people reached

  • 0 posts edited
  • 0 helpful flags
  • 96 votes cast
comment What's wrong with this for loop in bash script?
+1. This is the most elegant/general solution, because it doesn't rely on the name substrings $i being numeric. For greater clarity, I would move the 4 invariant assignments of AR1_p...=... out of the loop (before the for), and also rename VARIABLE to VARNAME
comment Do hard links count as normal files?
links in Unix are names referring to data (inodes) in the filesystem. It is the data that determines the type of the "file" (a normal file, socket, pipe, device etc), sizes, permissions, modified times, etc. The link (name of object) has nothing to do with what kind of data is, you can name the object as you please, so the answer to the OP question is NO.
comment What is the difference between * and *.* while copying?
@jamesdlin. Since the 1st day of Unix (circa 1969), directory entries starting with a dot were considered hidden. Originally this was needed to skip the . (current directory) and .. (parent directory) entries which always exist in any directory (even empty dirs). Ritchie and Thompson later considered it to be a useful feature to hide (by default) all the .*rc config files and added an explicit -a option to ls to display all these (leading-dot) "hidden" entries. So this is not very surprising knowing Unix history. A leading dot in Unix has been special since "forever".
comment How does the command sed '1!G;h;$!d' reverse the contents of a file?
As mikeserv hints. One should note that this tricky sed recipe is an extremely inefficient way (O(n^2/2) complexity) to reverse lines in a file. It would be prohibitively slow for files with a large number of lines. For a much more efficient line-order reversal alternative see tac from GNU coreutils.
comment How to grep -v and also exclude the next line after the match?
Given that (GNU) grep already supports PCRE (via the -P option), what is the advantage of using pcregrep?
comment How to route specific adresses through a tunnel?
Note: at least on ubuntu -interface isn't an option of route so the above suggestion gives a usage error. Also how will this result in routing via the ssh tunnel as the OP asks?
comment Why am I still getting a password prompt with ssh with public key authentication?
Please note that generally, allowing remote root logins is not a recommended security practice.
comment What are the pros/cons of deb vs. rpm?
Yes, precisely. And well said.
comment The myths about malware in Unix / Linux
Check out this quora answer: it covers the main reasons why Linux/Unix is different than Windows in terms of chances of being randomly infected by malware.
comment How to make user passwords shown as a clear text in Linux?
it is not true that passwords are stored in /etc/passwd. At least not in the past ~20 years, since /etc/shadow was invented. The 'x' you see there is not the encrypted password. It is a literal 'x' which can not possibly match any MD5 or SHA1 etc sig.
comment What is the difference between these two SSHD configs?
I mean that just by reading the man pages, Raza's answer sounds correct. Of course, to really be sure someone should actually verify it before answering :)
comment What is the difference between these two SSHD configs?
@HaukeLaging, are you really sure about this? The Match section in sshd_config(5) and the PATTERNS section in ssh_config(5) seem to disagree with this accepted answer by my reading of them.
comment What is the difference between these two SSHD configs?
The openssh man page says By default, login is allowed for all groups this seems to imply that * at the beginning is redundant because it is the default, and !root is the same as *,!root.
comment Subtract 1 from all file names (rename them) in a directory.
replace the * at the end with `ls -v1 *` and you'll be safer from clobbering. It'll go from the lowest number to highest.
comment linux: How can I view all UUIDs for all available disks on my system?
Just a minor comment: looks like being a member of group disk is sufficient to run blkid; no need for full superuser privileges.
comment Why does the “she-bang” begin with a “#!”?
Or to be more detailed: the shebang: '#!' is designed not to be seen by the interpreter -- thus it must start with the comment char '#'. Instead, it is 'seen' (and interpreted) by the kernel 'exec[lv]*' set of system calls.
comment BUG: soft lockup - CPU# stuck for x seconds
+1 for the data analysis and ggplot charts :)
comment What killed tty main process suddenly?
Is this running in a virtual machine? e.g. VMware? Is the system disk a local or virtual disk (connected over the network)? Was some underlying hardware restarted/recycled at the same time?