Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

30 total results found

How do I extract certain columns from a text file in Unix?

MacOS, Windows, and Linux Linux and Unix

Somehow I can never remember the cut command in Unix. But I occasionally want to remove certain columns from a text file of data. cut will do that.DelimitedHere is a simple tab-delimited example. (Use the -d option to set a different column delimiter.)Data Fil...

columns
Unix

Awk Explained

MacOS, Windows, and Linux Linux and Unix

Awk is a Unix tool that can be very useful for dealing with text but can be hard to understand. Here are some useful explanations. awk is a beautiful tool Famous Awk One-Liners Explained, Part I 8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, NR, NF, FIL...

Linux
tutorials
Unix

combining unix stderr output with stdout

MacOS, Windows, and Linux Linux and Unix

The problem is that when I run script x and redirect it to a file, all of the error messages come to the screen when I want them to also go to that file.With bash shell, use:program > outputfile 2>&1My colleague found this for me in the book Unix Pow...

Unix

diff and patch

MacOS, Windows, and Linux Linux and Unix

The Ten Minute Guide to diff and patch Using diff and patch

tutorials
Unix

avoiding increasing indents while pasting into vi

MacOS, Windows, and Linux Linux and Unix

When pasting text into a vi editing screen, sometimes you’ll get each line increasingly indented like this.aaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb ccccccccccccccccccUse this command to change the “paste” setting. Then change it back when you’re done.:set paste:...

Vi
Unix

Unix grep, find and maxdepth

MacOS, Windows, and Linux Linux and Unix

I’m writing this so I can find it next time I want to do this, and so my student programmers can more easily compare config settings across test sites.Problem: Find a particular line quickly in a file in 7 different directories. In this case, it’s a Moodle co...

Moodle
searching
Unix

15 Basic ‘ls’ Command Examples in Linux

MacOS, Windows, and Linux Linux and Unix

I learned at least three things from this list, and I’ve been using ls for years.15 Basic ‘ls’ Command Examples in LinuxThe new things for me were: ls -lh – human readable format on file sizes ls -ltr – reverse output order, which is particularly useful when s...

Linux
ls
OS X
Unix

cron job examples

MacOS, Windows, and Linux Linux and Unix

Here are some interesting examples of cron job use. http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/ – I didn’t know about @monthly, @yearly, and @reboot, or changing the MAIL destination setting. http://www.pantz.org/software/cron/croninfo.h...

Linux
Unix

Linux performance analysis in 60 seconds

MacOS, Windows, and Linux Linux and Unix

Here’s an intro to understanding what’s going on with a Linux server, quickly.http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.htmlIf anyone has others, please post them here.

Linux
sysadmin
Unix

Regular Expressions

Programming and Web Development

Regular Expressions are how you match text and patterns of text in a programming language, and once you learn it, it’s useful in many languages. Regular Expression Cheat Sheet RegExr is an online tool to learn, build, & test Regular Expressions CROSSWORDS ...

Linux
programming
regex
Unix

grep tricks

MacOS, Windows, and Linux Linux and Unix

I’ve been using grep (Global Regular Expression Print) to search files on Unix for years and never knew you could have it appear in color. And here are some other interesting articles about grep. http://unstableme.blogspot.com/2009/03/highlight-match-with-col...

Unix
Linux
OS X

Apache log shell scripts

Programming and Web Development

Return count of timestamps with most error logs. A couple years ago an app error_log reported about 16000 errors within a few seconds. After fixing it, we wanted to sort by number of errors per second. This does that. The first column is the count. cat /logs...

apache
Unix
Linux