Show me your terminal tricks, scripts and aliases.
Show me your terminal tricks, scripts and aliases
...
You need imagemagik for convert
>Julia
>gurls lol
such kawaii tricks ^u^
what's the thing for "arguments of the last command I ran"?
it's !*
here's a fun one
opens an $EDITOR for the current command you're typing
ctrl-x ctrl-e
I've always used ` to get the output of a command. Seems way easier to type.
you can use escape . [dot] for an autocomplete style thing, or $_ for a command or script thing.
Also see man history ( expansion, designators , modifiers )
That's a nice one. Also works by typing 'fc'.
Another good one: ALT+. repeat to cycle through.
WHY DOESN'T SHE QUOTE HER VARIABLES REEEEEEEEE
fc -l # list recent commands
fc -l -10 # list last 10 commands
fc -l 5 10 # list commands 5 thru 10
>\! on the front of you're PS1 puts a line number on your bash prompt.
!20 # run line 20 again
!foo # run most recent command that began with foo
!?foo # run most recent command that contained foo
!?foo?:s/old/new # rerun most recent command that contained "foo", but replace string "old" with string "new"
curl parrot.live
set -o vi
compgen -a
# list you're aliases
compgen -b
# builtins
compgen -c
# commands
compgen -k
#keywords
compgen -A function
#functions
>having whitespace in your variables ever
gtfo noob
fc -e kwrite
# opens last command in kwrite to edit and execute (in terminal) when save and close kwrite. Editor preference can be made sticky with FCEDIT variable.
fc -e kwrite 20
# as above but history line 20
# The following commands will report the location (filename and line number) of a function’s definition. Assuming a function named foo,
# Turn on extended shell debugging
shopt -s extdebug
# Display the function’s name, line number and fully qualified source file
declare -F foo
# Turn off extended shell debugging
shopt -u extdebug
For example, the output of these commands might be:
foo 32 /source/private/main/developer/cue.pub.sh
The above might work only in bash, and not in POSIX shells in general.
t. mount stupid
alias fbi='sudo rm -rf /'
Append | tr 'lr' 'w' to all of your commands and thank me later
mkdir whatthefuckdidyoujustsayaboutme; cd "$_"
reddit pls go
fbi is frame buffer image viewer
append | cowsay to all you're commands and thank me later.
fim is fbi improved btw.
>tricks
variable interpolation
for loops
command substitution
key shortcuts