Created
September 14, 2016 15:05
-
-
Save theJian/1aa18793b61378857aac79e7ae3f4116 to your computer and use it in GitHub Desktop.
bash tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# last command | |
!! | |
# last command beginning with xyz | |
!xyz | |
# print rather than excuting last command | |
!!:p | |
# the end of previous command | |
!$ | |
# All of the arguments of the previous command | |
!* | |
# fix typo | |
mroe filename # wrong | |
^ro^or # trun into more filename | |
^error^correction | |
# brace expression | |
touch a{1,2,3}b # touch a1b a2b a3b | |
# Remove a trailing file name component, leaving only the head. | |
:h | |
# Remove all leading file name components, leaving the tail. | |
:t | |
# Remove a trailing suffix of the form .xxx, leaving the basename. | |
:r | |
# Remove all but the trailing suffix. | |
:e | |
# Substitution | |
:s | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment