Reputation
21,970
Next tag badge:
856/400 score
77/80 answers
Badges
3 49 79
Newest
 Good Answer
Impact
~887k people reached

Mar
27
comment How to make `find` output full absolute file names?
I'd advise quoting "$PWD" just in case.
Mar
27
comment How do I add network or user source connection data to history entries?
Sounds like process accounting may be useful. The shell history was never designed for logging, and if you do want to use it you have to trust all of your users. See related question on monitoring activity and a related answer.
Mar
27
comment Why did adding the Debian testing repository create so many package dependencies?
Is the version in backports still too old for your purposes?
Mar
23
comment Trying to set JAVA_HOME in ~/.bashrc
Getting the obvious question out of the way: have you restarted bash / reloaded the rc file since making the change?
Mar
23
comment Is it possible to reference the most recently modified file in a command line argument?
Even though file names ending in newlines are uncommon, it should be noted that command substitution strips trailing newlines, even when quoted.
Mar
23
comment permission reporting on sudoers
Do you mean sudo -l?
Mar
23
comment Correct textual name for <<
POSIX 2008 > Shell Command Language > Redirection > Here-Document
Mar
23
comment Grep_color on mac
Isn't GREP_COLOR deprecated? Anyways grep --color should highlight matches in the default color, without any need for environment variables.
Mar
22
comment Is it possible to reference the most recently modified file in a command line argument?
@user112553 Yes that is a good point. However, it would be trivial to convert the script into a function if the user so desired.
Mar
22
comment Adding a TeX macro to the beginning of a file using sed (why doesn't my method work?)
@ChrisDown Just saw this again. You are indeed correct about -i removing symlinks, although GNU sed provides the --follow-symlinks option for that case. Of course all of this is rendered moot by the more important point that sed -i is non-portable and should be avoided anyways.
Mar
22
comment Is it possible to reference the most recently modified file in a command line argument?
There is no way to do this with bash that is both simple and foolproof. I believe zsh can do this with the *(om[1]) glob.
Mar
22
comment What is the difference between : and true?
Related question about the purpose of the colon builtin.
Mar
20
comment How to rename multiple files by removing the extension?
Safer faster version: for i in ./*.tif; do mv -i "$i" "${i%.tif}"; done
Mar
20
comment Utility for sending HTML mail with attachments to a long list of emails?
@MichaelMrozek Indeed, the mutt wiki seems almost ashamed to admit it. Apparently it was a frequently requested feature though.
Mar
20
comment Utility for sending HTML mail with attachments to a long list of emails?
@MichaelMrozek Well ... built-in SMTP was added to recent 1.5.x versions of mutt.
Mar
13
comment Problem with vim when logged in as root
Some distros set up /usr/share/vim/vimrc as a symlink to /etc/vim/vimrc.
Mar
12
comment Bulk rename files with numbering
mv "$f" Image0"${f#Image4}" is a much faster and safer way to do this. The $( echo | sed ) approach, even if it works on filenames like Image401.jpg, is not very robust as it will mangle filenames containing odd characters or spaces, and is much slower because of the extra temporary subshell and processes created for every single file.
Mar
11
comment Character classes: construct my own
I don't know very much about this but you could probably accomplish this with a custom LC_CTYPE setting. It may require defining a custom locale.
Mar
8
comment Need help to make rows into column with awk or sed
@manatwork Thanks. The * is kept in for maximum portability.
Mar
8
comment Need help to make rows into column with awk or sed
@AlanFok What I meant was that the question that you posted has been answered. If that's not what you really wanted to ask, update the question. Don't expect people to read your mind or know what your system looks like.