2,474 reputation
41128
bio website none
location Copenhagen, Denmark
age 41
visits member for 3 years
seen yesterday

Long-time Linux user (since 1994).


Aug
26
comment Login by ssh , exec one command and i don't want to quit the bash
I achieved the same by changing the PS1 setting in the .bashrc of all remote machines I was working on (30+ servers). This means some setup work, but then you can just ssh into the machines..
Aug
18
comment Why doesn't the sudo command need the root password?
The answer should really start with the setuid part, because that's the reason that it is actually possible. /etc/sudoers is just the reason for the flexibility of the sudo command.
Aug
4
comment Why am I getting “Job for httpd.service failed…,” and how do I go about fixing it?
What happens when you start apache directly with /usr/bin/apachectl start?
Jul
31
comment two if conditions in for loop bash scripting
Your netstat line does not use the $i value at all. So either you'll get the "NOT - OK" line three times, or not at all.
Jun
1
comment Is it possible to inject newlines in the ouput of cowsay/cowthink while preserving the “bubble”?
No, what comes on the command line is not stdin.
May
18
comment Why does vim jump down to same position after multiple spaces?
Are you in insert mode? If not, vim shows the described behaviour
May
18
comment zsh completion doesn't correct ? (question mark) in paths
I don't think the question mark is supposed to match slashes.
May
13
comment Renaming a whole folder content
@user67486 Your error message should be gone now.. And I thought you had s01e in front of every file name; how do you expect other file names to be handled?
May
13
comment Hiding data in filesystems
You could just delete it, you know ;-)
May
12
comment Can anyone please explain me below AWK script
The gsub removes spaces, not plus signs. It's a regex.
May
6
comment Set a screen session name at the command prompt
Why not just use alias newscreen='screen -D -R -S'?
May
6
comment Is there a way to execute the second-to-last command that started with a given string?
You could also use Ctrl-r to search backwards in history
May
6
comment XOR of a shell variable and a binary file
This is a description of a logical (boolean) xor operation, not a binary (bit-by-bit) xor the OP was asking for.
May
5
comment Redirect grep out to a file does not work
Have you looked at the size or content of tmp.txt? One reason could be that the output file is also searched by grep, resulting in an infinite amount of results. And how large is the current directory, incl. subdirs?
May
5
comment How do I use the SED command to remove injected code from multiple files?
It's probably a good idea to consider reinstalling the whole server. When the server has been compromised, you can't know what harmful software might be running on it..
Mar
12
comment Why does this executable still execute after I deleted it?
Of course, the executable could have been recreated from a different shell between the ls -la and the ./testedfb.
Mar
8
comment Opening ALSA Microphone in two programs?
I guess something like JACK (jackaudio.org) could do that, but that's not easy to set up , I believe.
Mar
4
comment List only regular files (but not directories) in current directory
The version using $f works for me. Maybe I have an old bash version? I couldn't find $_ in the Bash manual, even though it does exist.
Mar
4
comment List only regular files (but not directories) in current directory
No. In a directory with two subdirs (1 and 2) and two files (3 and 4), it prints "/bin/sh" twice. Again, what is the meaning of $_?
Mar
4
comment List only regular files (but not directories) in current directory
Which shell is that for? Bash doesn't print anything, I guess because $_ is empty