Linux CMD Tastatur Befehle

  1. Ins vorherige Verzeichnis Wechseln:
  2. Insert the last argument from the previous command
    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.
  3. Hier ist ein Beispielspromt
    It looks like this:
    /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$

CMD Shortcuts

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.

  • ESC + .Escape key and the period/full stop at the same time will insert the last argument from the previous command.
    For example if your previous command is:
    Then this shortcut will insert ‚World‘ and the current point.
    However, if your previous command was 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.
    ALT and f

    together will move the cursor forward by one argument.
    ALT and b

    is the shortcut for moving the cursor back one argument.
  • ALT+d
    ALT und d

    will delete one argument forwards.

For example using it at this point:

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“.

    This deletes one argument backwards.
    So using the same example as above:
    This would remove ‚Hello‘. Note that STRG+w does remove quotes (ALT+BACKSPACE doesn’t), so if it were:
    You’d be left with echo World“ with one quote.
  • STRG+ALT+-
    This is basically undo. So if you accidentally deleted a work or line hit this to get it back.
  • STRG+k
    This removes from the cursor to the end of the line, and out it into the kill ring.
    The kill ring is basically the clipboard on the command line.
  • STRG+y
    This ‚yanks‘ whatever is in the kill ring (clipboard) into the current position.
  • STRG+a
    Jump to the start of the line.
  • STRG+e
    Jump to the end of the line.