8.lls [ls-options [path]]
Display local directory listing of either path or current directory if path is not specified. ls-options may con-
tain any flags supported by the local system’s ls(1) command. path may contain glob(3) characters and may match
multiple files.
9.ls [-1afhlnrSt] [path]
Display a remote directory listing of either path or the current directory if path is not specified. path may con-
tain glob(3) characters and may match multiple files.
10.Quit sftp
bye
exit
quit
3.Installing Apps with Homebrew Cask
Homebrew Cask is an extension for Homebrew that allows you to automate the installation of Mac Apps and Fonts.
After you have homebrew installed, you’ll want to install Homebrew Cask:
// grep command: Recursively Search All Files For A String
cd /path/to/dir
grep -r "word" .
grep -r "string" .
// Ignore case distinctions:
grep -ri "word" .
// To display print only the filenames with GNU grep, enter:
grep -r -l "foo" .
// You can also specify directory name:
grep -r -l "foo" /path/to/dir/*.c
// find command: Recursively Search All Files For A String
// find command is recommend because of speed and ability to deal with filenames that contain spaces.
cd /path/to/dir
find . -type f -exec grep -l "word" {} +
find . -type f -exec grep -l "seting" {} +
find . -type f -exec grep -l "foo" {} +
// Older UNIX version should use xargs to speed up things:
find /path/to/dir -type f | xargs grep -l "foo"
// It is good idea to pass -print0 option to find command that it can deal with filenames that contain spaces or other metacharacters:
find /path/to/dir -type f -print0 | xargs -0 grep -l "foo"
11. Common terminal shutcuts
12345678910111213
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 Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + T Swap the last two characters before the cursor
Esc + T Swap the last two words before the cursor
A:Sounds like you created this user with the useradd command. This is a low level command, and not the prefered way to create a user. By default it will point the user’s shell to /bin/sh, not /bin/bash. So you will not get the nice autocompletion. You can check user’s shell with command echo $SHELL, list all available shells cat /etc/shells, change the user’s shell:
1
$ sudo usermod --shell /bin/bash [username]
This should give you bash autocompletion. You probably also want to copy /etc/skel/.bashrc to the user’s home directory.
In the future, prefer the adduser command. Despite the similar name, it has different results. It will default to using /bin/bash as the shell and seed the new user’s home directory with the files from /etc/skel/