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 :: bash check for substring in string 
Shell :: httpd ssl docker 
Shell :: bash run a command every x second 
Shell :: how to save windows lock screen images 
Shell :: pip install bootstrap 
Shell :: Remove all your local git branches but keep master 
Shell :: *** WARNING : deprecated key derivation used 
Shell :: bash script language check if item in array 
Shell :: install opencv 
Shell :: .gitignore is not ignoring directories 
Shell :: nginx file permission 
Shell :: powershell check if user is admin 
Shell :: bash rename file 
Shell :: gitbash shortcut to clear the terminal 
Shell :: push a new branch 
Shell :: anconda install django 
Shell :: shell function example 
Shell :: how to install docker on Debian 10 
Shell :: get files changed in branch 
Shell :: bash float division 
Shell :: linux find string in files in path 
Shell :: rm directory ubuntu 
Shell :: git resolve conflict using theirs 
Shell :: dockerfile default workdir 
Shell :: install apollo server 
Shell :: push local branch to remote 
Shell :: a) Write a shell script to list all of the directory files in a directory. 
Shell :: soundcloud for ubuntu install command 
Shell :: Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. 
Shell :: how to remove git from a project 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =