for example:
I hope to get names of all the files contains
start on startup
in /etc/init
.
for example:
I hope to get names of all the files contains
start on startup
in /etc/init
.
You could try the below grep command,
$ cd /etc/init
$ grep -l "start on startup" *
OR
Through a single command,
$ grep -l "start on startup" /etc/init/*
From man grep
,
-l, --files-with-matches print only names of FILEs containing matches
I believe the following should do the trick:
grep -ls 'start on startup' /etc/init/*
This will grep through all files in your /etc/init
directory and print out only the filenames while also omitting any errors (i.e. /etc/init/<dir_name> is a directory
).
Here is a post that explains the -l
option: grep-show-just-filenames
Here is another post that explains the -s
option: grep-omit-file/directory-errors