19,267 reputation
34072
bio website
location United States
age
visits member for 3 years
seen 1 hour ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


Aug
3
comment What is a command that will only show me the command syntax and options?
whatis will give you output that is basically the first line of the corresponding man page, but that typically does not contain any option synopsis.
Aug
1
comment scp to an alias
@ryekayo Aliases do not work this way, so restarting wouldn't help.
Jul
29
comment replace comma in specific column value
Judging by your sample input you could just delete all commas everywhere with tr -d , < file.txt > output
Jul
29
comment Piping the output of ls or tree to less loses colors?
@Tim 2 reasons: 1. less removes the colors by default unless you give it the -R option, which tells it to leave it in, and 2. tree and ls and other programs usually turn coloring off when they detect their output is going to another program (like less) instead of directly to your terminal, unless you force the coloring on with -C or --color=always.
Jul
11
comment Symbolic link permission changes
I don't think you can change it. The permissions on a symbolic link don't matter, and are always displayed as 777. Only the permissions on the file it points to matters.
Jul
10
comment How do back-references match in sed?
@dpinvidic :1111 and :2222 are very similar. You should be able to easily see that the pattern matches both strings. Your question should not be "why does this pattern match :2222", because that should be obvious (it's almost the same string as :1111), but rather "why does this pattern NOT match :1111 when :1111 comes before :2222". I explained that in my answer. I have edited my answer a bit. Please reread the entire answer carefully.
Jul
2
comment SSH AuthorizedKeysCommand and SELinux
Try the restorecon command from here: wiki.centos.org/HowTos/Network/SecuringSSH
Jul
1
comment How do I “cat and follow” a file?
@Vi. Yes, tail just works on bytes, which means binary files are fine.
Jun
27
comment Change a value in a config file, or add the setting if it doesn't exist?
It is simpler to use if grep -q 'pattern' file instead of if [ $(grep -c ...) -eq 0 ].
Jun
27
comment Is getline in awk command safe to use?
I don't think there is anything wrong with awk's getline function per se. It can be a code smell though as it is easily misused, either (a) in un-idiomatic constructions when awk already supports line-by-line pattern-action operation, or (b) in attempting tasks too complicated for awk. I would liken it to the much debated goto statement in C in these respects: potentially useful, easily abused.
Jun
27
comment Make firefox command run downloaded firefox instead of iceweasel
This /usr/bin/firefox script is provided by Debian so that users who try to use firefox get something functionally equivalent instead of a "command not found" error. Since it is provided by Debian, it is generally advised to not edit the file, as there are cleaner and easier ways to go about it. The answer depends on how did you install firefox and where did you install it to?
Jun
26
comment Do Links to /tmp files get deleted?
@strugee Most systems do not allow hard links to directories.
Jun
26
comment Recursively iterate through files in a directory
find ... -exec bash -c 'echo filename is in \$0: "$0"' {} \; is a better way to do it.
Jun
24
comment Extract file name from find command
Forget the find part for now. Do you even have the mailing part working correctly? First come up with a mail_file.sh script or one liner that does what you want, and then use it in find. find itself is not a scripting language. You can't just chain -exec like that.
Jun
20
comment How to combine Bash's read with HERE-document when shopt -os errexit is in place?
@mikeserv Did you confuse me with OP? I am not the one that asked the question. Ask OP, not me. Note that your question is something I already pointed out to the OP in my first comment: "I assume your actual code is a bit more complex than your toy example, because in this case assigning to the variable directly would be much simpler.", i.e. desc='bla bla'.
Jun
19
comment Make vim stop splitting my Git commit messages
(continued)... So, this is not technically an answer, but you are supposed to make the highlighting not ugly by writing a properly formatted git commit message. Try to keep line one below 50 characters. Line 2 is supposed to be blank, which is why it is being colored a BOLD RED for "Warning: this text isn't supposed to be here!" Type the extended message beginning on line 3. Vim will automatically break your lines at 72 characters. Let it do so. If you need Vim to redo the line breaks because you did some editing, highlight the paragraph and do gq to fix the line breaks.
Jun
19
comment Make vim stop splitting my Git commit messages
This is Vim's built-in file type syntax highlighting for git commit messages trying to enforce a certain format for git messages. Your highlighting looks ugly because your git commit message is "ugly", in the sense that it does match the format Vim is expecting you to follow. Both the gitcommit.vim syntax highlighting module and the guidelines were written by Tim Pope. You can read them here: tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html. For a quick summary, make the first line a 50 character summary, leave a blank line, and then write your paragraphs below.
Jun
19
comment How to combine Bash's read with HERE-document when shopt -os errexit is in place?
See unix.stackexchange.com/q/13272/9537. What you want is read ... <<EOF || true not read ... || true <<EOF. The <<EOF is for the read not the true. I assume your actual code is a bit more complex than your toy example, because in this case assigning to the variable directly would be much simpler.
Jun
16
comment sudoers conditional/combo command is possible?
@AquariusPower "only-writeable by root" is not the same thing as "owned by root" and it is the former that matters.
Jun
14
comment Multiple XkbOptions in xorg.conf
It should be the first, commas with no spaces. Can you post the exact line you are having trouble with?