Categories
Linux Solutions

Changing The Frequency Of StartUp Disk Checks On Linux

Opened hard drive with top magnet removed, sho...
Image via Wikipedia

Linux systems commonly run on ext2/ext3/ext4 file systems. These file-systems have a built-in feature to tell the operating system to do a disk check while booting up if the number of times the disk has been mounted exceeds a certain number. Most commonly the count is set to 30.

This is an inconvenience to anyone who regularly switches off the system, its even worse if the hard disk sizes reach 1Tb. So changing the number to suit your preference might be an excellent idea.


Changing the maximum mount count:

sudo tune2fs -c 50 /dev/sda1

Here:
tune2fs is the command that allows modification on the disk flags
-c enables the max mount count to be changed to the next parameter(50 in this case)
/dev/sda1 is the partition on which to do the operation

Changing the maximum time count:

sudo tune2fs -i 30d /dev/sda1

Here:
tune2fs is the command that allows modification on the disk flags
-i enables the max time count to be changed to the next parameter(30d in this case means the consecutive checks are scheduled 30 days apart). This parameter can be also give in terms of months(2m for 2 months) and weeks(3w for 3 weeks)
/dev/sda1 is the partition on which to do the operation

Enhanced by Zemanta



Categories
Linux Open Source Ubuntu Web

Setting Up Simple Dropbox Integration with Ubuntu

Image representing Dropbox as depicted in Crun...
Image via CrunchBase

The default installer of Dropbox for Ubuntu works with the Nautilus file manager. But this integration is not always desireable, below is a method to install Dropbox on your Ubuntu box without installing Nautilus.

Categories
Linux

Search for Multiple Strings in Linux Command Line

Update (2026): This guide has been updated with modern Linux CLI tools, performance optimizations, and common terminal patterns for searching multiple strings seamlessly.

Searching for multiple strings inside text files or terminal streams is an absolute staple of system administration, DevOps, and backend software engineering. While traditional Linux systems offer classic tools like grep, modern environments also benefit from blazing-fast alternatives like ripgrep (rg).

In this practical guide, we will break down the most effective ways to look for multiple search terms simultaneously.

1. Using grep with the OR Operator (Traditional Way)

The classic way to search for multiple strings using standard grep requires escaping the pipe | operator. This acts as a logical OR.

Bash

# General syntax
grep 'string1\|string2\|string3' filename.txt

# Example: Searching a log file for errors or warnings
grep 'ERROR\|WARNING\|CRITICAL' server.log

2. Using Extended Grep (grep -E or egrep)

To avoid messy backslash escapes, you can switch to Extended Regular Expressions by appending the -E flag (or using egrep). This makes your syntax remarkably cleaner.

Bash

# Using grep -E
grep -E 'string1|string2|string3' filename.txt

# Example: Searching for different modern framework instances
grep -E 'react|vue|angular' package.json

3. Using Multiple -e Flags

If you prefer explicit declaration or want to cleanly build your search strings dynamically using terminal scripts, you can pass multiple individual -e patterns.

Bash

# Using explicit flag pairs
grep -e 'string1' -e 'string2' filename.txt

4. The Modern Standard: Using ripgrep (rg)

If you work on modern microservices or large codebases, standard grep can feel slow. ripgrep is a modern alternative written in Rust that respects .gitignore files out of the box and matches strings using regex syntax seamlessly.

Bash

# Simple alternation using ripgrep
rg 'string1|string2' filename.txt

Quick Commands Cheat Sheet

ToolCommand PatternBest Used For
grep -Egrep -E 'A|B'Built-in compatibility across all POSIX servers
grep -egrep -e 'A' -e 'B'Scripting & automated parsing loops
ripgreprg 'A|B'Blazing-fast searches across massive repositories

Frequently Asked Questions (FAQs)

How do I search for multiple strings across all files in a directory?

You can combine the extended regex flag -E with the recursive flag -r. For example: grep -Er 'string1|string2' /path/to/directory/

How can I make the multiple string search case-insensitive?

Simply append the -i flag to your command. This tells grep to match both uppercase and lowercase variations of your keywords: grep -Ei ‘error|warning’ server.log

How do I count the total occurrences of multiple search terms?

Add the -c flag to get a specific count of matching lines, or pipe the output to wc -l: grep -E ‘string1|string2’ filename.txt | wc -l

Can I search for lines containing ALL keywords instead of ANY (Logical AND)?

Yes, but instead of using a pipe inside a single pattern, you chain multiple grep commands together via standard Unix piping: grep ‘string1’ filename.txt | grep ‘string2’

Categories
Open Source Web

JDownloader – Download Files From File Sharing Sites At Will…

JDownloader (How to)
Image by .::E1ement2048::. via Flickr

JDownloader is a free java-based program that completely automates the process of downloading files from popular file sharing sites like Rapidshare, Megaupload ect…

The problem with most file sharing sites is that the free accounts have a limit on the amount to data you can download and additionally it requires you to wait for a certain period of time before downloading the files. JDownloader is a beautiful application that automates the process making it possible for you to schedule downloads and even queue files to be downloaded.

JDownloader works on Windows/Mac/Linux and is simple to get started with.
So if you like to download a lot of files from file sharing sites then give JDownloader a try…

Reblog this post [with Zemanta]
Categories
Solutions Ubuntu Web

Getting Multimedia Working on Ubuntu

Ubuntu wordmark official
Image via Wikipedia

If you are a newbie Ubuntu user then in all probability you have struggled to get the system setup to listen to your favorite music, watch your favorite movies and browse your favorite sites(video and flash).

Is there a quick simple way to fix these problems in one go? Yes there is 🙂

All you need to do is to install the Restricted Extras package for your distro and you are set to go.

For (K/X)Ubuntu 9.04 (Jaunty Jackalope) and 9.10 (Karmic Koala)

Based on your derivative of Ubuntu, install one of these packages:

(K/X)Ubuntu 9.04, 8.10, 8.04

  • Go to your system’s Application installer
  • Search for the package ubuntu-restricted-extras(Ubuntu), xubuntu-restricted-extras (Xubuntu) and kubuntu-restricted-extras (Kubuntu) and install it.

Or Alternatively open the Terminal, and execute the following command:

sudo apt-get install ubuntu-restricted-extras

Reblog this post [with Zemanta]