1 / 10

Linux Essentials

isecur1ty training center Presented by : Eng. Mohammad Khreesha . Linux Essentials. Table of contents. Introduction head tail cat t ac more and less strings. Introduction.

hera
Download Presentation

Linux Essentials

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. isecur1ty training center Presented by : Eng. Mohammad Khreesha Linux Essentials

  2. Table of contents • Introduction • head • tail • cat • tac • more and less • strings

  3. Introduction • In this lesson we will look at the contents of text files with head, tail, cat, tac, more, less and strings.

  4. head • You can use head to display the first ten lines of a file. • head /etc/passwd • The head command can also display the first n lines of a file. • head -4 /etc/passwd • Head can also display the first n bytes. • head -c4 /etc/passwd

  5. tail • Similar to head, the tail command will display the last ten lines of a file. • tail /etc/services • You can give tail the number of lines you want to see. • Tail -3 /etc/services

  6. cat • The cat command is one of the most universal tools. All it does is copy standard input to standard output. • cat /etc/resolv.conf • cat is short for concatenate. One of the basic uses of cat is to concatenate files into a bigger file. • cat part1 part2 part3 • You can use cat to create flat text files. • cat > outfile.txt • cat can be used to copy files • cat file1.txt > file2.txt

  7. tac • The purpose of tacis the opposite of cat. • Example : • cat /etc/passwd • tac /etc/passwd

  8. more and less • The more command is useful for displaying files that take up more than one screen. • More will allow you to see the contents of the file page by page. Use the space bar to see the next page, or q to quit. • Some people prefer the less command to more.

  9. strings • With the strings command you can display readable ascii strings found in (binary) files. • strings is mainly useful for determining the contents of non-text files.   • Example: • strings /bin/ls

  10. The End 

More Related