Question: How Do You Cut a String Before a Specific Character in Unix?
Contents

How do you cut a string after a specific character in Unix?

7 Answers

  1. what if the original string had more than one : character? Like [email protected]:administrators:/home/some/directory/file . …
  2. @SopalajodeArrierez, The given command will just work. See (because the .* will match as much as possible: greedy) – falsetru Feb 21 ’15 at 7:05.

23 авг. 2013 г.

How do you cut a string in Unix?

To cut by character use the -c option. This selects the characters given to the -c option. This can be a list of comma separated numbers, a range of numbers or a single number.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest