Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to print specific line from a file in bash

head -LINE_NUMBER file_name | tail +LINE_NUMBER
Comment

bash script to output a specific line of a file

/**
* A bash script to print at stdout line_number from file_name
* @line_number: the line number you want to print
* @file_name: the file you want to read from
*/

awk '{if(NR==line_number) print $0}' file_name
Comment

PREVIOUS NEXT
Code Example
Shell :: apt-key deprecated 
Shell :: find in file linux 
Shell :: kill localhost port 
Shell :: how to install gimp in ubuntu 
Shell :: npm websocket 
Shell :: roblox change leaderboard stats 
Shell :: how to install xdm ubuntu 20.04 
Shell :: Linux Mint reset xfce-panel 
Shell :: add component angular 
Shell :: install-nodejs-and-npm 
Shell :: shell script get arguments 
Shell :: install all dependencies npm 
Shell :: bash go to home directory 
Shell :: github activity graph 
Shell :: how to add the permission in the lampp in ubuntu 
Shell :: install gui centos 7 
Shell :: install rollup locally 
Shell :: install chromedriver linux 
Shell :: edit file terminal 
Shell :: install composer in ubantu 20 
Shell :: git clone with folder name 
Shell :: how to undo a commit sent that was pushed 
Shell :: nuget commandline 
Shell :: grep not multiple patterns 
Shell :: git: delete branch in local and on remote 
Shell :: powershell webrequest 
Shell :: how to docker login with gitlab 
Shell :: ram info unix 
Shell :: Microsoft.PowerShell_profile.ps1 
Shell :: youtube dl download linux 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =