linux-unix

recent posts related to linux and unix

teleport - the Linux cd command, improved

I've created a new command which I believe is an improvement to the normal Linux/Unix cd command, and I thought I'd share it here.

How to use Linux command line mail to email a file

If you're ever working on a Unix or Linux system, and need to email a file to someone else, it may be helpful to know that you can send your email message right from the Unix command line. You don't need to hop into mutt or any other Unix or Linux mail client to email the file.

Use zgrep to grep a gzip (gz) file

Problem

You want to grep a text file that has been compressed with gzip. You typically use the following steps to grep a gzip'd file, but you know there must be a better way:

A Linux crontab mail command example

Here's the source code for a really simple Linux mail script that I used to send an email message to one of my co-workers every month. This script used the Unix or Linux mail command to email a file to her that showed a list of all the websites on our server that she needed to bill our customers for.

Here's the source code for this simple Linux mail shell script:

Free Unix/Linux and vi/vim cheat sheets

I created some "cheat sheets" (reference pages) for a recent Unix and Linux training class. One is a "Unix and Linux commands cheat sheet", and the other is a "vi/vim editor cheat sheet". I'll be sharing the entire "Introduction to Unix" training PDF here shortly, but in the meantime, here are the links to the Unix/Linux and vi/vim cheats:

Linux "crontab every" examples

I've posted other Unix and Linux crontab tutorials here before (How to edit your Linux crontab file, Example Linux crontab file format), but I've never included a tutorial that covers the "crontab every" options, as in how to run a crontab command every minute, or every hour, or every day.

To that end, here are some quick "crontab every" example entries that show the syntax for these crontab commands.

How to sort Linux ls command file output

A couple of days ago I was asked how to sort the output from the Unix and Linux ls command. Off the top of my head I knew how to sort the ls output by file modification time, and also knew how to sort ls with the Linux sort command, but I didn't realize there were other cool file sorting options available until I looked them up.

In this short tutorial I'll demonstrate the Unix/Linux ls command file sorting options I just learned.

Linux process memory usage - how to sort the ps command

A lot of times when we need to look at Unix or Linux process information (like memory or cpu usage) we just issue some variation of the Linux ps command, like this:

ps auxww

or this:

The Linux top command

Unix and Linux systems include a nice interactive utility for looking at process information. The Linux top command displays a character-based screen of all processes running on the current system. The screen updates itself every few seconds, and you can sort the screen contents by characteristics like CPU Usage or Memory Use.

In this tutorial we'll take a look at the most common uses of the top command, including showing how to sort the output by CPU and memory use, and change the top command display.

The Unix and Linux ps command

The basic ps command

The Linux ps command by itself only shows minimal information about the processes you are currently running. If you issue the basic command like this without any arguments:

ps

you'll see output from this command looks something like this:

Syndicate content