solaris

Linux find command - reverse the meaning of a file search

Summary: How to reverse the meaning of a Linux find command.

I spent last night doing a bunch of work on my source code warehouse. At the end of the night I needed to do a search for all files in many subdirectories whose filenames did not end with "*.java". It's easy enough to find filenames that do end with "*.java", using the find command like this:

vi/vim arrow keys

vi/vim FAQ: Help, I'm on an older Unix system; what are the vi/vim arrow keys?

On older Unix systems, including HP-UX and other systems I've run across recently, you may not have access to the vim editor, and may just have access to the older vi editor. In that case the arrow keys on your keyboard may not work, and you'll have to use the "simulated" vi arrow keys on your keyboard to move up, down, left, and right. These vi arrow keys are:

Oracle's plans for Sun technologies: Java, MySQL, SPARC, Solaris, Sun Cloud, and OpenSSO

Here's a brief look at several news stories related to Oracle's purchase of Sun, along with direct links to Oracle documents detailing their plans for Sun technologies like Java and MySQL on the Oracle website.

Oracle plans for Java

Looking at various Oracle/Sun news stories, it looks like Java is safe for the time being. As one reporter at ZDNet says it, Oracle's Java strategy is 'business as usual'".

A Linux mail command tip

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.

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.

How to use multiple filename search patterns with Linux find

Linux find FAQ: How do I use the Linux find command to find multiple filename extensions (patterns) with one find command?

Problem

You want to use the Unix/Linux find command to search for multiple filename types (or patterns). You know you can run the find command several times, one for each filename extension you're looking for, but there must be a way to search for multiple filenames at one time.

Linux find - How to search multiple directories with find

Problem: You need to use the Unix/Linux find command to search multiple folders. Specifically, you'd like to search several folders beneath your current location, but not all folders.

For example, your current directory may have 20 subdirectories, and you don't want to search them all like this:

find . -name "*.java"

or this:

grep reverse - how to reverse the meaning of a grep search

Problem

You need to reverse the meaning of a search you're performing with the grep command. For instance, you've been searching for pepperoni pizza orders like this:

grep pepperoni pizza-orders.txt

and now you need to find all orders that don't have pepperoni.

Solution

Just add the -v switch to your grep search command, like this:

A Unix shell script to rename many files at one time

Summary: A Unix/Linux shell script that can be used to rename multiple files (many files) with one shell script command.

Problem

You're on a Mac OS X, Unix, or Linux system, and you'd like to be able to rename a large number of files at once. In particular, you'd like to be able to change the extensions of a large number of files, such as from *.JPG to *.jpg (changing the case of each file extension from upper case to lower case).

Linux chmod - how to make a Perl script executable

Linux chmod FAQ: Can you share an example of how to make a shell script executable with the Unix/Linux chmod command?

A lot of times in the web world you're given a Perl script by someone, and they say, "Put this script on your server, make it executable, and yada yada yada." Skipping the yada-yada part, some times people gloss over the "Make this file executable" part. So, here's a quick lesson of how to use the Linux chmod command to make a Perl script (or any Unix file) executable.

Syndicate content