Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux remove last line from file

sed '$d' <file>
sed -i '$d' <file> # to edit in place
Comment

linux remove last n lines from file

#remove last 80 lines from cars.csv
head -n -80 cars.csv > tmp.csv && mv tmp.csv cars.csv
Comment

PREVIOUS NEXT
Code Example
Shell :: create a virtual environment python 3.8 
Shell :: linux unzip tar.gz 
Shell :: git difftool meld 
Shell :: adding remote origin git 
Shell :: give permission to user in ubuntu 
Shell :: git push origin master 
Shell :: snap install package 
Shell :: How to Get VS Code Extensions as .ps1 for Installing to Another Computer 
Shell :: install plasma kde manjaro 
Shell :: fetching a forked branch 
Shell :: powershell get all applications installed 
Shell :: git add tag 
Shell :: how to go to a folder in git bash 
Shell :: ubuntu power saving 
Shell :: bash split string to array 
Shell :: git find out commit for tag 
Shell :: github readme stats 
Shell :: bash for loop string 
Shell :: open pdf command line linux 
Shell :: shell script while loop example 
Shell :: git remove file from gitignore 
Shell :: linux how to undeo ctrl+z 
Shell :: src refspec main does not match any 
Shell :: get newest version of original in own fork 
Shell :: how to uninstall all powershell modules 
Shell :: take input from user windows shell 
Shell :: install grafana 
Shell :: ngrok download authtoken 
Shell :: github get parent branch 
Shell :: bash sh: line [: too many arguments 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =