Try
grep -f the_ids.txt huge.csv
Additionally, since your patterns seem to be fixed strings, supplying the -F
option might speed up grep
.
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is specified by
POSIX.)
Related Contents:
- Using grep and sed to find and replace a string
- List file names based on a filename pattern and file content?
- How to grep exact literal string (no regex)
- GROUP BY/SUM from shell
- How can I set the grep after context to be “until the next blank line”?
- Given two directory trees, how can I find out which files differ by content? [closed]
- How to ‘grep’ a continuous stream?
- How to run a shell script on a Unix console or Mac terminal?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Aborting a shell script if any command returns a non-zero value
- Linux: copy and create destination dir if it does not exist
- How can I assign a name for a screen? [closed]
- How can I format my grep output to show line numbers at the end of the line, and also the hit count?
- grep without showing path/file:line
- How to grep a string in a directory and all its subdirectories? [duplicate]
- Command to change the default home directory of a user [closed]
- How to concatenate multiple lines of output to one line?
- Add up a column of numbers at the Unix shell
- How to send data to local clipboard from a remote SSH session
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- Get exit code of a background process
- Save modifications in place with awk
- How to print third column to last column?
- Get specific line from text file using just shell script
- Forcing bash to expand variables in a string loaded from a file
- Linux/Unix command to determine if process is running?
- Use find command but exclude files in two directories
- Insert multiple lines into a file after specified pattern using shell script
- How to find file accessed/created just few minutes ago
- What does ‘set -e’ do, and why might it be considered dangerous?
- Can I call pushd/popd and prevent it printing the stack?
- Make ls print it all on one line (like in terminal)
- How can I list the files in a zip archive without decompressing it?
- Recursively cat all the files into single file
- How to read a .properties file which contains keys that have a period character using Shell script
- Create a dedicated folder for every zip files in a directory and extract zip files
- Randomly Pick Lines From a File Without Slurping It With Unix
- Using Bash Script to Find Line Number of String in File
- Pass parameter to an awk script file
- How to list specific type of files in recursive directories in shell?
- How can I get awk to print without white space?
- How to sort the output of “grep -l” chronologically by newest modification date last?
- Replace spaces with underscores via BASH
- Reverse sort order of a multicolumn file in BASH
- Batch renaming files in command line and Xargs
- How can I trim white space from a variable in awk?
- Check if a condition is false
- cat file with no line wrap
- How to use grep efficiently?
- Unix command to escape spaces