Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash print nth line

sed 'NUMq;d' file
Comment

Print nth line bash

# Format, where n is the nth line
sed -n '0~Np'

# For example, to copy every 5th line of oldfile to newfile, do
sed -n '0~5p' oldfile > newfile

# would print lines 2, 7, 12, 17, 22, 27, …, up to the end of the file.
sed -n '2~5p' oldfile
Comment

PREVIOUS NEXT
Code Example
Shell :: laravel nginx 404 not found 
Shell :: neovim nvim plugins 
Shell :: Push existing folder 
Shell :: how to see map of branches in git 
Shell :: Failed to build logging Installing collected packages: logging Running setup.py install for logging ... error 
Shell :: how to fill text when create file in ubuntu 
Shell :: how to uninstall cpuonly from pytorch 
Shell :: brownie list networks 
Shell :: apache show connections 
Shell :: MultipleObjectsReturned: get() returned more than one Question -- it returned 3! 
Shell :: fullchain.pem privkey.pem 
Shell :: sort files in directory by size 
Shell :: grant user root permissions oracle linux 
Shell :: avd manger permission need root 
Shell :: convert x-ray dicom to png 
Shell :: deactivate login ubuntu server 
Shell :: mac terminal command suggestion history 
Shell :: platform cli 
Shell :: fast backup mac 
Shell :: install chco windows 
Shell :: stop raid array linux 
Shell :: git push command 
Shell :: find mtime rm 
Shell :: docker-compose: error while loading shared libraries: libz.so.1 
Shell :: creating splash screen for nativescript 
Shell :: shell basename 
Shell :: powershell show calendar 
Shell :: using scp with ssh with server credentials 
Shell :: install zeek on ubuntu 18.04 
Shell :: how to install python package without admin rights 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =