Skip to content

Commit

Permalink
Add 'selln' function
Browse files Browse the repository at this point in the history
Select a range of a file by line numbers... can be useful when
extracting a part of a file and then piping to hastebin, clipboard, etc.
  • Loading branch information
Pinjasaur committed Dec 1, 2017
1 parent 18ab4a2 commit dfd6827
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .functions
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ tre() {
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
}

# Select a range of a file by line number
selln() {
sed -n "${1},${2}p" "${3}"
}

# Determine size of a file or total size of a directory
# Source: https://github.com/mathiasbynens/dotfiles
fs() {
Expand Down

0 comments on commit dfd6827

Please sign in to comment.