Ins vorherige Verzeichnis Wechseln: cd -
Insert the last argument from the previous command [ESC]+.That’s hold down escape and press . This is a great one if you’re processing a file in multiple steps. The result file is often the last argument of a command then is will be an argument of the next command.
Hier ist ein Beispielspromt PS1="\[\e[30;1m\]\u@\h:\[\e[34;1m\]\w\n\`if [ \$? = 0 ]; then echo \[\e[30m\]! \!\[\e[30m\]\$; else echo \[\e[31m\]! \!\[\e[30\;0m\]\$; fi\` \[\e[0m\\]"It looks like this: user@host:****/current/working/directory ! 506$
If the command you run returns an exit status that’s not 0, i.e. it fails, then it looks like this user@host:****/current/working/directory ! 506$
Here’s the top shortcuts I use on the command line. These should speed up your productivity quite nicely. If you’re using the Gnome Terminal on Ubuntu (possibly other distro’s too) you might need to enable ALT+f and ALT+b in the preferences.
echo Hello World Then this shortcut will insert ‘World’ and the current point. However, if your previous command was echo "Hello World" Then it will insert ‘“Hello World”’. Note also that it is relative to your position in the history. So if you have run 10 commands and you go up through your history to the fifth one and use this, it will give you the last argument from the fourth command not the tenth.For example using it at this point: echo Hello World Would delete the word ‘World’. The removed text will go into the kill ring. Note it will not remove quotes with it. If above Hello World was quoted. It would leave “Hello”.
echo Hello World This would remove ‘Hello’. Note that STRG+w does remove quotes (ALT+BACKSPACE doesn’t), so if it were: echo "Hello World" You’d be left with echo World" with one quote.