
Here are some handy command you can use for it CommandĪll shells have job control: the ability to run programs in the background (multitasking) und foreground (running as the active process at your shell). All commands you are entered are stored inside the command history. The shell allows you to recall previous commands. Will print a*, so * will not be interpreted as the wildcard symbol If a character has a special meaning to the shell but you want it used literally, precede the character with a backslash \ Command Will print "Value of PATH: /users/sebastian/." If you want a word contain whitspaced you need to surround it with single or double quotes to make the shell treat it as a unit.ĭouble quotes will result in evaluating the actual content and replacing shell variables with there actual content.

The sequence will stop if one command succeeded

The sequence will stop if any command fails Redirection of standard input of one command can be redirected to another command using the | operator. Write to outfile and things the command writes to stderror will be redirected to errorFile Spotlight search for files (names, content, other metadata), e.g.The shell can redirect standard in, standard out and standard error to and from files.Īny command that reads from standard input can read from a file instead with the shells and 2> operator Command Search for all lines that contain the case-insensitive pattern Search for all lines that do NOT contain the pattern Recursively search in all files in specified directory for all lines that contain the pattern Search for all lines that contain the pattern, e.g. Push output to file, keep in mind it will get overwritten Output file content delivered in screensize chunks Remove directory ( only operates on empty directories ) Paste clipboard contents into file, pbpaste > paste-test.txt

Print to the console the last command typed Print to the console the last command typed that starts with ‘value’ Interactively search through previously typed commandsĮxecute the last command typed that starts with ‘value’ Shows the stuff typed – add a number to limit the last n items Run command A and then pass the result to command B e.g ps auxwww | grep google Run command A and then B, regardless of success of A Opens a file ( as if you double clicked it )ĭisplays active processes. Run command with the security privileges of the superuser (Super User DO) Long listing with Human readable file sizes Swap the last two words before the cursorĬut one word backwards using none alphabetic characters as delimiters Swap the last two characters before the cursor Puts whatever you are running into a suspended background process. Here is a link to a google sheet with these commands line. Personally ‘.’ was my personal favourite discovery. Also clears everything on current lineĮxit the current shell when no process is running, or send EOF to a the running process This is a quick cheat sheet for commands to be used in the Terminal command line. Paste whatever was cut by the last cut command Netbeans being one exceptionĬut everything backwards to beginning of lineĬut one word backwards using white space as delimiter This also works for most text input fields system wide.

Go to the end of the line you are currently typing on. Go to the beginning of the line you are currently typing on. Letters are shown capitalized for readability only. Since the translation rely on volunteers, the content between the available languages may vary. This cheatsheet is available in many languages.
