Reputation
354
Top tag
Next privilege 500 Rep.
Access review queues
Badges
3 9
Newest
 Nice Answer
Impact
~81k people reached

  • 0 posts edited
  • 0 helpful flags
  • 98 votes cast
Apr
18
comment disable a usb port in linux
Have you tried removing the device file/dir? e.g. sudo rm -rf /dev/bus/usb/001 Often you may recreate device files using MAKEDEV (man MAKEDEV, e.g sudo MAKEDEV usb, or if the kernel recreates their /dev space, by rebooting, or by noting their major/minor device numbers and using mknod directly)
Mar
14
comment Why is egrep [wW][oO][rR][dD] faster than grep -i word?
So you have demonstrated to yourself that the original premise/assertion leading to the question is basically incorrect, right? egrep [wW][oO][rR][dD] is not faster than grep -i word under the same locale and given file in in the buffer-cache.
Jan
18
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
Oct
13
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.
Oct
5
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".
Oct
5
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.
Sep
11
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?
Jul
25
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?
Jun
22
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.
Apr
13
comment What are the pros/cons of deb vs. rpm?
Yes, precisely. And well said.
Feb
4
comment The myths about malware in Unix / Linux
Check out this quora answer: goo.gl/UVCsgz it covers the main reasons why Linux/Unix is different than Windows in terms of chances of being randomly infected by malware.
Jul
21
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.
Jul
9
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 :)
Jul
9
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.
Jul
9
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.
Mar
3
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.
Dec
14
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.
May
13
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.
Apr
1
comment BUG: soft lockup - CPU# stuck for x seconds
+1 for the data analysis and ggplot charts :)
Feb
18
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?