Menu
Tags: zoom video teleconference video conference hangout video chat chat communication cli command line. Do you have a standing meeting in a Zoom chat? Do you hate having to constantly launch Zoom from the browser and deal with that window that they left open?
- Macos Command Line Reference
- Macos Command Line Developer Tools
- Skype Command Line Switches For Macos Download
- Skype Command Line Switches For Macos Mac
- Windows Command Line Switches
- Skype Command Line Switches For Macos Mac
Make things happen quickly without touching the mouse
- Text wrapping
- Default editor
- Foreground processes and background jobs
- Folders accessed by developers
- Terminal File Listing Home Folder
- Create Terminal Aliases
- Root user for sudo commands
- Create Windows-like shortcuts with parameters using text editor
Command-line parameters for CCleaner Business and Technician Edition CCleaner Business Edition and Technician Edition allow the user to perform several additional command line operations. You can use them in batch files, scripting, shortcuts, or the Task Scheduler to automate CCleaner operation. Apr 25, 2016 To start the download, click the Download button and then do one of the following, or select another language from Change Language and then click Change. Click Run to start the installation immediately.; Click Save to copy the download to your computer for installation at a later time; IT professional resources IT professional working in managed environments can find complete.
This tutorial describes how to make use of the macOS Terminal to make your life easier and less frustrating.
What Apple calls the Terminal is what Linux people call the shell console (more specifically, the Bash shell). It’s also called a command-line terminal, abbreviated as CLI.
Information here is often used in interview questions.
Open Terminal (several ways)
On the Mac, the Terminal app is kinda buried, probably perhaps because those who use a MacOS laptop just for social media probably won’t need a Terminal.
![Skype Skype](/uploads/1/2/6/6/126616894/791631957.png)
But if you’re a developer, it’s hard to get away from using a CLI.
There are different ways to open a Terminal command line.
My preferrence is a way that doesn’t require reaching for a mouse and using the least number of keystrokes:
- Press command+space keys (at the same time) to bring up Apple’s Spotlight universial search, then
- Type “termin” so “Terminal.app” appears.
- Press the space bar to select it.
Alternately, if you prefer moving your mouse:
- Click the Finder icon on the app bar.
- Click Applications on the left pane.
- Click Utilities.
- Click Terminal.
PROTIP: If you are at the Finder program (since Yosemite) you can open a Terminal to a folder listed within Finder by pointing your mouse on it, then tapping with two fingers on the touchpad/mousepad.To enable that:
- Click the Apple icon, System Preferences....
- Press K and select Keyboard.
- Click Shortcuts, Services.
- Scroll to the Files and Folders section.
- Check on New Terminal at Folder.
- Close the dialog by clicking the red dot at the upper left corner.
Bash shell invocations
I put in an echo in the various files that macOS executes upon user login, when a new terminal is opened, and when a bash shell is invoked:
When macOS logs in a user, it executes file /etc/profile. That file’s code:
echo ${BASH-no} resolves to /usr/local/bin/bash.
The /etc/bashrc file contains:
The above defines the $PS1 variable which sets the Terminal’s prompt to the left of the cursor.
NOTE: On Ubuntu, instead of /etc/bashrc, the file is /etc/bash.bashrc.
RedHat also executes /etc/profile.d if the shell invoked is an “Interactive Shell” (aka Login Shell) where a user can interact with the shell, i.e. your Terminal bash prompt.
Thus, whatever is specified in /etc/profile is NOT invoked for “non-interactive” shells invoked when a user cannot manually interact with it, i.e. a Bash script execution.
PROTIP: One can change those files, but since operating system version upgrades can replace them without notice, it’s better to create a file that is not supplied by the vendor, and within each user’s $HOME folder: ~/.bash_profile
In other words, file /etc/profile is the system wide version of ~/.bash_profile for all users.
Examples of custom settings include:
export HISTSIZE=1000 # sets the size of .bash_history lines of command history (500 by default)
User Mask for permissions
Wikipedia says umask controls how file permissions are set for newly created files. Please read it for the whole story on this.
- To identify the User Mask for permissions:Since the default is “0022”:-S shows the symbolic equivalent to “0022” for u=user, g=group, o=others :r is for readable, x is for eXecutable by the user.
- To set the User Mask for permissions:UMASK 077
Within Text Editors/IDEs
Many prefer the terminals built into VS Code and other editors/IDEs.
Text wrapping
This page contains notes for system administrators and developers,who need to control Macs below the UI level, which requiretyping commands into a command-line terminal screen.
- To avoid text wrapping, cursor on the right edge to expand the screen width.
Hyper terminal app
Get the .dmg installer from the websitehttps://hyper.is. It’s used by tutorials author Wes Bos.
Unlike Apple’s Terminal, which is closed-source, Hyper is an open-source and extensible terminal emulator. It is available on MacOS, Windows, and Linux because it’s built using Electron (the same platform that powers Atom, Slack, and Brave). So it can be slow.
To customize Hyper, add the name of many packages to its config file ~/.hyper.js. Build an extension based on hyper.is/#extensions-api.
iTerm2 for split pane
![Dos command line switches Dos command line switches](/uploads/1/2/6/6/126616894/712106472.png)
Many prefer to install and use iTerm2 instead of the built-in Terminal program.Install iTerm2 using Homebrew:
Terminal does not support but iTerm2 does support dividing the CLI into several rectangular “panes”, each of which is a different terminal session:
- split window vertically with Command+D
- split window horizontally with Command+Shift+D
- Navigate among panes with command-opt-arrow or cmd+[ and cmd+]
- Temporarily toggle maximize the current pane (hiding all others) with command-shift-enter
- Exit out a pane by typing exit in that pane
Pressing the shortcut again restores the hidden panes.
On Linux, there is the
screen
command.See Iterm2 Cheat Sheet of iTerm2 keyboard shortcuts. https://github.com/nobitagit/iterm-cheat-sheet/blob/master/README.md
Alphabetical Commands list
A list of all commands native to macOS is listed alphabetically at https://ss64.com/osx.
Exit
To exit from the Terminal shell:
exit
Get back in for the remainder of this tutorial.
Shutdown
CAUTION: To kill all apps and shutdown a Mac right away (with no warning and no dialog):
sudo shutdown -h now
Text Command Line Bash Shortcuts
These come from the bash terminal on Linux machines here: Press control with your pinkie, then …
- control + C = Close processing
- control + L = cLear screen
- control + A = Go to Beginning of line (as in A to Z)
- control + E = Go to End of line (hit E using longest finger)
- control + F = Forward cursor
- control + B = Backward
- control + H = Backspace left of cursor
- control + D = Delete right of cursor
- control + K = Kill line from under the cursor to the end of the line.
- control + U = 'U get out of here' - Clear entire line
- control + P = Previous line
- control + N = Next line
- control + Y = Retrieve line
- control + ` = cycle through session windows
- control + left = previous session
- control + right = previous session
Environment Variables
A big reason to use a command-line terminal is to set environment variables.
Like on PCs, the PATH system environment variable storeswhere the operating system should look to find a particular program to execute.
- To see what is already defined:The listing such as this, which declares the “XPC_FLAGS” system variable:declare -x XPC_FLAGS=”0x0”This talks about setting launchd.conf and rebooting.This applies to all users.
- To see what is defined:PROTIP: $PATH must be upper case.The response I’m getting includes:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbinNotice colon (:) separator used in Mac and Linux vs. semicolons used in Windows PATH.
Default editor
- The command to invoke the default editor is defined by a variable:By default, it’s TextMate:If you want to change it to nano or other editor, see My tutorial on text editors.
- On Terminal session, copy what has been typed and open the default text editor so you can edit the command:Alternately, (which also works in Linux) while holding down the control key, press X and E together:control + X + E
- Make changes, then copy all, switch or exit to the Terminal, then paste.
Switch among programs
- To switch among programs already running in macOS, hold down the command key while pressing tab multiple times until the program you want is highlighted (with its name) in the pop-up list. This is equivalent to the Windows control+Esc key combo.
Command history
- List previous command history:This is the same as:PROTIP: History does not display commands entered with a leading space.
- Cursor up and press Enter to re-execute.
- Press control + R to begins a “reverse incremental search” through your command history,then type, it retrieves the most recent command that contains all the text you enter. Much better than something like:
- Press control + S to reverse the mode.
- Clear history:The clear command does not clear history.See history at sstr.com
- Clear the terminal history:clear
Foreground processes and background jobs
- List the first process (with Parent process ID of 0) launched (into user space) at boot by the system kernel:f adds columns for status of the command (CMD) to invoke the process:By contrast, on Linux system, the first CMD is /lib/systemd/systemd.
- To list all processes, don’t specify 1
PID given process name
- To list the process ID given a process name such as “firefox”:This can be generalized in a shell program containing:Alternately, Linux has a command which returns the PID associated with a process name. But it’s not avaiable on macOS, so:
- install it using Homebrew:
- To emulate a long-running process in the foreground:No additional commands can be accepted.
- To kill the current process, press control + C.
background jobs
- Run a program in the background with the &:
- List jobs (processes) running in the background:
Suspend control+Z
- Do it again:
- To suspend the process, press control + Z. The response is like:[1] shows the PID.Internally, this sends a “20) SIGTSTP” signal to the process.
- To have the process continue (internally sending a “18) SIGCONT”:
- List processes
- Copy the PID (Process Identifier) number for use in the kill command, such as:
- There are many ways to kill a process:
- To kill a specific process, ee need to specify its PID (Process Identifier):Some applications are written to receive a sigterm so that it can take steps to gracefully cleanup and exit.The key ones, in order of aggressiveness:kill 289 # sends sigterm
kill -15 289 # sends sigterm
kill -2 289 # sends sigint
kill -1 289 # sends sighup
kill -9 289 # sends sigkill signal to the kernel without notifying the app, a “dirty shutdown” used when the app is misbehaving.List open files
- To list process id’s and port (such as 8080), use the “list open files” command:PROTIP: Use grep to filter because the response is usually too many lines.(You’ll need to provide your password).The right-most column heading 'NAME' shows the port(either TCP or UDP).
Folders accessed by developers
- In Finder, select from the left panel the first item under the Devices list.
- Click on Macintosh HD.
- Applications hold apps installed.
- Incompatible Software hold apps which cannot be installed,such as Amazon Kindle, which competes with Apple's iBooks.This occured during upgrade to Yosemite.
- Library/Library holds Apple internal apps.
- System hold apps installed.
- Users hold data for each user defined,as well as a Shared folder accessible by all users.
- Click on your username (wilsonmar in my case).This action is the same as clicking on the last default item under theFavorites list.Many WordPress developers prefer to add a folder named Siteswhich holds the wordpress folder expanded from download.
vs. /etc in Linux
VIDEO:On both Mac and Linux, the “et-see” folder contains system and program configuration files,for both default system and programs you install (such as “teamviewer”, etc.)/bin contains system/sbin are for system administrators such as ping, fdisk, mount, umount, etc.
Terminal File Listing Home Folder
By default, the Terminal shows the hard drive and lowest level file folder name, in white letters over black.
- To show the present (current) working directory (folder):The response for me is:/Users/wilsonmarYou will of course have a different machine user name than wilsonmar.
- Note the pwd command is built internally to the Bash shell:The response:pwd is a shell builtin
- To get back to the home folder:Alternately:Alternately, use the $OLDPWD environment variable that MacOS automatically maintains toremember the previous working directory so that you can switch back to it:
List files and folders
- List all file names (without any metadata):Folders available by default include Documents, Downloads, Pictures, Desktop, Music, Movies.
- Note the ls command is an external command added to the Bash shell:The response lists where ls is defined:ls is hashed (/bin/ls)
- Dive into a folder type:
- Press Enter.Nothing happens because upper case letters are important.
- Press delete to remove the mu and type:
- Press Enter for the Music folder.
- Go back up a level:
- Create a Projects folder to hold projects downloaded from Github:-p specifies creating the parent folder if it doesn’t exist.This only needs to be done once.
List files and folders
- List all files with their permission settings:Notice that no hidden files are listed.
- List all hidden files with permission settings,piping the listing to more instead of having results flying by:A colon appears at the bottom if there is more to show.
- Cancel the listing, press control + C.Notice the .bashrc on the first page, something like:(It’s for the Bash Shell.)
- If a file is not listed, create it with:
- To make it rw r r:
- List only hidden files in the current folder:
Show Hidden Invisible Files in Finder
By default, the Mac’s Finder does not show hidden files.
- Close all Finder folders.
- Enter this in Terminal before typing Return:This causes all Finder windows to be reset.To make invisible files visible again:A description of each keyword:defaults - OSX’s command to change defaults, apple’s low-level preference system.write - tells defaults you want to change a preference, or write itcom.apple.finder - defaults that the application’s preferences you want to change is Finder, specified by the application’s bundle identifier.AppleShowAllFiles - specifies which preference you want to change within the application.TRUE or FALSE - the value you want to set the preference to. In this case, it is a boolean, so the values must be TRUE or FALSE. I think you might be able to use YES or NO, but I’m not sure.&& - a terminal operator to run whatever’s after this if the command to its left is successful.killall - kills processes or closes applications.Finder - specifies the process or application to close.
For more on this, see this.
Create Terminal Aliases
Wireless up and down
Most developers leave files un-hidden.
- To set wireless (device
en0
) up or down without clicking on the icon at the top:ifconfig en0 downThis command requires sudo permissions. - Set alias command to just type showFiles andhideFiles to show and hide Mac OS X’s hidden files, considerthis article to create such terminal aliasesin the ~/.bash_profile script.
tree alias or brew install
OSX does not come with the tree command that many other Linux distributions provide. So add it using:
If you don’t want to install a program, add an alias for a tree command by adding this in the ~/.bash_profile script:
Alternately, add it by installing a command using brew:
Active Terminal sessions need to be closed so new Terminal | Shell | New Window | Shell has this activated.
See list of parameters:
List only 2 levels deep with human-readable file size kilobytes and sort by last modified date:
Cursor to Screen Hot Corners
By default, if you move the mouse to one of the corners of the screen,stuff happens. It can be annoying.
- Click the Apple menu at the upper left corner.
- Select System Preferences.
- Select Desktop & Screen Saver.
- Select the “Screen Saver” tab.
- Click “Hot Corners” at the lower-right corner.
- Select actions for each of the corners.PROTIP: Disable each by selecting the dash (last choice) so they don’t show up when you’re just trying to navigate to something near the edge.
- Exit out the Preferences diaglog.
- Move your cursor to the lower-left corner to bring it back to life.
- Press Esc to bring the screen back.PROTIP: NOT having a quick way to “Put display to sleep” is considered a security vulnerability by CIS. The lower-left corner is less popular location on Mac than Windows.
Hosts file
Mac, Windows, and Linux systems have a hosts file that locally does the work of the public DNS– translating host names (typed on browser address field) to IP address numbers.
- Show text file contents to the Terminal console:The default contents:PROTIP:
fe80::
is a block of IPV6 addresses reserved for link-local addresses used for packets sent only to directly connected devices (not routed). The network discovery protocol (NDP), which replaces ARP and DHCP in IPv4, is the biggest user of link-local addresses (NDP sorta .fe80::1 is like 127.0.0.1 for IPV4, butactually IP address 169.254.. in IPV4, an address not often used.Each IPV6 interface has a different link-local address starting with fe80:: and (typically) ending with a modified version the interface’s MAC address (EUI-64 format) to ensure a unique address on a segment.Programs such as OpenVPN add to the bottom of the file:BLAH: The Linux tac command to list backward is not in Mac: - Show a file in -reverse (bottom-up):Change n2 to a different number of lines to show.PROTIP: This command is useful to see the lastest entries appended to the end of a large log file.
- Expose spaces at end of lines by showing at end of every line $ end-of-line characters that are otherwise not shown. For example, in a file on every macOS:
- Edit the hosts file on a Mac using the Atom text editor:
Terminal Ping Host
Find the IP address of a website host name:
SSH tunnel
To access a remote server through a port that is not open to the public:
- VIDEO: Bind local port 3337 to remote host 127.0.0.1 port 6379 using user root in emkc.orgBTW 6379 is the default port for a Redis instance.
DNS Configuration with NameBench
Analysis at one time showed this ranking by speed:
- UltraDNS at 156.154.70.1
- Google at 8.8.4.4, 8.8.8.8
- OpenDNS at 208.67.222.222, 208.67.220.220, 208.67.222.220
Google Namebench tries the speed of various DNS servers from YOUR machine (which takes some time) and pops up in your browser this:
- If you don't see the Apple icon at the top of the screen,move the cursor to the very top of the screen for a few seconds.
- Click on the Apple icon at the upper left corner.
- Select System Preferences.
- Click Network.
- Click Advanced.
- Click DNS.
- Click [+], copy, and paste
An example:
- 205.171.3.65
- 216.146.35.35
- 192.168.0.1
Clear DNS Cache
- Flush the DNS cache (since OSX 10.9):sudo dscacheutil -flushcache
dscacheutil
is the Directory Service cache utility used to Gather information, statistics, initiate queries, flush the cache:BTW, the equivalent for Ubuntu issudo service network-manager restart
while other Linux flavors usessudo /etc/init.d/nscd restart
.
Windows usesipconfig /flushdns
.
Different commands are needed for different versions of OS.OSX 10.10 added requirement for sudo when using the built-in discoveryutil:
sudo discoveryutil udnsflushcaches
Bash Profile Configuration
The profile file is run during boot-upto configure the terminal to define file path, shims, and autocompletion handlers.
This is the single biggest frustration with people using Linux on Mac.
One of the earliest articles on bash hereshows shell variables, environment variables, and aliases.
Each operating system has its own file name for its profile:
- With Ubuntu: Modify ~/.profile instead of ~/.bash_profile.
- With Zsh: Modify ~/.zshrc file instead of ~/.bash_profile.
- With Fish: Modify `~/.conf/fish/config.sh` to append.
PROTIP: If there is both a .bash_profile and a .profile file, boot-up only executes the first one it finds.
- On my Yosemite Mac, open a terminal and:
- View the file using the vi editor that comes with OSX:
According to the bash man page, .bash_profile is executed during login before the command prompt,while .bashrc is executed for interactive non-login shells such aswhen you start a new bash instance by typing /bin/bash in a terminal.
Here’s what my profile file begins:
- Exit vi by typing :q
- Some installers request that adding a
$PATH
using a command such as: - To execute profile with the changes:Alternately, to install GHC copy and paste into ~/.bash_profile:
https://github.com/gcuisinier/jenv/blob/master/README.md
- To run a Bash script while avoiding the confirmation prompt:set -- -f; source bootstrap.sh
Operating System Kernel
I can use Linux commands in my version of the operating system:
uname -a (a for all) or uname -rvm
returns:
14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
which is a combination of:
uname -r for release number,
uname -v for kernel version,
uname -m for model:
uname -v for kernel version,
uname -m for model:
x86_64 for Intel or AMD 64-bit or
i*86 for 32-bit.
i*86 for 32-bit.
For more information about Darwin operating systemdeveloped at Apple, see:
- http://www.wikiwand.com/en/XNU and
- https://www.wikiwand.com/en/Comparison_of_operating_system_kernels
NOTE: lsb_release -awhich works on Debian, RHEL 6.6, and Ubuntu is not recognized on Gentoo nor CentOS 6,which has no folder /etc/lsb-release.
See Distriwatch.com,which describes releases of different Linux distributions.
Setup Your Mac Like a Pro
Paul Irish is one of top pros among developers, and now a Google Evangelist.He put his Mac configuration settings ongithub.com/paulirish/dotfiles. But he recommends cloning github.com/mathiasbynens/dotfiles/.
On the Git page notice that he has established an industry convention of usingProjects folder we defined earlier.
On the Git page I clicked on Clone in Desktop.
The library is called dotfiles because that’s what hidden files are called,and most configuration files are hidden.
PS1 terminal prompt setting
Paul Irish offers his setup-a-new-machine.sh athttps://github.com/paulirish/dotfilesZShell (included with Mac and can be set as the default in Terminal)* oh-my-zsh as a ZShell framework* The oh-my-zsh Git plugin* And the oh-my-zsh theme called jnrowe</p>
By default, if you have a long file name, it would leave little room to type in commands before it wraps to the next line.
To redefine what appears in the prompt,edit this file using the vi editor that comes with each Mac:vi .bashrc Copy this and paste to the bottom of the .bashrc file:
The command above uses global parameters $USER and $PWD,plus colors from this list.
Root user for sudo commands
If you try a command that responds about “permissions denied”, you need to execute as a root user.
The root user has the ability to relocate or remove required system files and to introduce new files in locations that are protected from other users. A root user has the ability to access other users’ files.
Macos Command Line Reference
Any user with an administrator account can become the root user or reset the root password.
Under a *nix system like MacOS you must have “root” (administrative) privileges to start IP-services using ports smaller than 1024.
After MacOS install, the root or superuser account is not enabled. While it is possible to enable the root account, once enabled, if forgetten, you’ll have to reboot from the installer drive (a hassle).
- The easiest way it to have the last command (in history) automatically retrieved so you don’t have to retype it to
execute again under root:sudo !!It is safer and easier to use the sudo command to gain temporary root access to the system rather than logging out and logging in using root credentials. - Alternately, this command only reads the $SHELL variable and executes the content:sudo -sYou would be prompted for a password.
- To determine whether you’re in sudo:
whoamiThe response “root” says you’re still in sudo rather than your user name.- To demote out of root:
exit
PROTIP: There are several ways to invoke sudo*
- This command is my preferred way to get into root for awhile because it keeps the environment variables intact:sudo /bin/bashThe command above uses a non-login shell, and reads just the .bashrc of the calling user. Not all dot-files are executed.
- If you want environment variables specific to root and be in the root home directory (rather than your user’s $HOME directory), this command executes /etc/profile, .profile, and .bashrc which defines them:sudo su -s
- If you switch between Zsh and Bash, this command runs the shell specified by the password database entry of the target user as a login shell:sudo -i
- If you switch between Zsh and Bash, this command runs the shell specified by the password database entry of the target user as the login shell, then executes login-specific resource files .profile, .bashrc (or .login):sudo -s
PATH
NOTE: The folders that bash looks into are in bin:
/bin/echo $PATH
On a fresh Yosemite, that would contain:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Each additional app adds to the front of the list:
/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Separating the folders between colon separator:
- /Library/Frameworks/Python.framework/Versions/3.4/bin
- /opt/local/bin
- /opt/local/sbin
- /Applications/MAMP/bin/php5/bin
- /Applications/MAMP/Library/bin
- /Applications/Adobe AIR SDK/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
New folders are added to the front of the PATH using a command such as:
export PATH=<new folders>:$PATH
Depending on how you’re setup, file ~/.profile or ~/.bash_profile or ~/.bash_login contains the path echo’d.
Or your PATH may be set in /etc/profile for all users
Create Windows-like shortcuts with parameters using text editor
http://www.jesseweb.com/coding/automator/create-windows-like-shortcuts-with-parameters/
Mac OSX doesn’t allow you to create shortcuts like Windows.OSX alias don’t allow parameters (ex. create a Screen Sharing shortcut that connects to a specific computer).
Jessie suggests this to create a Windows like shortcut with parameters in the Comments field.
Another alternativeis to use a text editor to create URL shortcut fileslike the ones Windows Internet Explorer stores its bookmarks. Apple Safari recognizes them when clicked within Finder.So they are cross-platform.
- Copy the URL to the clipboard by pressing Command+C.
- From within a text editor, open a new text file.
- Type at the top of the file: [InternetShortcut]
URL= - Paste from clipboard by pressing Command+V
- Press enter/return to add a blank line under the URL line.
- Save the file with a .url file extension.
- From within Finder, click on the file to see it display by Safari.
Mount .dmg files using hdiutil tool
- Mount a .dmg (Disk Image) file (substituting for /path/to/diskimage):The response is like:Note the disk from the message above to unmount (detatch):The same utility can mount .iso images:
Macos Command Line Developer Tools
IPv6 compatibility with Curl command line apps
curl http://localhost:3000
Previously, when invoked on Mac OS 10.10 (Yosemite), you needed to add a parameter to make the request use IPv4:
curl http://localhost:3000 –ipv4
Otherwise, even if the URL loads fine in a browser, you will see an error message such as:
curl: (7) Failed to connect to localhost port 3000: Connection refused
This occurs because curl, under Yosemite, uses IPv6 by default but some apps, such as LoopBack.io, by default uses IP v4.
See if you see IP v6 entries in your hosts file (::1 localhost, fe80::1%lo0 localhost). If they are there it is likely that curl is making requests using IP v6.
You can make your LoopBack app use IPv6 by specifying an IPv6 address as shown below:
Largest files taking up disk space
Linux has a ncdu (NCurses Disk Usage) utility to list files in order of how much space they occupied.
- It’s not in macOS by default, so:See https://mac.softpedia.com/get/Utilities/ncdu.shtml
- Now list files within a folder by space used:The command takes up the whole screen (like top), so press control+C to exit.
- To get the directory utilitization size of the current directory:The response is like:The dot means the current folder.
- You can specify a sub-folder named, for example, “code”:
Empty Trash
When files or folders are moved to Trash, they are sent to folder
~/.Trash
.- The
~
means it is at your user HOME folder. - The
.
means it is a hidden folder.
- List the files.
- Count the number files in the folder by piping to the “word count” utility:(The
-al
includes hidden files and folders)(Thefind .
includes files nested within folders as well)The above command is aliased ascf
in my ~/.bash_profile.
To recover disk space taken up by files which have been moved to Trash, there are several ways:
- Switch to the Finder and click the Finder menu to expose the menu:
- You can click on “Empty Trash” or press the Keyboard sequence shift + command + delete.
- If you rather not use a mouse within Finder, switch to Terminal and type this AppleScript command (which will take a while to run if there are a lot of files):NOTE: How to put the above command is aliased as
empty
in my ~/.bash_profile.Schedule Timed Jobs on macOS withlaunchd
within a plist (XML) file.
Ulimit Too Many Files
By default, operating systems limit how many file descriptors to allow.Each operating system version has a different approach.
Linux operating systems have this command:
ulimit -a
On my Sierra the response was:
- Check how many file descriptors you have:launchctl limit maxfilesOn Sierra the response was:The first number is the “soft” number, the second one is the “hard” number.After fixing, the numbers I now see are:
- Such numbers were set with a command such as:sudo launchctl limit maxfiles 10240 10240The maximum setting is 12288?NOTE: To change maxfiles on Sierra, define a plist. TODO: verifyDue to security, OSX Lion removed the “unlimited” option and now requires a number to be specified.
PROTIP:
launchctl
is a rough equivalent to the systemctl
command used in Linux systems.launchctl interfaces with launchd to load, unload daemons/agents and generally control launchd.Disable System Integrity Protection
Some programs make calls to the operating system which OSX began to see as a threat, beginning with El Capitan.
Apple says System Integrity Protection blocks code injection (and many other things).
But what about useful programs (such as XtraFinder)which works by injecting its code into Finder and other application processes?
- For example, OpenVPN issues a JSONDialog Error “DynamicClientBase: JSONDialog: Error running jsondialog”.
To get around this, you need to partially disable System Integrity Protection in OS X El Capitan.See Apple’s article on how:
- Run a full backup to an external USB drive.
- Shut down all apps, then the operating system (from the Apple icon).
- Reboot the Mac.This is needed because System Integrity Protection settings are stored in NVRAM on each individual Mac.So it can only be modified from the recovery environment running in NVRAM.
- Boot OS X into Recovery Mode: hold down the command + R keys simultaneously after you hear the startup chime.
- When the OS X Utilities screen appears, pull down the Utilities menu at the top of the screen.
- Choose Terminal.
- Type the following command into the terminal before hitting the return key.
- For XtraFinder:
- To revert SIP to original state:
Skill Certification
Video course Mac OS X Support: Installation and Configureis the first of courses on Plurasight towardApple Certified Support Professional (ACSP)
Dotfile Settings from others
- https://github.com/afranken/dotfiles
- https://github.com/mathiasbynens/dotfiles
Daemons and Agents
- https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
Resources:
[2] VIDEO
[3] Advanced Bash-Scripting Guide by Mendel Cooper 2012
[4] CommandLineFu.com
https://zwischenzugs.com/2018/01/06/ten-things-i-wish-id-known-about-bash/https://leanpub.com/learnbashthehardway
https://blog.flowblok.id.au/2013-02/shell-startup-scripts.htmlhttps://bitbucket.org/flowblok/shell-startup/src/default/
https://linuxaria.com/howto/7-hidden-features-of-bash
More on OSX
This is one of a series on Mac OSX:
Please enable JavaScript to view the comments powered by Disqus.-->You can use Microsoft Endpoint Configuration Manager to deploy the new OneDrive sync app (OneDrive.exe), as well as the mobile apps for iOS and Android. Before you begin deploying, make sure you have reviewed the planning information and deployment options in the OneDrive guide for enterprises.
Deploy the OneDrive sync app for Windows
The OneDrive sync app (OneDrive.exe) can be installed on Windows 7 and later. It can also be installed on macOS. For info about deploying the OneDrive sync app on macOS, see Configure the new OneDrive sync app on macOS
The new OneDrive sync app can be used with SharePoint Server 2019, but not earlier versions of SharePoint Server. For more information about the restrictions and limitations of the OneDrive sync app, see Invalid file names and file types in OneDrive and SharePoint.
Important
If your users are currently using the OneDrive sync app (Groove.exe), and you want to move them to the OneDrive sync app, see Transition from the previous OneDrive for Business sync app before proceeding.
Make sure that WNS is set up correctly
The OneDrive sync app uses Windows Push Notification Services (WNS) for optimum performance and battery life. Make sure you allow access from your network to the endpoints that OneDrive uses.
Check if users already have the OneDrive sync app
If the computers in your organization are running Windows 10, they already have the new sync app installed. If the computers have Office 2016 or Office 2013 (Home & Student, Home & Business, Professional, Personal, Home, or University) installed, they might also have the new sync app.
Note
Office is installed per machine, whereas OneDrive is installed per user by default. Learn about installing OneDrive per machine
Deploy any administrative settings
To set registry keys on computers in your domain, install OneDrive and copy the OneDrive.admx and OneDrive.adml files from %localappdata%MicrosoftOneDriveBuildNumberadm to your Group Policy central store. For more info, see Use Group Policy to control OneDrive sync app settings.
Use Microsoft Endpoint Configuration Manager to deploy the OneDrive sync app
- In Configuration Manager, select Create Device Collection, and follow the steps in the Create Device Collection wizard.
- Save the OneDriveSetup.exe installer for Windows to your local computer or a network share. Download the Production ring OneDriveSetup.exe installer for Windows or download the Deferred ring OneDriveSetup.exe installer for Windows.
- Download the sample Configuration Manager package. It's a .zip file that contains the script installer deployment type. For more information about packages and programs in Configuration Manager, see Packages and programs in Configuration Manager.
Note
The script installer deployment type already has a detection method script and will correctly assess the installation. Also, there is an uninstall switch, which means that you can easily remove the OneDrive sync app, if necessary.
- Copy the installer to a folder in the Configuration Manager source content share.
- In Configuration Manager, select the Software Library workspace. Under Application Management, right-click Applications, and then select Import Application.
- Select the sample package.
- On the bottom of Configuration Manager, select the Deployment Types tab, right-click the deployment, and to update the Content location, edit the properties.
- Right-click the package, select Deploy, and follow the steps in the Deploy Software Wizard.
If you don't use the sample package, run the following command using Microsoft Endpoint Configuration Manager:
(where pathToExecutable is a location on the local computer or an accessible network share).
Note
This command must be run at user logon and using Administrator permissions. It must be run for each user on a machine. For an example of how to deploy an .exe on every user account, see How to deploy the OneDrive sync app with Configuration Manager.
If you run the command with no command line parameter, users will see the installation status. After installation, OneDriveSetup.exe will automatically execute OneDrive.exe and display OneDrive Setup to users. If you run the command with the /silent parameter, OneDrive.exe will be installed transparently and OneDrive Setup won't appear. You'll need to run OneDrive.exe with an additional command. If you want to control the launch of OneDrive across your organization, we recommend using the /silent parameter.
If you run the command with no command line parameter, users will see the installation status. After installation, OneDriveSetup.exe will automatically execute OneDrive.exe and display OneDrive Setup to users. If you run the command with the /silent parameter, OneDrive.exe will be installed transparently and OneDrive Setup won't appear. You'll need to run OneDrive.exe with an additional command. If you want to control the launch of OneDrive across your organization, we recommend using the /silent parameter.
Learn more about application management in Configuration Manager.The installer will install the OneDrive executable file under %localappdata%MicrosoftOneDrive.
Deploy the RMS client to enable syncing IRM-protected files
The new OneDrive sync app for Windows now supports syncing IRM-protected SharePoint document libraries and OneDrive locations. To create a seamless IRM sync experience for your users, deploy to your users' computers the latest Rights Management Service (RMS) client from the Microsoft Download Center. Even if these computers have the Azure Information Protection client installed, which includes the RMS client, the OneDrive sync app still needs a separate installation of the RMS client from the Microsoft Download Center.
To silently install the RMS client on computers, use the /qn switch as part of the command-line options of the Microsoft Windows Installer Tool (Msiexec.exe). For example, the following command shows the silent mode installation (assuming the RMS Client installer package is already downloaded to C:Downloads)
You can have the setup file on a network share and use managed software deployment to run the msiexec command.
Note
The sync app does not support IRM policies that expire document access rights.
Help users sign in
To help users sign in, you can use silent account configuration or one of these methods:
- Use the following URL to start OneDrive Setup on users' computers. When users click to begin Setup, a sign-in window will appear for users can enter email address.
- Use the following URL with each user's email address to start Setup and prepopulate user email addresses in the sign-in window.
- Run the following command using Configuration Manager script:It starts the OneDrive process. If users haven't set up any accounts, it displays OneDrive Setup. To display OneDrive Setup specifically to users who haven't set up an account for your organization, use the command line parameter:
Note
When you use Microsoft Endpoint Configuration Manager, make sure you run OneDrive.exe with User permissions (not as an Administrator).
For help finding your tenant ID, see Find your Microsoft 365 tenant ID.
For help finding your tenant ID, see Find your Microsoft 365 tenant ID.
Auto-configure SharePoint site synchronization
Skype Command Line Switches For Macos Download
If you want to auto-configure a SharePoint site to be synced, you can use the URL below as a guide to build the path to the SharePoint site you want to sync automatically:
where:
- <siteId> is the SharePoint site siteId GUID, enclosed in curly brackets. You can get this GUID visiting https://<TenantName>.sharepoint.com/sites/<SiteName>/_api/site/id.
- <webId> is the SharePoint site webId GUID, enclosed in curly brackets. You can get this GUID visiting https://<TenantName>.sharepoint.com/sites/<SiteName>/_api/web/id.
- <webUrl> is the SharePoint site URL. You can get this URL visiting https://<TenantName>.sharepoint.com/sites/<SiteName>/_api/web/url.
- <listId> is the SharePoint site documents library GUID, enclosed in curly brackets. You can get this GUID visiting the document library in the browser, click in the gear icon and choosing 'Library Settings'. The URL will show the listId GUID at the end of URL, i.e. https://<tenant>.sharepoint.com/sites/<SiteName>/_layouts/15/listedit.aspx?List=%7Bxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%7D (a GUID with escaped curly brackets).
- <userEmail> is the OneDrive's user email address used to sign in into OneDrive.
- <webTitle> and <listTitle> are used to compose the name of the local folder where the OneDrive content is synchronized. By default, when you use the 'Sync' button when in the browser to synchronize a document library, OneDrive uses the SharePoint site name and the document library name to compose the local folder name, in the form of %userprofile%<TenantName><SiteName> - <DocumentLibraryName>. You could use any other values if you prefer to. If you do not use these parameters, the local folder will be named '
- Documents', despite of site and library names.
For example, if you want to synchronize https://contoso.sharepoint.com/sites/SalesTeam-01/ProjectX, where 'ProjectX' is the documents library to synchronize, to '%userprofile%ContosoSales - Unicorn' folder, you will need the following parameters to compose the odopen:// URL:
Skype Command Line Switches For Macos Mac
- siteId: {ssssssss-ssss-ssss-ssss-ssssssssssss}
- webId: {wwwwwwww-wwww-wwww-wwww-wwwwwwwwwwww}
- webUrl: https://contoso.sharepoint.com/sites/SalesTeam-01
- listId: {llllllll-llll-llll-llll-llllllllllll}
- userEmail: [email protected]
- webTitle: Sales (you would use SalesTeam-01 to mimic Sync button behavior instead)
- listTitle: Unicorn (you would use ProjectX to mimic Sync button behavior instead)
The resulting odopen:// URL will be:
You will need Client Side Object Model (CSOM) knowledge if you want to automate quering the team site to determine the appropriate siteId, webId and listId to build the appropriate URL.
Deploy the OneDrive app on mobile devices running iOS or Android
Windows Command Line Switches
You can use Microsoft Endpoint Configuration Manager to deploy apps to mobile devices. Before you do, however, you need to complete a few prerequisite steps because integration with Intune is required to manage mobile devices in Configuration Manager. For information about managing mobile devices with Configuration Manager and Intune, see Manage Mobile Devices with Configuration Manager and Microsoft Intune.
Deploy the OneDrive app for iOS
- In Configuration Manager, on the Home ribbon, select Create Application.
- In the Type box, select App Package for iOS from App Store.
- In the Location box, enter the app store URL, https://itunes.apple.com/us/app/onedrive/id823766827?mt=12.
- Target the app to users.
For more info, see Create iOS applications with Configuration Manager, and use as the app location, as shown below.
Deploy the OneDrive app for Android
Skype Command Line Switches For Macos Mac
- In Configuration Manager, on the Home ribbon, select Create Application.
- In the Type box, select App Package for Android on Google Play.
- In the Location box, enter the app store URL, https://play.google.com/store/apps/details?id=com.microsoft.skydrive&hl=en.
- Target the app to users.
For more info, see Create Android applications with Configuration Manager.