Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

print first lines of file linux

With the flag -n | N, the head command prints out the first N lines of file(s)

head -n 7 file.txt	#Prints first 7 lines of file.txt
Comment

linux get first line of file

# credit to Stack Overflow user in the source link

head -1 your_file
Comment

PREVIOUS NEXT
Code Example
Shell :: nvm install latest node and keep global packages 
Shell :: start apache service 
Shell :: rename branch git 
Shell :: express-generator ejs 
Shell :: ip config ubuntu 
Shell :: git lines per user 
Shell :: install package chart.js 
Shell :: uninstall gitlab-ee 
Shell :: save android studio home bash_profile 
Shell :: bash wait until file exists 
Shell :: git push rejected 
Shell :: reset one branch onto another 
Shell :: font manger for arch 
Shell :: install scrcpy linux 
Shell :: git ignore mode 
Shell :: install aws cli mac 
Shell :: install crossover in linux 
Shell :: list devices in network 
Shell :: revert back to a commit git 
Shell :: git checkout new branch with uncommitted changes 
Shell :: is not in the sudoers file 
Shell :: kill process on port 
Shell :: git replace with origin branch 
Shell :: count number of lines of code in git repo 
Shell :: reinstall chrome ubuntu 
Shell :: ubuntu export path 
Shell :: linux refresh .bashrc 
Shell :: bash move a list of files 
Shell :: start mariadb on linux terminal 
Shell :: “git force rebase abort” 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =