Category: UNIX
-
UNIX tip of the day: readlink
Today I found myself using the readlink command, and it occurred to me that many people might not be aware of it. Here is what the man page says it does readlink – print resolved symbolic links or canonical file names If you work on shared filesystems with other people, such as on a large…
-
UNIX tip of the day: pushd
I am frequently surprised by the number of colleagues I have who do not know about the BASH builtins pushd and popd. I myself remember seeing them for the first time in a script about 10 years ago, and had to look up the commands. At first I didn’t quite understand the point, but now…
-
UNIX Tip of the day: Strange behavior editing PHP files with vim
I have been struggling with this weird behavior in vim for the last month or so. I just re-joined Automattic in September. I have been using vim on many different computers and environments (linux, max, cygwin) for over 15 years, and I have never experienced this before. I only seem to have this issue when…
-
UNIX tip of the day —
duplicate and replace lines with awkToday I got some data I wanted to add to my machine learning training datasets for named entity recognition. My system is designed to be used with output from automatic speech recognition (ASR). It is frequently difficult to be certain whether ASR output will contain hyphens or not, e.g. (email, vs e-mail) so frequently I…
-
UNIX tip of the day – grep -P is slow
Unless you really need some advanced regular expressions only supported by PCRE, using POSIX regular expressions with grep is usually an order of magnitude faster – that’s because the default engine with grep uses finite automata, as opposed to a backtracking algorithm which PCRE uses ( the main featuress you gain from the backtracking algorithm…