Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash return only first line that contains match

# Basic syntax:
grep -m 1 "pattern" input_file.txt
# Where -m is the maximum number of matching lines to return, i.e. stop
#	reading the file after m matches
# Note, this is more efficient than piping to head because there you
#	always read the whole file even if you're only looking for m matches
Comment

PREVIOUS NEXT
Code Example
Shell :: git not using ssh key 
Shell :: angular 
Shell :: git error: More than one value for the key user.name: 
Shell :: i forgot the wsl ubuntu root user password 
Shell :: echo aws profile 
Shell :: loopback install 
Shell :: node upgrade mac os x 
Shell :: how do you stop your ngrok tunnel 
Shell :: bash echo can create file 
Shell :: pip uninstall all packages 
Shell :: linux scp with password 
Shell :: shell hide tab 
Shell :: install CMake on fedora 
Shell :: convert to uppercase command awk 
Shell :: selinux disable 
Shell :: wsl windows 
Shell :: pop shell ubuntu 
Shell :: could not open file "postmaster.pid": No such file or directory 
Shell :: show fortigate uptime 
Shell :: git delete changes 
Shell :: bash calculate the mean of a column 
Shell :: bash time execution 
Shell :: make git project mine 
Shell :: force logrotate linux 
Shell :: npm inatall latest version ubuntu 
Shell :: bash copy files but exclude some directories 
Shell :: install packages from selected repo yum 
Shell :: get user password linux 
Shell :: unistall openshot ubuntu 20.04 
Shell :: git stash drop item by number 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =