Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash return last n characters from every line

# Basic syntax:
cat file.txt | rev | cut -c 1-3 | rev > output.txt
# Here we reverse each line, grab characters 1-3 (the last two 
#	characters of the original string), and then reverse the string again
Comment

PREVIOUS NEXT
Code Example
Shell :: linux my ip 
Shell :: set alias in powershell 
Shell :: github commit author name 
Shell :: increment variable bash 
Shell :: linux command for file size 
Shell :: linux document root 
Shell :: chmod +777 to all files in folder and subfolder 
Shell :: tar extract to folder 
Shell :: how to completely remove haproxy from ubuntu 
Shell :: jq to csv 
Shell :: join docker swarm 
Shell :: mysql query result to file 
Shell :: command to undo in emacs 
Shell :: kill wine process 
Shell :: How to remove a snap package on Ubuntu 
Shell :: present working directory in shell script 
Shell :: install oh my zsh M1 
Shell :: push to multiple remotes git 
Shell :: sed delete between two patterns 
Shell :: Install ansible in alpine linux 
Shell :: apply gitignore after commit 
Shell :: install rsync 
Shell :: install aws cli on ubuntu 
Shell :: rsync only new files 
Shell :: linux move folder and subfolders to parent 
Shell :: fish add rust to path 
Shell :: powershell get all file extensions in directory 
Shell :: powershell get all applications installed 
Shell :: how to add .env to gitignore 
Shell :: microsoft todo for linux 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =