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

bash delete the last line of a file

# Basic syntax:
sed -i '$d' input_file

# Note, -i means that the input_file will be modified in place
Comment

PREVIOUS NEXT
Code Example
Shell :: how to restart postgresql ubuntu 
Shell :: git pull upstream 
Shell :: bootstrap 5 react npm 
Shell :: monitor mode wifi kali 
Shell :: git name repository 
Shell :: linux list adb 
Shell :: ansible become sudo pawwsord 
Shell :: adb get imei number 
Shell :: root kali login 
Shell :: install supervisor ubuntu 20.04 
Shell :: linux history with time 
Shell :: video to gif ffmpeg 
Shell :: where to check elastic beanstalk logs 
Shell :: how to debug wirelessly android 
Shell :: search for files in linux terminal 
Shell :: Install docker with apt command 
Shell :: intall mondg brew 
Shell :: create a zip file in linux 
Shell :: how to open chrome on linux mac 
Shell :: node-pre-gyp install failed with error: error: command failed: node-pre-gyp install --fallback-to-build 
Shell :: how to update metasploit 
Shell :: ubuntu zip 
Shell :: linux kill process by pid 
Shell :: minikube without sudo 
Shell :: gzip folder .gz file in linux 
Shell :: como instalar paquetes tar.gz en ubuntu 
Shell :: how to stop docker 
Shell :: powershell append file to another file 
Shell :: how to get remote origin url 
Shell :: flutter web setup 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =