Function of ‘cancel’ in Terminal
Just checking out some Terminal commands and I came across ‘cancel -a’
what does this command accomplish?
Thanks!
Just checking out some Terminal commands and I came across ‘cancel -a’
what does this command accomplish?
Thanks!
Cancels print jobs. The -a modifier means all print jobs. You can view any command in Terminal by typing "man", space, and the name of the command.
Cancels print jobs. The -a modifier means all print jobs. You can view any command in Terminal by typing "man", space, and the name of the command.
Excellent advice from @Mac Jim ID.
If you are new to the command line, then you may want to check out some tutorials such as this one (this tutorial is based on the Bash shell, but later versions of macOS default to using the Zsh for new installations...many of the tips will apply to both):
https://scriptingosx.com/2017/07/first-steps-in-terminal/
When searching online for information on the command line and various commands, you will encounter more references to Linux versions than macOS version. Many times the Linux information will be just as good for understanding a command if it is not a macOS specific utility. Many of the macOS command line utilities are using very old & outdated versions compared to the versions available in the Linux community so the macOS versions tend to have fewer features & options.
It is important to consider the shell being used since there may be some differences with them. Historically the Bash shell has been the default for many macOS & Linux operating systems for years, but macOS recently decided to default to Zsh (I think it began with macOS 10.15, but only on new installs although it is easy enough to switch back & forth between shells).
Make sure to have frequent and regular backups of the computer. It is very easy to make a mistake on the command line which could wipe out your data. A simple typographical error is all it takes sometimes (even users with decades of command line experience can fall prey to this once in a while). If you make a setting change or modify a file, make sure to first make a local copy of the file so you can compare the original and modded version when trying to reverse changes. With macOS before modifying a value in a setting, you should read the current value and mark it down so you can reverse the change since it can be difficult to know which macOS configuration file is modified by some macOS specific utilities.
Many times it is best to experiment with the command line using an older computer or a spare computer so if a mistake is made which is not easily corrected, then the impact is negligible and just requires a clean install of the OS. Or experiment within an OS within a Virtual Machine (you must be a bit careful not to make changes outside of the VM), but this is still safer than using the Terminal on the main host OS.
Function of ‘cancel’ in Terminal