Author Archives: Ahmed Tawfik

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek

Highlight your grep results

Used grep command before ?grep is a very good command that allows you to grep text πŸ™‚It allows you to search the contents of a file/group of files for a string (regular expression) of course it is great, but the … Continue reading →

Tagged | Leave a comment

Print the exact contents for a file

If you want to print the exact contents of a file (the white spaces, the new lines), use this command: more file_name | od -c

Tagged , | Leave a comment

Count number of lines in a text file

wc -l file_name

Tagged , | Leave a comment

Extract Lines From a Text File

“sed -n 2,4p file_name” extracts lines from 2 to 4 from that file

Tagged , | Leave a comment

How to compress using bzip2 without deleting the original file

bzip2 deletes the original file and replaces it by the compressed one, and to stop it from doing that use the “-k” option as follows: “bzip2 -k file_name“

Tagged | Leave a comment