Bash equivalent for SQL "1.%"

Juan Jor Orellana

I'm aware than whenever I want to filter columns or... basically anything in a SQL query, i can use something like

Select * from table1 where name1 like "Mr.%"

This part

like "Mr.%"

Should grab any row in which the var name1 starts with "Mr." no matter what else is after it.

My question: Is there an equivalent for it in bash? anything to go with grep, maybe?

Karl Nicoll

You can do it with grep easily:

For a file:

grep '^Mr\.' myfile.txt

For command output:

my-command-with-output | grep '^Mr\.'

EDIT: Adding an example with your example text file string:

grep '^1' myfile.txt

The example above will find any lines with starting with the number 1.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

zsh and POSIX equivalent of bash's `{var}>&1`

From Dev

fetch equivalent to limit 1 in sql statment?

From Dev

Is there an equivalent to sysdate-1/24 in SQL server?

From Dev

sql select group by a having count(1) > 1 equivalent in python pandas?

From Dev

sql equivalent to "grep x | head -n1"

From Dev

Equivalent of SQL Server HASHBYTES('sha1', @userpwd ) in C#

From Dev

The equivalent of cmd "for" in bash?

From Dev

Bash FUNCNAME equivalent in Dash

From Dev

Is there an equivalent to vimtutor for bash?

From Dev

Bash " * " equivalent in windows?

From Dev

Powershell equivalent to $_ in bash

From Dev

Equivalent to /*.txt of bash in python

From Dev

Is `*/1 * * * *` and `* * * * *` equivalent in CRON?

From Dev

Equivalent of (IntPtr)1 in VBNET?

From Dev

kill %1 equivalent in fish

From Dev

bash equivalent for os.walk?

From Dev

Fish equivalent of bash $(command) notation

From Dev

What is the POSIX shell equivalent of bash <<<

From Dev

Python equivalent to Bash comand "echo"?

From Dev

Equivalent of select() system call in Bash

From Dev

Batch equivalent for bash with mac terminal

From Dev

Is there an equivalent to bash's "nocaseglob" in ksh?

From Dev

What is the bash equivalent of the where cmdlet?

From Dev

linux/bash equivalent of mv -t

From Dev

Is there a bash equivalent to a PowerShell pipeline object?

From Dev

macOS/bash equivalent of mv -t

From Dev

Is there a Fish equivalent to "bash --rcfile ~/.bashrc"

From Dev

Equivalent for SQL WITH RECURSIVE in Arel

From Dev

Pandas equivalent to SQL where