#head #tail #bash #terminal #basic #command #linux
In linux, getting a portion of a text from a Input file is Very common and to perform such operation we have two command i.e. head and tail command
As their name implies , head command is use to get the first part of the file , while the tail command is use to get the last part of the file
----------------------------------------------------
Intro-(0:00)
explanation-(0:16)
head-(1:10)
tail-(5:05)
endscreen-(10:55)
-----------------------------------------------------
▶️head [first part]
To get default output : head textfile
to get first n specified line : head -n9 textfile [first 9 lines will be printed]
to get all lines except last x lines : head -n-x [x can be any const. 1,2,3]
to get first c specified character : head -c7 [print first 7 character]
to get output from multiple files : head file file2 [will print fisrt default no. of lines from 1st file as well as 2nd file]
----------------------------------------------------------------
▶️tail [last [part]
To get default output : tail textfile
to get last n specified line : tail -n9 textfile [last 9 lines will be printed]
to get the lines starting from x till last : head -n+x [x can be any const. 1,2,3]
to get last c specified character : head -c7 [print last 7 character]
to get output from multiple files : tail file file2 [will print last default no. of lines from 1st file as well as 2nd file]
to get output from files that are currently changing : tail -f filename
------------------------------------------------------------------
scripts used
1. to create a file of 100 lines consisting from 1 to 100 digits used in video : https://github.com/shazx06/youtube/bl...
2. to create a script to apped the content to the end of the file file used in the video :https://github.com/shazx06/youtube/bl...
-----------------------------------------------------
▶️Basic commands in Linux Part 1 : • Basic commands in Linux - Part 1 | li...
▶️Basic commands in Linux part 3 : • Basic commands in Linux - Part 2 | li...
----------------------------------------------------------------------------------------------------
🤖Join our discord server : https://discord.io/thedataguy
---------------------------------------------------------------------------------------------------
Follow shazib on :
✅GitHub (https://github.com/shazx06)
✅Linked In ( / md-shazib
...)
📌I'm DeTeam Content Creator. If you would like to join our community to grow your channel or just have a chat with us then use this link: https://invite.gg/DeTeam
––––––––––––––––––––––––––––––
Fragments by Nomyn / nomyn
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: http://bit.ly/l-fragments
Music promoted by Audio Library • Fragments – Nomyn (No Copyright Music)
––––––––––––––––––––––––––––––
🎵 Track Info:
Title: Fragments by Nomyn
Genre and Mood: Ambient + Calm
———
Watch video How to use the head and tail commands | Linux commands Part 5 online without registration, duration hours minute second in high quality. This video was added by user The Data Guy 11 December 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 133 once and liked it 10 people.