Advanced macOS Tricks and Utilities Using Terminal!
Summary
TLDRDans cette vidéo avancée de la série de conseils pour Mac, l'hôte introduit le concept de la ligne de commande et des outils Homebrew, principalement destinés aux développeurs mais également très utiles pour les utilisateurs avancés. Il explique comment installer Homebrew et des outils tels que Cask pour gérer les applications en dehors du Mac App Store, Htop pour surveiller les ressources système, Speedtest-CLI pour mesurer la vitesse Internet, youtube-dl pour télécharger des vidéos YouTube, et ImageMagick pour modifier des images. Le but est de présenter des alternatives puissantes et efficaces aux interfaces graphiques habituelles.
Takeaways
- 😀 L'épisode traite de l'utilisation avancée de la ligne de commande et de Homebrew, principalement destinés aux développeurs mais aussi utiles pour les utilisateurs de Mac.
- 🛠️ L'installation de Homebrew nécessite préalablement l'installation des outils Xcode, qui peuvent être obtenus via la commande 'xcode-select --install'.
- 📦 Homebrew est installé via une commande spécifique, qui demande confirmation et nécessite le mot de passe administrateur de Mac.
- 📝 L'utilitaire 'cask' de Homebrew permet de gérer les applications en dehors de l'App Store, y compris le téléchargement, l'installation, la mise à jour et la désinstallation.
- 🔍 'brew search casks' permet de rechercher des applications dans le catalogue de cask, tandis que 'brew cask install <nom>' installe une application spécifique.
- 🔄 'brew cask upgrade' met à jour toutes les applications installées via cask.
- 📊 L'application 'htop' offre une alternative graphique à Activity Monitor pour surveiller l'utilisation des ressources système et gérer les processus.
- 🌐 'speedtest-cli' permet de réaliser des tests de vitesse Internet directement depuis la ligne de commande, sans passer par un navigateur web.
- 📹 'youtube-dl' est un outil puissant pour télécharger des vidéos YouTube, y compris en haute résolution en utilisant 'ffmpeg'.
- 🖼️ 'imagemagick' est un outil polyvalent pour la manipulation d'images, permettant de changer de format, d'ajouter des effets et de redimensionner des fichiers graphiques.
- 🔧 L'utilisation de 'imagemagick' inclut des commandes pour redimensionner des images, ajouter des bordures, et même traiter plusieurs fichiers à la fois.
Q & A
Qu'est-ce que la ligne de commande et comment est-elle utilisée dans le script ?
-La ligne de commande, ou terminal, est un outil permettant d'interagir directement avec le système d'exploitation en utilisant des commandes textuelles. Dans le script, elle est utilisée pour installer et gérer des outils et des applications via Homebrew.
Pourquoi Homebrew est-il nécessaire avant de commencer avec les outils mentionnés ?
-Homebrew est un gestionnaire de paquets pour macOS qui facilite l'installation, la mise à jour, la maintenance et la désinstallation des applications et des outils. Il est nécessaire car les outils et les utilitaires mentionnés sont gérés via Homebrew.
Quel est le premier utilitaire mentionné dans le script et à quoi sert-il ?
-Le premier utilitaire mentionné est 'cask'. Il permet de télécharger, d'installer, de maintenir, de mettre à jour et de désinstaller des applications qui ne sont pas disponibles dans l'App Store de Mac.
Comment installer un paquet avec Homebrew ?
-Pour installer un paquet avec Homebrew, il suffit de taper la commande 'brew install' suivi du nom du paquet ou de l'utilitaire que l'on souhaite installer.
Quel est l'utilitaire 'htop' et comment l'utiliser ?
-Htop est un utilitaire alternatif à l'Activity Monitor de Mac qui affiche de manière graphique l'utilisation des ressources système, comme la charge du processeur et la mémoire. Il est utilisé en tapant 'htop' après l'avoir installé avec Homebrew.
Comment effectuer un test de vitesse Internet à partir de la ligne de commande ?
-Pour effectuer un test de vitesse Internet à partir de la ligne de commande, il faut d'abord installer l'utilitaire 'speedtest-cli' avec Homebrew, puis exécuter la commande 'speedtest-cli'.
Quel est l'utilitaire 'youtube-dl' et comment fonctionne-t-il ?
-Youtube-dl est un utilitaire permettant de télécharger des vidéos YouTube. Il peut être installé avec Homebrew et permet de télécharger des vidéos en utilisant des commandes spécifiques qui incluent l'URL de la vidéo et les options de qualité souhaitées.
Quel est l'utilitaire 'imagemagick' et quels types de transformations il peut effectuer sur des images ?
-Imagemagick est un utilitaire puissant pour manipuler des images. Il peut changer la résolution, ajouter des bordures, modifier les formats de fichiers et effectuer d'autres transformations basées sur les commandes fournies par l'utilisateur.
Comment la commande 'convert' dans ImageMagick permet-elle de modifier la taille et le format d'une image ?
-La commande 'convert' dans ImageMagick permet de spécifier l'entrée et la sortie de l'image, ainsi que les options de transformation comme le redimensionnement et le changement de format. Par exemple, 'convert input.jpg -resize 1920x1080 output.tiff' redimensionnera l'image en 1920x1080 et la sauvera au format tiff.
Quels sont les avantages de l'utilisation de Homebrew pour gérer les applications et les outils sur macOS ?
-Les avantages de l'utilisation de Homebrew incluent une installation plus rapide et plus simple des applications et des outils, la facilité de mise à jour et de désinstallation, et l'accès à une grande variété d'applications et d'outils qui ne sont pas disponibles dans l'App Store de Mac.
Comment le script recommande-t-il de trouver de l'aide pour les commandes Homebrew et les paquets ?
-Le script recommande d'utiliser la commande 'brew help' suivie du nom du paquet ou de l'utilitaire pour obtenir une liste des commandes disponibles et de leurs descriptions, offrant ainsi une aide pour l'utilisation de Homebrew et de ses paquets.
Outlines
😎 Introduction à la ligne de commande et Homebrew
Le script introduit la ligne de commande et les outils Homebrew, principalement destinés aux développeurs mais aussi utiles pour les utilisateurs avancés. Il explique comment installer Homebrew et les outils Xcode si ce n'est pas déjà fait, en donnant les commandes nécessaires à copier et coller directement dans le terminal. L'auteur assure que les liens vers ces commandes sont fournis en-dessous de la vidéo pour faciliter leur utilisation. Il insiste sur la puissance de Homebrew pour installer et maintenir des applications en dehors de l'App Store Mac.
🛠️ Utilisation de Cask et d'autres outils Homebrew
Le script présente Cask, un outil Homebrew qui permet de gérer les applications en dehors de l'App Store Mac, y compris le téléchargement, l'installation, la mise à jour et la désinstallation. Il montre comment rechercher et installer des applications telles que Discord en utilisant Cask. Ensuite, il introduit H top, un alternative graphique à Activity Monitor pour surveiller et gérer les ressources système, ainsi que speedtest-cli, un outil pour effectuer des tests de vitesse Internet à partir de la ligne de commande. Il mentionne également youtube-dl pour le téléchargement de vidéos YouTube et ffmpeg pour la conversion de vidéos.
🖼️ Manipulation d'images avec ImageMagick
Le dernier paragraphe du script se concentre sur ImageMagick, un outil puissant pour la manipulation d'images. Il explique comment utiliser ImageMagick pour appliquer des effets, redimensionner et changer le format des images. Des exemples de commandes sont donnés, montrant comment ajouter un bord à une image, la redimensionner et l'enregistrer dans un nouveau format. L'auteur démontre également comment utiliser ImageMagick pour traiter plusieurs fichiers à la fois, en changeant leur résolution et en préfixant leur nom avec 'small-' pour indiquer qu'ils sont plus petits que l'original.
Mindmap
Keywords
💡Command line
💡Homebrew
💡Xcode
💡Cask
💡Terminal
💡Installer
💡Utilitaire
💡ImageMagick
💡youtube-dl
💡H top
Highlights
Introduction to the command line and Homebrew, tools primarily for developers with cool options for Mac users.
How to install Homebrew and Xcode tools using the command line.
Cask, a utility for managing non-Mac App Store applications, including installation and updates.
Using 'brew search casks' to find and install Mac applications not available on the Mac App Store.
Installing and using Discord via Homebrew Cask for a streamlined installation process.
Updating all applications installed with Cask using 'brew cask upgrade'.
Introduction to 'htop', an alternative to Activity Monitor for system resource monitoring.
Installing and using 'htop' for a graphical representation of CPU and memory usage.
Using the command line for speed tests with 'speedtest-cli', an alternative to the web-based version.
Installing and using 'youtube-dl' for downloading videos from YouTube and other platforms.
Combining 'youtube-dl' with 'ffmpeg' for downloading videos in higher resolutions.
ImageMagick, a powerful tool for image manipulation with various effects and format conversions.
Demonstration of resizing and adding borders to images using ImageMagick.
Batch processing images with ImageMagick to resize and rename them efficiently.
The versatility of ImageMagick for changing image formats and applying effects.
Encouragement to consult ImageMagick's help documentation for its full capabilities.
A call to action for viewers to like, subscribe, and stay updated with tech videos.
Transcripts
this episode of our Mac tip series is a
little bit more advanced but fear not
because I'm here to help you through it
I'm introducing you to the command line
and homebrew tools designed primarily
for developers but with a few really
cool options and utilities for Mojo's
like you and I let's get started
everything we're going to be doing today
takes place inside of the command line
or terminal if you never use terminal
before you can navigate to applications
and then the utilities subfolder and
you'll find it inside or you can search
it via a spotlight once you open
terminal you'll find a window that looks
something like this now before we can do
anything with homebrew we actually need
to install it and so if you've installed
the Xcode tools before you will be able
to skip this step if you haven't you'll
most likely haven't type the following
command Xcode - select space - - install
by the way for the record if you miss
one of these commands and you probably
will they're all linked down below in
raw text so you can actually copy and
paste them into the terminal window
really easily so I get an error because
my command-line tools have already been
installed if you haven't installed them
yet you'll be prompted to do so and that
takes a couple of minutes once we've
installed those tools we can actually
install homebrew now this is a long
command so I would recommend copying and
pasting but once you paste it it's going
to ask you if you want to continue by
pressing return we will say yes we'll
need to give it our admin password on
our Mac and then it's gonna go to town
this also takes a couple of minutes once
we have the Xcode select tools and
homebrew installed it's ready to get
messing around with some cool utilities
so let's start it off the first utility
we're going to talk about is called cask
cask is incredibly powerful it allows
you to download install maintain updates
and uninstall non Mac App Store
applications there's a lot of apps for
Mac and a lot of them are not on the Mac
App Store this utility cask allows you
to basically maintain them without
having to go online and Google the file
and download the file and then install
it through the installer and then make
sure it stays updated and get babar no
no cask does all of that for you it's
one of my favorite utilities and it's
super super powerful to install it you
just type
install cask and homebrew will fetch the
package file and install it for you it
can take a couple of seconds now that
cask is installed we can start working
with it
now I should know that all of these
utilities are insanely powerful and I
couldn't possibly talk about everything
they're capable of in this video so if
you ever want to know what they can do
or if you ever get stuck type brew for
homebrew then the name of the package or
utility you're trying to use so in this
case cask and then type help and a list
of commands along with descriptions on
what those commands do will pop up and
show you basically how to use it so
first of all let's do brew search casks
this will show us the entire catalog or
list of hundreds of casks that are
available to us so you can see just how
insanely I mean there are tons and tons
of Mac apps that are listed in this
section that you can install using cask
now this isn't very helpful sorting
through this big massive list so there's
a built-in search functionality from
within cask you can type brew search and
then the name of an app so let's say I
don't know discord we type enter cask
we'll try and locate that package and if
it returns a result you can see there
you go there's the discord app that we
need to install so if we want to
actually install discord we can type
brew cask install and discord and it
will download that package and install
it for us really pretty awesome so it's
downloading it right now it will install
it without ever you popping up an
installer file so once we get to the end
no installation it does it all
automatically and then if we open
spotlight and type discord there it is
that's pretty awesome isn't it now if
you want to update stuff I can type brew
cask and then upgrade and that will
upgrade every single application that is
installed using cask on my Mac and you
can see because I've only installed
discord and it's already up to date
there's no casks to upgrade but this is
a super amazing option if you ever have
a lot of apps that are always bomb
barring you for updates especially the
crappy apps that take you back to Safari
to redownload the app and it's built
it's awful just use cask ii utility is
kind of a strange one but it's a really
cool one it's called each top so you've
probably used Activity Monitor before
and if you haven't well this is activity
monitor if your computer is slowing down
or whatever you can kind of see what the
different processes are and kill them
directly from this application it also
shows you your cpu load how much memory
you're using stuff like that but this
application I don't know I've never
found it to be well laid out and it
doesn't show you graphically how much
resources you're using and so H top is a
really really great alternative you can
install it by typing brew install H top
and it will download and install it once
it's installed we can type sudo H top
now we need to use super user privileges
it's gonna ask for our password because
we are actually monitoring the hardware
on the Mac which Mac OS requires
hardware level permissions for so once
we enter that it will show us this very
cool representation of how our system
resources are being used you can
actually see the per thread usage on my
8 core 16 thread CPU you can see a
graphical representation of how much
memory is being used you know so see
your uptime the number of tasks and you
can manage filter search and kill tasks
all from this window using the function
keys it's really really powerful and
really awesome if you're trying to seed
out or find some little spooky
application that's consuming more
resources than it should each top is
pretty slick next speedtest.net
sometimes you need to run a speed test
but going to speedtest.net is a real
nightmare they have a crappy website it
uses tons of resources it's just bad
well you can do that from the command
line if you type through install speed
test - CLI for command-line interface it
will install and once it's installed we
can enter speed test CLI and it will
actually run a speedtest.net speed test
without having to navigate to the web
browser you don't have to load the
massive webpage and have the ads on the
side it's all done directly through the
command line which is pretty slick so
right now it's testing my download speed
that has finished it will test my upload
speed and it will tell me the results
yes my office Internet is pretty crappy
are these getting a bit too out into the
woods for you alright let's take it back
to an easy one this is youtube-dl
it's pretty simple youtube download
that's right you can install it by
typing brew install you too
- do you're also going to need to
install ffmpeg if you want to download
videos in a resolution above 720p which
you probably do so type brew install
youtube - dl and then ffmpeg press enter
and it goes to town YouTube DL is one of
those utilities that is hyper powerful
so to really get a full scope of what
it's capable of you should consult the
help documentation but the formula that
I most frequently use to download the
highest resolution video available is
the following first of all we're going
to need to copy the URL of the video
we'd like to download to our clipboard
so go to Safari find a video you'd like
copy and then type the following command
youtube - DL - F best video so we're
requesting the highest resolution
available + best audio and again you can
define these manually you can define the
exact resolution that you want to
download it to if you'd like but these
are the defaults and then you type the
URL youtube-dl goes out fetches the
video and then shows you the download
progress on the five hundred eighty
three point three three megabyte file
now it's saving in a dot WebM dot WebM
is not natively supported inside of Mac
OS 10 so it's actually going to download
the file first and then it converts it
using ffmpeg to an mp4 by default but
you can leave it as a WebM if you'd like
or to change it to any file format you
can desire using one of YouTube's deals
very very powerful utilities just be
sure to read through this help
documentation because it can do a lot
and it's slicker than a GUI based
YouTube downloader okay you know what
they say the best for first and last
I don't admittedly use homebrew all that
often I do use cask almost on the daily
and this is the other application that I
use all the time it's called image magic
you can install it by typing brew
install and then image magic image magic
is really powerful
basically you provide an input file a
photo of any resolution size shape
what-have-you you can define some
effects that you'd like to apply if
desired and then you can choose an
export resolution a different file
formats different sizes doesn't matter
image magic will handle everything let
me show you some of the commands that I
use with frequency so you do need to
manually define your
input and output files I could do that
by just dragging this field dot jpg file
directly into the finder that shows the
path but I also need to provide an
output path which I have yet to do by
default it saves into the route of your
home folder but what I would recommend
is just defining the folder manually
before you start working with the the
utility so I type cd' desktop for
example to set my main directory as the
desktop so any file name that I type is
going to be assumed that it's on this
folder and when I choose my output file
I can just type the name of the file and
it will assume the same path to the
desktop so let's show you an example of
something that I do actually pretty
frequently let's do convert we need to
provide our input file now so let's do
the field dot jpg photo that field dot
jpg ok and then we need to I don't know
let's say let's add a border we can type
border we can then type what resolution
or what size we want our border to be
let's do it let's do a big one let's do
30 pixels by 30 pixels and then we need
to define the border color let's make
that white and then we need to output
our file so we'll call this bordered dot
let's do PNG ok so we're gonna change
the file format if I press Enter
there you go I have a new folder a new
file called border dot PNG not only did
it change the file format from jpg to
PNG but surely enough it added a 25 or
was it 30 a 30 pixel border around our
image pretty cool ok so what else can I
do
let's try a different command something
I would try frequently so let's do
convert let's do this same field dot jpg
folder or file and let's say it's too
big that did take a while it's clearly a
large file so let's see what resolution
are we working with here 3840 by 2160 if
we zoom up on screen you can see that it
is quite massive yeah that's definitely
beyond 1080p so let's go back to our
terminal window let's change the
resolution of this file so we are going
to type resize and then you can type the
length resolution that you like so we
could do like 1920 if we wanted to do
1920 by 1080 you can do any arbitrary
number you want and it will resize will
maintain the aspect ratio and
sighs so I could do like 1654 if I
wanted to and it will resize it properly
maintaining at sixteen by nine format
now if you wanted to find the other the
other lengths so instead of doing 1920
instead of doing the the long length if
we wanted to do the short length of the
photo we could do X 1080 and that will
still provide us a 1920 by 1080 format
or you can define the exact resolution
you want to export to if you know and it
will conform regardless so let's just do
1920 okay so we're going to resize it to
that and then we're going to change it
back to let's change it to a tiff file
for example so we're gonna call it
export dot T iff we press enter and
surely enough it pops up there it is
ready for viewing in a much smaller much
more digestible resolution to give you
an example of how truly powerful image
magic is let me show you a power user
demonstration so we're gonna say for
files that end in dot jpg so any file on
the desktop ending in dot jpg so that's
gonna be these two files obviously let's
well let's do convert them keeping their
original file name attacked and convert
sorry well let's change the resolution
first so we are going to say resize and
rather than manually defining a
resolution I could do that if I wanted
but these are different size files so
let's resize them to fifty percent of
their original size and then we are
going to change the name of the export
file to not just the same name but we're
going to change it to small - and then
use the original file name so now what's
going to happen if we press Enter
is it is going to export two photos it
has the same names they had before but
adds small as a prefix because that's
one of the things we requested and if we
note the resolution let's look at this
one so command I we can see that this
one is 500 by 478 pixels if we go to
this one will see that it is 250 by 239
pixels it's exactly the same image just
a little bit smaller image magic is
crazy powerful well folks if you enjoyed
this video please give it a like if you
didn't well that other button
seems to work okay to get subscribed for
more awesome tech videos like these but
most importantly and as always stay
snazzy
Browse More Related Video
Introduction au Système d'exploitation
Simuler la connexion entre ordinateurs avec Filius
Les permissions sur fichiers et répertoires - #Linux 1.7
Tuto comment peindre un mur blanc comme un pro
Notion tutoriel : Organiser ses vidéos Youtube et retenir l'essentiel grâce à Notion ▶️🏷️
How I made these VIRAL PowerPoints 🔥 (Pt.6)
5.0 / 5 (0 votes)