> For the complete documentation index, see [llms.txt](https://davidtancredi.gitbook.io/pentesting-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidtancredi.gitbook.io/pentesting-notes/r3dcl1ff/cli-fu/head-tail-sed-cut.md).

# head tail sed cut

```
head    #to see the first lines of a file, by default it shows the first 10 lines

head /usr/bin/file.txt    

Should you need to visualize more lines, you can use -dash plus 
the number of lines, EG to view the first 20 lines:

head -20 /usr/bin/file.txt

tail    #visualize the last lines of a file, by default it shows the first 10 lines

tail  /usr/bin/file.txt    

tail  -20 /usr/bin/file.txt

sudo tail -f /usr/share/wordlists/dirb/big.txt #The -f flag continually updates the output 

Another convenient switch is -nX , which outputs the last “X” number of lines, 
instead of the default value of 10 ,check for the first 25 entries in the case below

sudo tail -n25 /usr/share/wordlists/dirb/big.txt


nl  #number of lines, to display a file by line number, useful for large files 

nl /usr/bin/file.txt 


wc   #word count 

wc file.xt 





```
