Open a file or folder.
The open command opens a file (or a folder or URL), just as if you had double-clicked the file's icon.
If no application name is specified, the default application as determined via LaunchServices is used to open the specified files.
You can specify one or more file names (or pathnames), which are interpreted relative to the shell or Terminal window's current working directory. e.g. open *.doc
Examples
GUI for Man pages on Mac OS X. It captures a list of all Man pages on the system, allows for searches by keyword and also a viewer within which to read and scroll. While the Terminal will do. The options specific to NFS filesystems are described in the mountnfs(8) manual page. The mount command calls the mount(2) system call to prepare and graft a special device or the remote node (rhost:path) on to the file system tree at the point node.
Open the current terminal working directory:
$ open .
Open demo.txt in the default application (as determined by LaunchServices):
$ open demo.txt
or
$ open /Volumes/Macintosh HD/demo.txt
or
$ open file://localhost/Volumes/Macintosh HD/demo.txt
Reveal in finder, the enclosing folder for a directory or file:
$ open -D demo.txt
Open a folder in the Mac Finder:
$ open /Volumes/Macintosh HD/Applications/
$ open ~/Library/Spelling/
This can also be done with a full path:
$ open file://localhost/Volumes/Macintosh HD/Applications/
Open demo.txt with a specific application (in this case, TextEdit):
$ open -a /Applications/TextEdit.app /Volumes/Macintosh HD/demo.txt
Open a URL:
$ open https://ss64.com/
Pipe the output of cal into TextEdit:
$ cal | open -a TextEdit -f
Edit demo.txt (will open in TextEdit):
$ open -e /Volumes/Macintosh HD/foo.txt
“Clothes make the man. Naked people have little or no influence on society” ~ Mark Twain
Related macOS commands:
echo - Display message on screen.
Article: TA24770 - Clear the Finder 'Open With' contextual menu (rename /Library/Preferences/com.apple.LaunchServices.plist).
Some rights reserved
Create, add files to, or extract files from an archive file in gnutar format, called a tarfile. Tape ARchiver; manipulate 'tar' archive files.
tar creates and manipulates streaming archive files.
This implementation can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, and shar archives.
The first synopsis form shows a 'bundled' option word. This usage is provided for compatibility with historical implementations. See COMPATIBILITY below for details.
Get Man Pages Mac Os
In -c, -r, or -u mode, each specified file or directory is added to the archive in the order specified
on the command line. By default, the contents of each directory are also archived.
In extract or list mode, the entire command line is read and parsed before the archive is opened.
The pathnames or patterns on the command line indicate which items in the archive should be processed.
Patterns are shell-style globbing patterns as documented in tcsh(1).
Environment
The following environment variables affect the execution of tar:
LANG The locale to use. See environ(7) for more information.
TZ The timezone to use when displaying dates. See environ(7) for more information.
Exit Status
The tar utility exits 0 on success, and >0 if an error occurs.
Examples
To tar and zip a file
To view a detailed table of contents for this archive:
To tar a folder (with all sub-folders and files)
The reverse process to extract the file
Extract a file, autodetecting the format, in this case an xz archive:
To extract all the C sources and headers from an archive named backup.tar:
Note that the pattern must be quoted to prevent the shell from attempting to expand it according the files in the current working directory (the shell does not have access to the list of files in the archive, of course).
To move file hierarchies, use a command line like this:
To create a compressed archive on diskette, using gzip(1), use a command-line like:
Note that you cannot mix bundled flags and --style flags; you can use single-letter flags in the manner above, rather than having to type tar --block-compress --gzip --verbose --file /dev/fd1a --block-size 20 tar/
The above-created diskette can be listed with
tar tvfbz /dev/fd1a 36
To join two gnutar archives into a single archive, use
tar Af archive1.tar archive2.tar
Mac Os X Man Pages List
which will add the files contained in archive2.tar onto the end of
archive1.tar (note that this can't be done by typing:
cat archive2.tar >> archive1.tar
because of the end-of-file block at the end of a gnutar archive).
To archive all files from the directory srcdir, which were modified after
Feb. 9th 1997, 13:00 h, use
Notes
Always tar -t before tar -x to check if the archive contents have been placed inside one subdirectory or will just spill all over the current directory.
The -C feature does not work like historical gnutar programs, and is probably untrustworthy.
The -A command should work to join an arbitrary number of gnutar archives together, but it does not; attempting to do so leaves the end-of-archive blocks in place for the second and subsequent archives.
The gnutar file format is a semi fixed width field format, and the field for device numbers were designed for 16 bit (8 major, 8 minor) and can not absorb our 32 bit (8 major, 16+8 minor) numbers.
Environment Variables
'To disarm the bomb simply enter a valid tar command on your first try. No Googling' ~ XKCD
Related macOS commands:
bzip2(1)
cpio - Copy files to and from archives.
compress - compress and expand data.
gzip - Compress or decompress files.
pax(1)
rmt - remote magtape protocol module.
info tar
Equivalent Windows command: TAR - Store, list or extract files in an archive.
Some rights reserved