QuestionQ12Verified/Essential CommandsCopy linkReport a problemAsk AstroTutorSave questionWhich grep command prints only the lines in the file foo that do not end with a /?Agrep '/$' fooBgrep '/#' fooCgrep -v '/$' fooDgrep -v '/#' fooShow AnswerAnswerExplanationThe pattern /$ matches a slash at the end of a line, and grep -v reverses the selection so that only nonmatching lines are printed.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion