cut command | output management | Linux basic ( part 3 )

HackPeas Freelancers
2 min readJul 22, 2022

This blog is about the cut command, which can be used to cut the strings/lines/columns/rows from the output, files, input, etc

say you have a string bob@gmail.com;rahul@gmail.com;krishna@gmail.com and you want to separate all the emails then you can use the “cut -d” command to do so

$ echo “bob@gmail.com;rahul@gmail.com;krishna@gmail.com” | cut -d “;” 1 

OUTPUT: bob@gmail.com

$ echo “bob@gmail.com;rahul@gmail.com;krishna@gmail.com” | cut -d “;” 2 

OUTPUT: rahul@gmail.com

$ echo “bob@gmail.com;rahul@gmail.com;krishna@gmail.com” | cut -d “;” 3 

OUTPUT: krishna@gmail.com

say you want to print only the first n character of each line from the output on the Linux terminal then => add this at the end of the command => | cut -c-n

$ ls -lah | cut -c-10

say you want to print from character position from c1 to c2 of each line from the output on Linux terminal then => add this at the end of the command => | cut -c c1-c2

$ ls -lah | cut -c 14-22

If you like the blog, please give me a clap and follow me for more content.

For more CTFs and bug bounty writeup, or content related to ethical hacking, android penetration testing. follow me on:

Medium: https://hackpeas.medium.com

Youtube: https://www.youtube.com/channel/UC17W_Ircv7EmIIdbJeOQ_BQ
Instagram: https://www.instagram.com/hackpeas/
Linkedin: https://www.linkedin.com/in/viraj-vaishnav-19b0a61aa/
Twitter: https://twitter.com/VirajVaishnav16

Thank You..

--

--

HackPeas Freelancers

We provide the best technical services on a reasonable budget