A big collection of Unix/Linux ‘find’ command examples

Linux/Unix FAQ: Can you share some Linux find command examples?

Sure. The Unix/Linux find command is very powerful. It can search the entire filesystem to find files and directories according to the search criteria you specify. Besides using the find command to locate files, you can also execute other Linux commands (grep, mv, rm, etc.) on the files and directories you find, which makes find extremely powerful. 

Drupal Console project

After being away from Drupal work for a long time, I just got back into it, and right away ran into a problem with Drupal 8 where, after migrating a Drupal 6 site to Drupal 8, I was unable to log into the new Drupal 8 website. I have no idea what the migration process set my user password to, but it wasn’t any of the ones I used on the old Drupal 6 website or on the new Drupal 8 website — probably because the migration process zapped my Drupal User 1 account.

Long story short, instead of using drush, I decided to use the Drupal Console project to reset the password, and it worked as advertised. After installing the Console project, just type drupal list | grep password to see the command to reset the password, and then use it. At the time of this writing the command is drupal user:password:reset. I have no idea if that will change in the future, but for now you can type that command and then respond to the prompts. You’ll need the User ID for the account that you want to modify, and you can get that by looking at the Drupal 8 users and users_field_data tables.

Use zgrep to grep a gzip (gz) file

Linux zgrep FAQ: How do I use the Linux zgrep command? (Or, How do I grep a GZ file?)

Linux users quickly learn how to use the Linux grep command on plain text files, but it takes a little longer to really you can grep gzip (gz) files as well. Here's how.

How to sort the Linux 'ps' command output by RAM

With this site hosted on a virtual server, I'm fighting quite a battle over memory use with the new LAMP architecture in place. As I try to learn more about which applications are using the most memory, I ran into this cool ps command last night that sorts the ps output by memory use, specifically by the rss field:

ps aux --sort:rss

Here's the important output from that command:

Linux `sort` command examples

Linux sort command FAQ: Can you share some examples of the Unix/Linux sort command?

As its name implies, the Unix/Linux sort command lets you sort text information. This article shares several examples of the Linux sort command.

Sorting ls command output

You can use the Linux sort command to sort all kinds of output from other commands. For instance, here's an example where I sort the output of the ls -al command:

grep reverse: how to reverse the meaning of a `grep` search


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.


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

What is the command to change my Glassfish admin password?

Question: What is the command to change my Glassfish admin (administrator) password?

Answer: You can change the Glassfish admin password with this asadmin command:

asadmin change-admin-password

The Glassfish master password

Note that you can also change the Glassfish master password with this command:

asadmin change-master-password


What is the command to start a Glassfish server?

Question: What is the command to start a Glassfish server?

Answer: I use the following command to start my Glassfish server:

asadmin start-domain domain1

Although this command refers to starting domain1, at least in my case, it also serves to start the entire Glassfish server. I don't know how this works for multiple domains, but my guess is that if you start any one of your domains, you will start up your Glassfish server.

A Glassfish command reference (cheat sheet)

Here's a copy of a Glassfish cheat sheet (reference page) that I always keep near me whenever I'm working with a Glassfish server. I like a lot of things about Glassfish, but trying to remember all of these commands for the Glassfish CLI is not one of my favorite things.

Here's my Glassfish command reference: