From 0308cd3f9c7fd9a056ff93d6da4912c830f235e7 Mon Sep 17 00:00:00 2001 From: Ashish singh <40070226+Logan-47@users.noreply.github.com> Date: Sun, 12 May 2019 22:10:34 +0530 Subject: [PATCH] Added extra commands that comes very handy (#27195) * update index.md Added extra commands that comes very handy * Update index.md * Update index.md * fixed a typo --- .../macos-terminal/index.md | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/guide/english/terminal-commandline/macos-terminal/index.md b/guide/english/terminal-commandline/macos-terminal/index.md index 188f7d3142..26a2256617 100644 --- a/guide/english/terminal-commandline/macos-terminal/index.md +++ b/guide/english/terminal-commandline/macos-terminal/index.md @@ -33,19 +33,25 @@ cd `cd` stands for "Change Directory". ```cd``` is then followed by the directory's name you wish to switch into. +Typing only `cd` will move to the home directory works same as `cd ~` + Here is a list of common commands: Command | Usage ------------ | ------------- -`pwd` | Print Working Directory (Where Am I? ) -`ls` | List contents of current directory -`mkdir ` | Create a new directory -`rmdir` | Remove directory -`touch ` | Create a new file -`cp ` | Copy a file -`mv` | Rename a file/directory -`rm ` | Remove a file -`rm -rf ` | Forcibly remove a directory +pwd | Print Working Directory (Where Am I? ) +ls | List contents of current directory +ls -a | List contents of current directory including hidden files +mkdir | Create a new directory +touch | Create a new file +cp| Copy a file +rm | Remove a file +rm -rf | Remove a directory +sudo | Run command with the security privileges of the superuser +clear | Clear the screen +nano [file] | Opens the file using nano editor +vim [file] | Opens the file using vim editor +reset | resets the terminal display ### Usage Examples @@ -105,8 +111,13 @@ kill #### Previewing file If you would like to preview a file, type the command `cat ` and you would be able to preview a text document through the terminal. +#### Search your command history as you type -## iTerm2 +```control+R``` + +Hold down `control` and press `R` to invoke "reverse-i-search." Type a letter - like s - and you'll get a match for the most recent command in your history that starts with s. Keep typing to narrow your match. When you hit the jackpot, press Enter to execute the suggested command. + +# iTerm2 iTerm2 is an alternative to the legacy terminal in Mac OS. iTerm2 brings some new features such as: