Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98ef51a

Browse files
added some more short-cuts
1 parent 296c908 commit 98ef51a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.bash_aliases

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ a c='clear'
44
a p='pwd'
55
a e='exit'
66
a q='exit'
7+
78
a h='history | tail -20'
9+
# turn off history, use 'set -o history' to turn it on again
10+
a so='set +o history'
811

912
a b1='cd ../'
1013
a b2='cd ../../'
@@ -27,6 +30,11 @@ a s='du -sh * | sort -h'
2730
# save last command from history to a file
2831
# tip, add a comment to end of command before saving, ex: ls --color=auto # colored ls output
2932
a sl='fc -ln -1 | sed "s/^\s*//" >> ~/.saved_commands.txt'
33+
# short-cut to grep that file
34+
a slg='< ~/.command_examples.txt grep'
35+
36+
# change ascii alphabets to unicode bold characters
37+
a ascii2bold="perl -Mopen=locale -Mutf8 -pe 'tr/a-zA-Z/𝗮-𝘇𝗔-𝗭/'"
3038

3139
### functions
3240
# 'command help' for command name and single option - ex: ch ls -A
@@ -42,5 +50,5 @@ ap() { for f in "$@"; do echo "$PWD/$f"; done; }
4250
o() { gnome-open "$@" &> /dev/null ; }
4351

4452
# if unix2dos and dos2unix commands aren't available by default
45-
unix2dos() { perl -i -pe 's|\n|\r\n|' "$@" ; }
46-
dos2unix() { perl -i -pe 's|\r\n|\n|' "$@" ; }
53+
unix2dos() { sed -i 's/$/\r/' "$@" ; }
54+
dos2unix() { sed -i 's/\r$//' "$@" ; }

0 commit comments

Comments
 (0)