ctrl a- Go to the beginning of the line you are currently typing on.ctrl e- Go to the end of the line you are currently typing on.ctrl l- Clears the Screencmd k- Clears the Screenctrl u- Cut everything backwards to beginning of linectrl k- Cut everything forward to end of linectrl w- Cut one word backwards using white space as delimiterctrl y- Paste whatever was cut by the last cut commandctrl h- Same as backspacectrl c- Kill whatever you are running. Also clears everything on current linectrl d- it the current shell when no process is running, or send EOF to a the running processctrl z- Puts whatever is running into a suspended background process. fg restores it.ctrl _- Undo the last command.ctrl t- Swap the last two characters before the cursorctrl f- Move cursor one character forwardctrl b- Move cursor one character backwardoption ->- Move cursor one word forwardoption <-- Move cursor one word backwardesc t- Swap the last two words before the cursoresc backspace- Cut one word backwards using none alphabetic characters as delimiterstab- Auto-complete files and folder names
cd- Home directorycd name- name directorycd ~- Home directorycd /- Root of drivecd -- Previous directoryls- Short listingls -l- Long listingls -a- Listing incl. hidden filesls -lh- Long listing with Human readable file sizesls -r- Entire content of folder recursivelysudo command- Run command with the security privileges of the superuser (Super User DO)open filename- Opens a file ( as if you double clicked it )top- Displays active processes. Press q to quitopen -a editorname filename- Opens the file using this editorreset- Resets the terminal display
commandA; commandB- Run command A and then B, regardless of success of AcommandA && commandB- Run command B if A succeededcommandA || commandB- Run command B if A failedcommandA &- Run command A in background
commandA | commandBRun command A and then pass the result to command B
history n- Shows the stuff typed – add a number to limit the last n itemsctrl r- Interactively search through previously typed commands![value]- Execute the last command typed that starts with ‘value’![value]:p- Print to the console the last command typed that starts with ‘value’!!- Execute the last command typed!!:p- Print to the console the last command typed
touch filename- Create a new filepwd- Full path to working directory.- Current folder, e.g. ls ...- Parent/enclosing directory, e.g. ls ..ls -l ..- Long listing of parent directorycd ../../- Move 2 levels upcat- Concatenate to screenrm [file]- Remove a file, e.g. rm data.tmprm *- remove all filesrm -i [file]- Remove with confirmationrm -r [dir]- Remove a directory and contentsrm -f [file]- Force removal without confirmationcp [file] [newfile]- Copy file to filecp [file] [dir]- Copy file to directorymv [file] [new filename]- Move/Rename, e.g. mv file1.ad /tmppbcopy < [file]- Move/Rename, e.g. mv file1.ad /tmppbpaste- Paste clipboard contentspbpaste > [file]- Paste clipboard contents into file, pbpaste > paste-test.txtecho "this is a line rewrites file" > file.txt- create file (if not exists) and write (rewrite) stringecho "this is a line append to the end" >> file.txt- create file (if not exists) and append string to the endprintf "Hello, I'm %s.\n" > file.txt- create (if not exists) and write (rewrite) format string
vim file1.txt- open file with vim- Shift + : + x - quit save vim
- Shift + : + w - save
- Shift + : + q - quit if where not changes
- i - switch to redactor mode
- esc - switch out of redactor mode
mkdir [dir]- Create new directorymkdir -p [dir]/[dir]- Create nested directoriesrmdir [dir]- Remove directory ( only operates on empty directories )rm -R [dir]- Remove directory and contentsless [file]- Output file content delivered in screensize chunks[command] > [file]- Push output to file, keep in mind it will get overwritten[command] >> [file]- Append output to existing file[command] < [file]- Tell command to read content from a file
find [dir] -name [search_pattern]- Search for files, e.g. find /Users -name "file.txt"grep [search_pattern] [file]- Search for all lines that contain the pattern, e.g. grep "Tom" file.txtgrep -r [search_pattern] [dir]- Recursively search in all files in specified directory for all lines that contain the patterngrep -v [search_pattern] [file]- Search for all lines that do NOT contain the patterngrep -i [search_pattern] [file]- Search for all lines that contain the case-insensitive patternmdfind [search_pattern]- Spotlight search for files (names, content, other metadata), e.g. mdfind skateboardmdfind -onlyin [dir] -name [pattern]- Spotlight search for files named like pattern in the given directory
[command] -h- Offers help for this commandinfo [command]- Offers helpinfo [command]- Offers helpman [command]- Show the help manual for [command]whatis [command]- Gives a one-line description of [command]apropos [search-pattern]- Searches for command with keywords in description
emacs -batch -l dunnet - play game.