Trending February 2024 # Command Line New Features In Windows 10 # Suggested March 2024 # Top 2 Popular

You are reading the article Command Line New Features In Windows 10 updated in February 2024 on the website Hatcungthantuong.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested March 2024 Command Line New Features In Windows 10

Many changes were made in Windows 10 but some changes haven’t been discussed much. One of those changes has to do with the Command Line, and as such, we will focus on that.

Improvements to the Command Line in Windows 10

Now, there are several new changes Microsoft has done to the Command Line, and from what we can tell, developers and those regular folks who prefer to use the Command Line for various reasons, have found the changes quite pleasing.

Without wasting any time, then, let’s talk about some of the new stuff.

Tar and Curl support

As for CURL, well, it’s a CLI tool that allows for sending and receiving files. It supports several protocols, and guess what? Users can easily make an HTTP request and view the response from the Command Line.

Background tasks

It was always possible for Windows 10 users to run a background task, but the problem is, but the WSL console had to be kept running, or the task would end. With this newest update, users can run their background task without worrying about the WSL console.

You see, if its clothes, the tasks will continue to work, and that’s great.

Support for Unix Sockets

Here’s the thing, Unix Sockets were not supported on Windows 10, but that has all changed with the v1803 update. Additionally, it’s possible to communicate over Unix sockets between Windows and WSL.

There are several rules as to how this must work, so Microsoft requires you to read the information available via a blog post.

OpenSSH-based client and server

The OpenBSD Foundation were the ones who created the OpenSSH suite of tools. We understand this suite of tools were created for remote command-line administration, public/private key management, secure file transfers, and more.

With this new update, users now have the chance to play around with the SSH client and key agent. As for the SSH server, it’s an optional feature that is available on-demand.

These tools were hotly requested by the Windows 10 community, so a lot of folks should feel quite happy about what Microsoft has done.

Hyper-V and Enhance Session

In the past, it wasn’t possible for Linux VMs running on Hyper-V to benefit from an enhanced session mode, but this is no longer the case with the Windows 10 v1803 update. Microsoft says this is made possible by the open source XRDP project, which allows the company to interact with Linux VMs in the same way it interacts with Windows via the RDP protocol.

Should you give this a try, you’ll see significant improvements in the user experience, and that’s always good news.

UWP Console Applications

Microsoft is pushing the Universal Windows Platform (UWP) as the future, but despite years of improvements, it’s still limited when compared to the old ways of delivering applications. If you wanted to create a console application, the only option was to work with the legacy options, but now, this is no longer the case.

Yes, you’ve read correctly, UWP Console applications are now supported in Windows. Developers can now ship their Console Applications to the Microsoft Store whenever they please.

You're reading Command Line New Features In Windows 10

Command Line Parameters For Remote Desktop Connections In Windows 11/10

The Remote Desktop Connection (RSD) feature has been active in the Windows operating system since Windows NT Server 4.0; though as a Terminal Server. Come the Windows 10, RSD now exists as an inbuilt standalone app that can be accessed from not only Windows 10 computers but from major mobile and computer OS like Android, iOS, Linux, and Mac. RSD has been used by many companies and firms to control and operate computers in its network remotely. It is also essential for solving problems on devices you can’t access physically.

What is a Remote Desktop Connection?

Remote Desktop Connection (RSD), which is often shortened to Remote Desktop, is a feature created by Microsoft that allows a local computer to control a remote PC after connecting to it over the internet or a network.

Simply put, Remote Desktop Connection is the ability to connect and use another computer from your computer.

Before we proceed, note any edition of Windows can act as a Remote Desktop Client. But to host a remote season, you need a PC running Windows 11/10 Pro or Enterprise.

We have already seen the different ways to enable Remote Desktop Connection in Windows. Today, we will take a look at some command-line options for using RDP. Instead of starting Remote Desktop Connection from the Start menu, Windows 10/8/7 allows you to start it from the search box, from the Run dialog box, or from a command line. With these methods, you can use additional command line parameters to control how Remote Desktop Connection looks or behaves.

Command Line Parameters for Remote Desktop Connections

From the Run dialogue box or the Command Prompt, we can carry so many instructions easily. To see all the possible commands and a brief description you can access, copy and paste any of the commands below:

mstsc.exe /?

This is the syntax-

Continue reading to see a few descriptions:

Whenever you connect to the server, Windows opens a new user session. You can avoid this by opening a connection to the console. Add /console to the mstsc

mstsc /console

To open remote desktop session in full screen, run the command below (/f);

mstsc /f

To specify the remote computer name from the command, use the command below (/v);

mstsc /v:computername

Brief description of the Syntax above

"connection file" – Specifies the name of an .RDP file for the connection.

/admin – Connects you to the session for administering a remote PC.

In this version of Remote Desktop Connection, if the Remote Desktop Session Host role service is installed on the remote computer, running mstsc /admin will do the following (for the current connection only):

Disable Remote Desktop Services client access licensing

Disable time zone redirection

Disable RD Connection Broker redirection

Disable Remote Desktop Easy Print

Disables Plug and Play device redirection for this connection only.

Changes the remote session theme to Windows Classic View (if it’s available) for this connection only.

/f – Starts Remote Desktop in full-screen mode.

/public– Runs Remote Desktop in public mode.

/span – Matches the remote desktop width and height with the local virtual desktop, spanning across multiple monitors, if necessary. To span across monitors, the monitors must be arranged to form a rectangle.

/multimon – Configures the Remote Desktop Services session monitor layout to be identical to the current client-side configuration.

/edit – Opens the specified .RDP connection file for editing.

With the Remote Desktop Connection, you have access to only computers in your network. You can use only one remote desktop connection on Windows at a time, i.e., one remote user per Windows.

However, a PC running Windows 11/10 Server edition can run remote Sessions for different users at the same time.

Read next: How to use Windows Remote Desktop in Windows Home (RDP).

10+ New Features In Ios 10.2 Beta 1

Apple yesterday issued beta 1 of the forthcoming iOS 10.2 software update for the iPhone, iPad and iPod touch. For starters, iOS 10.2 beta 1 includes three new wallpapers, provides a bunch of new emoji as part of the Unicode 9.0 standard and gives Camera the optional ability to remember filter, Live Photo and mode settings.

Star ratings are back in the Music app and Videos has its own widget. Oh, and you can now annoy friends with a brand new animation in Messages.

Without further ado, here’s our video hands-on with iOS 10.2 beta 1 accompanied by a detailed description of all the new features and enhancements.

iOS 10.2 beta 1 is available to developers who are members of the Apple Developer Program as well as to public beta testers that enrolled in the Apple Beta Software Program. iOS 10.2 beta 1 arrived a week after iOS 10.1 with Portrait mode on the iPhone 7 Plus released for public consumption.

iOS 10.2 beta 1 video hands-on

As is our wont, we have analyzed iOS 10.2 beta 1 on our own devices in search of new features. Our resident video editor Andrew O’Hara then created a video hands-on to show you guys everything new and improved in iOS 10.2.

Don’t see the embedded clip? Watch it on YouTube!

Be sure to like and share video with friends and family and don’t forget to subscribe to iDownloadBlog’s YouTube channel on your way out for more cool vids from our team. Detailed overview of all the changes, improvements and new user-facing features in iOS 10.2 beta 1 follows further below.

Unicode 9.0 emoji

iOS 10.2 beta 1 builds on the 100+ new gender diverse emoji added in iOS 10.0 with a variety of newly added ones which happen to be part of the latest Unicode 9.0 specification. Unicode Consortium, the organization which develops the Unicode standard, released the Unicode 9.0 specification in June 2024.

Some of the new emoji from Unicode 9.0 that you can use in iOS 10.2 beta 1 include:

Animals & Nature

Butterfly

Owl

Shark

Food & Drink

Avocado

Bacon

Croissant

Pancakes

Whiskey glass

Smileys & People

Clown face

Cowboy hat face

Doctor

Drooling face

Face palm

Fox face

Firefighter

Lawyer

Mechanic

Person taking a selfie

Sideways laughing face

Scientist

Shaking hands

Sneezing face

Thumbs down

All told, there are more than a hundred new and improved emoji in this iOS beta release, including 22 new emoji in the “Smileys & People” category, 18 new “Food & Drink” emoji and a bunch of emoji in the “Activity,” “Animals & Nature” and “Objects” categories.

Andrew’s short and sweet video highlights some of the best new emoji in iOS 10.2.

Apple continues to focus on gender diverse characters because some of the newly added profession emoji are available in both male and female genders by way of tap-and-holding. Additionally, many of iOS’s existing emoji have been visually perfected and redesigned in iOS 10.2 beta 1, such as the alien emoji.

— Cabel (@cabel) October 31, 2024

These new emoji are also available on the Apple Watch with watchOS 3.1.1 beta 1 and on the Mac with macOS Sierra 10.12.2 beta 1.

Three new wallpapers

iOS 10.2 beta 1 includes three new wallpapers for your Lock and Home screen in Settings → Wallpaper. The new wallpapers are based on promotional graphics from iPhone 7 and iPhone 7 Plus marketing materials. Keep in mind that these new wallpapers are only available on the iPhone 7 and iPhone 7 Plus.

iDownloadBlog’s Wallpapers of the Week section has already highlighted the new wallpapers so check out Jim’s article if you wish to download and use these images on your iPhone, iPad or iPod touch.

“Celebrate” Screen Effect in Messages

iOS 10.2 beta 1 adds a new fullscreen animation to the stock Messages app, called “Celebrate”. You can use it like you would any other screen effect: type a message in the Messages text field, then tap and hold (or press with 3D Touch) the Send button to reveal the “Send with effect” menu.

Now tap the Screen tab at the top and swipe left or right to cycle through built-in screen animations. The new Celebrate screen effect joins the existing Balloons, Confetti, Lasers, Fireworks and Shooting Star animations.

If Reduced Motion has been turned on in Settings → General → Accessibility → Reduce Motion, be sure to slide the Auto-play Messages Effects switch to the ON position, as described in our how-to.

This will ensure that Messages will play bubble and screen effects and other animations even when Reduce Motion is on. iOS 10.1 or later is required for the Auto-play Messages Effects feature.

Preserve camera settings

The built-in Camera app has a new switch to remember your last known camera mode, last used filter and Live Photo setting. Go to a brand new Preserve Settings section underneath the Camera heading in Settings → Photos & Camera, then slide the Camera Mode, Photo Filter and Live Photo toggles to the ON position.

Enabling Camera Mode will preserve the last shooting mode, such as Video, Square, Portrait and more, rather than always launch Camera in Photo mode.

When Photo Filter is on, your device will remember the last used filter rather than automatically reset to None every time you use filters in the Camera app.

If your device supports Live Photos, you’ll also see a related Live Photo switch that tells iOS to stop resetting the Camera app to Live Photo every time it’s launched.

Sorting options for playlist, songs & albums

iOS 10.2’s Music app’s gained sorting options for playlists, songs and albums. To sort playlists, tap Library → Playlists, then tap Sort in the upper right and select a desired sorting mode for your playlists: Playlist Type, Title or Recently Added.

As for your songs and albums, you can now sort them by Title or Artist.

To sort albums, tap Library → Albums, then tap Sort in the upper right and choose Title or Album as your preferred sorting mode.

To sort songs, tap Library → Songs, then tap Sort in the upper right and choose Title or Album as your preferred sorting mode.

Star ratings on Apple Music

If you’re subscribed to Apple Music and have been wondering if Apple will bring back the beloved star rating system, you’ll be happy to learn that iOS 10.2 beta 1 now lets you rate songs on a scale of 1-5.

Go to Settings → Music and slide a new switch labeled Show Star Ratings to the ON position. This will ensure that your star ratings get remembered and synchronized with your other devices via iCloud.

Song-starring  is very convenient if you want to create Smart Playlists in iTunes that automatically update with, say, your three-star songs, just the best five-star tracks and so forth. Star ratings are found in the action sheets for songs: simply choose Rate Song at the menu’s bottom to select your star rating.

Don’t forget to tap Done to save the changes.

On devices with 3D Touch, you can simply press an item that you previously added to your library to access the star rating feature faster. Apple has acknowledged that star ratings do not affect For You recommendations. Star ratings for your music in iOS 10.2 beta 1 are in addition to the existing Love/Dislike system in the Music app.

Videos app gains its own widget

iOS 10.0 provides widgets for most of the stock apps, sans the stock Videos app.

iOS 10.2 beta rectifies that omission by implementing a brand new Videos widget which displays your downloaded movies and TV shows. Tapping any video on the widget starts the playback inside the Videos app. Any content not downloaded to the device via the Videos app won’t be displayed on the widget.

To add the widget to the Notification Center and Lock/Home screen 0, pull down on any Home screen and swipe right to get to the widgets, then tap Edit at the screen bottom.

Now tap the plus sign next to Videos underneath the More Widgets heading to add the Videos widget to your currently active widgets listed at the top of the interface. Optionally, grab Videos by its handle and drag it to a desired position. Tap Done to save the changes.

On devices with 3D Touch, add the widget faster by pressing the Videos icon on the Home screen. Now tap the Add option in the upper right corner of the Videos widget inside the 3D Touch shortcuts menu.

Press and Hold to Speak settings

You’ll find a new “Press and Hold to Speak” feature under your Home button Accessibility settings. Tap Settings → General → Accessibility → Home Button and choose how you want your iPhone, iPad or iPod touch to respond when the Home button is pressed and held.

You have three options available underneath the Press and Hold to Speak heading:

Siri—Summon Siri when you hold down the Home button. This is default behavior.

Voice Control—If you’d rather iOS’s classic Voice Control to respond when you press and hold the Home button, select this option. Tap Language below the Voice Dial Only heading to select the language you wish to use for Voice Control.

Off—Choose this if you don’t want anything to happen after you press and hold the Home button.

Keep in mind that choosing Voice Control will turn Siri off in Settings.

If Voice Control was selected before changing Press and Hold to Speak settings to Siri, a prompt will go up asking if you’d like iOS 10 to enable Siri on your behalf.

Emergency contacts

After installing iOS 10.2 beta 1 to an iPhone paired with your Apple Watch, launch the Health app and hit the Medical ID tab at the bottom to see a message informing you that your emergency contacts will be notified as soon as you have used the life-saving Emergency SOS feature on your Apple Watch.

Redesigned headphone icon in AirPlay menu

iOS 10.0 has brought out revamped device icons in the AirPlay menus that are accessible throughout iOS, including via Control Center, in the Music app, iOS media player and elsewhere in the system.

In iOS 10.2 beta 1, there’s now a cool new headphone icon which appears in the iOS status bar when a Bluetooth audio device has been paired with your iOS device. This icon showed up for owners of the new Beats Solo3 headphones with the Apple W1 chip a few days ago.

Previously, the iOS status bar presented any connected wireless headphones with a generic Bluetooth icon. The new headphone icon in the iOS status bar also displays your Bluetooth device’s battery charge, just like before.

Miscellaneous

Aside from the new features, iOS 10.2 beta 1 includes under-the-hood improvements that make your mobile experience more enjoyable and less buggy. For example, animations throughout the system have been sped up and run smoother than before.

I own an iPhone 7 Plus and iOS 10.0 and iOS 10.1 were prone to the frame-dropping issue. Pretty much all system animations used to stutter on prior iOS 10 releases, like the Home screen zooming animation, the slide-to-unlock animation, scrolling through lists and more.

Having updated my phone to iOS 10.2 beta 1, I immediately noticed that graphics performance has improved and many of the previously jerky animations now either run smoothly or drop fewer frames. Still, lots of work remains to be done before the iOS user interface will run at 60 frames per second.

This tweak when responding to a Messages notification with Quick Reply is very cool: if you launch the full Messages app in the middle of typing your response, any typed text is now saved and carried over. To open the full Messages app from a Quick Reply overlay, tap anywhere inside the conversation above the text field.

Now I’m not certain if this is a feature or a bug, but the Notification Center now automatically remembers the last place where you left off. For example: if you swipe right to get to your widgets before exiting the Notification Center, the next time you invoke the Notification Center you’ll be taken directly to your widgets.

If your device has 3D Touch, you’ll also notice subtle differences in the shortcuts menu transparency.

And last but not least, deselecting the Show Contact Photos option in Settings → Messages will now also remove profile pics from the chat heading at the top of the screen. Previously, contact photos were removed from the conversation list only.

How do you like iOS 10.2 so far?

Wrapping up, iOS 10.2 is shaping to be another major update following the release of iOS 10.1 with Portrait mode and a couple other improvements. With nearly a dozen new features and enhancements, iOS 10.2 should smooth out a few rough edges and improve experience for everyone.

What’s your favorite feature in iOS 10.2 beta 1 so far, and why? While we’re at it, what would you improve about iOS if you were Apple?

Turn Windows Features On Or Off; Manage Windows Optional Features In Windows 11/10

The Windows operating system offers several additional features that most of us may not need. But they are there if you need them! In this post, we will see how to Turn Windows features On or Off via the Control Panel, and how to add, remove or manage some Optional Features using Windows 11/10 Settings. PowerShell and Command Prompt methods have also been discussed here.

Manage Windows Optional Features in Windows 11/10

While the default installation is good for most of us, there may be some features that IT Pro’s, System Administrators or Developers may need. Windows allows you to install and activate such features. You can turn some features on or off using the Control Panel, or you may need to use the Settings app in Windows 11/10 if you need to add some optional features.

What are Optional features?

As the name implies, Windows Optional features are the features that may or may not be required by Windows users. Windows OS has an option to add or remove these features. We have already explained the process to manage Optional features in Windows 11/10 in this article.

How do I add or remove Windows features?

The option to add or remove Windows features is available in the Control Panel or Windows Settings. We have described the process to install Windows features on Windows 11/10 computers above in this post. You can do it in 5 ways.

1] Turn Windows features On or Off using Control Panel

The steps to turn Windows features on or off via Control Panel are the same for both Windows 11 and Windows 10 computers. Hence, it does not matter whether you are a Windows 11 or Windows 10 user, the procedure that we have explained below implies to both of these operating systems.

On a Windows Pro PC, you will see the following features that you can enable or disable at will.

.NET Framework 3.5

.NET Framework 4.6 Advanced Services

Active Directory Lightweight Services

Containers

Data Center Bridging

Device Lockdown

Hyper-V

Internet Explorer 11

Internet Information Services

Internet Information Services Hostable Web Core

Legacy Components like DirectPlay

Media Features

Microsoft Message Que Server

Microsoft Print to PDF

MultiPoint Connector

Print and Document Services

RAS Connection Manager Administration Kit

Remote Differential Compression API Support

RIP Listener

Services for NFS

Simple Network Management Protocol

Simple TCPIP services

SMB 1.0/CIFS Sharing Support

SMB Direct

Telnet Client

TFTP Client

Windows Identity Foundation 3.5

Windows PowerShell 2.0

Windows Process Activation Service

Windows Subsystem for Linux

Windows TIFF IFilter

Work Folders Client

XPS Services

XPS Viewer.

See this post if your Turn Windows Features on or off is blank or empty.

2] Manage Optional features via Windows Settings Windows 11

Windows 11 users have to go through the procedure explained below to manage optional features via Settings.

Launch Windows 11 Settings app.

Install or Optional features as per your requirements.

Let’s discuss these steps in detail.

1] Press Win + I keys to launch the Settings app.

You have to wait till Windows uninstalls that feature.

4] Now, let’s see how you can install an Optional feature in Windows 11. Microsoft has made some features optional in Windows operating system, as they may or may not be required by the users. Notepad and Wordpad are among the optional features in Windows 11/10. This is the reason why some users have found Notepad or Wordpad missing from their computers.

Windows 10

In this way, you can install Graphics Tools, Windows Developer Mode, Fonts and several other optional features like it.

3] Enable or Disable Optional Windows Features using Powershell

Windows Powershell is indeed a very powerful tool. You can do a lot of things with this command line too. While using this, we will first populate the list of available features, then we will be downloading the desired feature, and finally, we will be talking about enabling and disabling that feature.

So first, to populate the list of features, enter this command,

Get-WindowsOptionalFeature -Online

Get-WindowsOptionalFeature -Online -FeatureName *Type feature name*

Then, to enable any downloaded feature, enter this command,

Enable-WindowsOptionalFeature -Online -FeatureName “Type feature name” -all

Finally, to disable any enabled feature, enter this command,

Disable-WindowsOptionalFeature -Online -FeatureName “Type feature name” 4] Turn On or Off Optional Windows Features using Command Prompt

Now, type in the following command to populate the list of available features:

All you need to do now is copy the name of the feature that you need to enable.

DISM /online /enable-feature /featurename:[Enter the name of the feature here] -All

Now, to disable any feature that is enabled on your computer, you need to follow some separate steps.

DISM /online /disable-feature /featurename:[Enter the name of the feature here] -All

As a bonus, if you wish to check information in detail about a specific feature, enter this command,

DISM /online /get-featureinfo/featurename:[Enter the name of the feature here] 5] Enable or Disable Optional Windows Features using an external installation source

You can also fetch the latest features from an updated offline source.

This source can be an ISO or any other type of image or just a folder.

For that, all you need to do is decide if you want to use the Command Prompt or Windows Powershell.

If you are using the Command Prompt, enter this command,

And if you tend to use Windows Powershell command line, you can do it too. Just enter this command,

To get the latest features, you need to get the latest version of the image of the operating system that you are trying to install the feature from.

I hope this helps!

Related: Turn Windows features on or off stuck on Please wait.

Monitor Progress Of A Linux Command Line Operation

If you’re a Linux system admin, there’s no doubt that you must be spending most of your work time on the command line – installing and removing packages; monitoring system stats; copying, moving, deleting stuff; debugging problems; and more. There are times when you fire a command, and it takes a while before the operation completes. However, there are also times when the command you executed just hangs, leaving you guessing as to what’s actually happening behind the scenes.

Usually, Linux commands provide no information related to the progress of the ongoing operation, something that is very important especially when you have limited time. However, that doesn’t mean you’re helpless – there exists a command, dubbed pv, that displays useful progress information related to the ongoing command line operation. In this article we will discuss this command as well as its features through some easy-to-understand examples.

PV Command

Developed by Andrew Wood, PV – which stands for Pipe Viewer – displays information related to the progress of data through a pipeline. The information includes time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

“To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error,”

The above explains the command’s man page.

Download and Installation

Users of Debian-based systems like Ubuntu can easily install the utility by running the following command in terminal:

sudo

apt-get install

pv

If you’re using any other Linux distro, you can install the command using the package manager installed on your system. Once installed successfully you can use the command line utility in various scenarios (see the following section). It’s worth mentioning that pv version 1.2.0 has been used in all the examples mentioned in this article.

Features and Usage

A very common scenario that probably most of us (who work on the command line in Linux) would relate to is copying a movie file from a USB drive to your computer. If you try to complete the aforementioned operation using the cp command, you’ll have to blindly wait until the copying is complete or some error is thrown.

However, the pv command can be helpful in this case. Here is an example:

So, as you can see above, the command shows a lot of useful information related to the ongoing operation, including the amount of data that has been transferred, time elapsed, rate of transfer, progress bar, progress in percentage, and the amount of time left.

The pv command provides various display switches. For example, you can use -p for displaying percentage, -t for timer, -r for rate of transfer, -e for eta, and -b for byte counter. The good thing is that you won’t have to remember any of them, as all of them are enabled by default. However, should you exclusively require information related to only a particular display switch in the output, you can pass that switch in the pv command.

There’s also a -n display switch that allows the command to display an integer percentage, one per line on standard error, instead of the regular visual progress indicator. The following is an example of this switch in action:

This particular display switch is suitable in scenarios where you want to pipe the output into the dialog command.

Moving on, there’s also a command line option, -L, that lets you modify the data transfer rate of the pv command. For example, I used -L to limit the data transfer rate to 2MB/s.

As can be seen in the screenshot above, the data transfer rate was capped according to my direction.

Another scenario where pv can help is while compressing files. Here is an example of how you can use this command while compressing files using Gzip:

Conclusion

As you have observed, pv is a useful little utility that could help you save your precious time in case a command line operation isn’t behaving as expected. Plus, the information it displays can also be used in shell scripts. I’d strongly recommend this command; it’s worth giving a try.

Himanshu Arora

Himanshu Arora is a freelance technical writer by profession but a software programmer and Linux researcher at heart. He covers software tutorials, reviews, tips/tricks, and more. Some of his articles have been featured on IBM developerworks, ComputerWorld, and in Linux Journal.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

Mount & Unmount Drives From The Command Line In Mac Os X

You can mount and unmount drives, volumes, and disks from the command line of MacOS and Mac OS X.

This trick works with external USB disks, hard drives, Firewire, Thunderbolt, DVD’s, CD’s, network drives, even USB thumb drives, literally any volume that can be mounted and accessed through the incredibly helpful diskutil command. By using the command line to remount the drive, the entire process can be completed remotely if necessary through SSH, and without ever having to physically disconnect a drive from the Mac. This is infinitely useful for troubleshooting situations, for scripting and automation, and it’s a great trick for those of us who just like to tinker around in Terminal.

How to Unmount a Drive from Command Line on Mac

Let’s first cover unmounting drives. To do this you’ll need another volume attached or connected to the Mac in some form or another, then launch Terminal to get started (sits in /Applications/Utilities/).

1: List All Drives

The first thing you’ll need to do is list the connected drives. This will provide a list of all drives that are attached to the Mac, that are either mounted and unmounted, and all of their respective partitions. We are doing this so we can get the drive identifier, which is typically something like disk1s2, or disk2s2, etc

diskutil list

The output will look something like this:

2: Apple_HFS OSXDaily 15.7 GB disk1s2

For the sake of this example, we’ll focus on the attached drive named “OSXDaily”, which happens to be an external USB thumb drive that appears last in the list. Note the identifier for that drive is “disk1s2” and we’ll carry that to the next series of commands to unmount and remount it.

It’s probably worth mentioning that drives will always be located in /dev/ and thus /dev/ will always be prefixed to the identifier.

2: Unmount the Specified Drive

Still using the diskutil command, we’ll point it at the drive in question to unmount.

diskutil unmount /dev/disk1s2

This will report back the named volume and location has been unmounted, like so:

Volume OSXDaily on disk1s2 unmounted

That’s all there is to it. You’ll notice the drive is no longer accessible in Finder, but it will still be visible through diskutil from the command line, or the more familiar Disk Utility app in Mac OS X’s GUI.

How to Mount a Drive from the Command Line on Mac

If you can unmount a drive, of course you can mount or remount one too. The command sequence is very similar; locate the volume, then mount the drive.

1: Find the Drive to Mount

If you already know where the volume is located, you can ignore part 1 and jump straight to part 2, but let’s cover retrieving the volume identifier anyway. This time around we’ll shorten it a bit because we’ll assume we know the name of the drive to mount, thus we only need to locate the identifier. We’ll do this by using grep to shorten the output of the diskutil command like so:

2: Apple_HFS OSXDaily 15.7 GB disk1s2

That output is obviously much shorter than the full output of diskutil list which we showed above.

For this example, the drive “OSXDaily” is still located at /dev/disk1s2 and that’s what we’ll mount.

2: Mount (or Remount) the Drive

To mount (or remount) a drive, we’ll use the same diskutil command with a new flag and inputs like so:

diskutil mount /dev/disk1s2

Using the same examples as elsewhere, here is what the command and the output will look like:

Volume OSXDaily on /dev/disk1s2 mounted

This obviously mounts the drive again, and it will also make the mounted volume visible again in the Mac OS X Finder and to GUI-based apps in the various Open or Save dialog boxes.

How to Unmount & Remount a Drive / Volume in a Single Command

Want to quickly unmount and remount the same volume, essentially power cycling it’s connectivity to the Mac? You can do that in a single command by stringing the two together like so:

Want to quickly unmount and remount the same volume, essentially power cycling it’s connectivity to the Mac? You can do that in a single command by stringing the two together like so:

diskutil unmount /dev/disk1s2;diskutil mount /dev/disk1s2;echo "Remounted Volume"

This would look like the following when executed:

Remounted Volume

If you happened to be watching the volume in the Finder during this process, you would find it to disappear briefly, then reappear almost immediately. The last echo portion is optional but it makes the entire command action even more verbose.

Thanks to Nilesh for the tip inspiration

Related

Update the detailed information about Command Line New Features In Windows 10 on the Hatcungthantuong.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!