Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux remove last line from file

sed '$d' <file>
sed -i '$d' <file> # to edit in place
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 :: git config global credential cache 
Shell :: push to docker hub 
Shell :: git new branch from current 
Shell :: linux encrypt pdf 
Shell :: -eq shell script 
Shell :: decrease journalctl size 
Shell :: your system lacks libtoolize 
Shell :: perl install Switch 
Shell :: Git Error: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
Shell :: pull from dev branch to master 
Shell :: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ 
Shell :: make error readline/readline.h 
Shell :: Endpoint Security VPN build 986000724 is already installed on this computer. 
Shell :: docker compose up from another file 
Shell :: create github repo with bash 
Shell :: list hdfs running linux 
Shell :: create ssh key github 
Shell :: node install specific version 
Shell :: linux guzzlehttp/psr7 
Shell :: boucle bash 
Shell :: linux "Error: Timeout was reached" 
Shell :: linux recursive find file content 
Shell :: change user of a directory in linux 
Shell :: github update personal access token 
Shell :: xrandr configure crtc 2 failed ubuntu 
Shell :: how to install phpunit 
Shell :: ocoaPods not installed or not in valid state. 
Shell :: neofetch in linux 
Shell :: how to reinstall alsa 
Shell :: jq select by field 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =