The Mac OS uses the Unix Terminal Text environment. Come with us to get familiar with the complete set of commands in this environment.
Microsoft Windows, various distributions of Linux or Mac OS. No matter what system you use, you’ve probably heard about your operating system text environment and you may have used it.
Maybe you think that MACVAS is an intuitive operating system and there is no particular need to learn text commands; why should I learn Unix commands?
There are plenty of unix-based free and open source applications that will no longer require cost-effective peer-to-peer sharing and cost savings.
When you encounter problems with Spitlight, you can use Unix search tools.
You can automatically manage your files, folders and archives. To do this, just set up a Cron Job.
Text commands provide lower level access and more control over the system. You can increase the productivity of your system using text commands.
What is a Cheat Sheet?
It is difficult to mark all the commands in a text or programming language even for programmers and experienced users.
Therefore, there are cheat sheets; a list of all the commands that come to your aid in the time of oblivion.
You can find the Terminal application from Applications> Utilities or by searching it in Spotlight.
Mac cheat sheet
Ctrl + _ Undo (last command)
/ Top level level (/)
. (Single point) current path
.. (two points) mother path
~ Home path
Run command with super user privileges
List output as multi-column
List all items including single point and two points
The output of the file list as a result in each line
A / (slash), after each path, displays a * (star) after executable files and scripts and @ after a symbolic link.
Sort files by size
The list is in full view including file type, owner, date and time, path, and so on.
View files that are sorted according to the last edit time (newest first)
Create complete list with file size in kilobytes, megabytes or gigabytes
List of files plus size, owner and bookmark
Create a detailed list of content from a path (with hidden files).
File size and disk space
List of uses of each subcategory and its content
du -sh [folder]
Creates human readable output for all files in a path
Display the size and name of all files
du -sk * | sort -nr
List all folders and files, display the size by considering the subcategories. (If sk * is replaced by sm * the size will be in megabytes)
Calculation of system space
Calculate the system’s free space at 1000
File and directory management
mkdir <dir> Create a new folder named <dir>
mkdir -p <dir> / <dir>
Create nested folders
mkdir <dir1> <dir2> <dir3> Create multiple folders simultaneously
mkdir “<dir>” Create a folder with a space in the name
rmdir <dir> Clear a folder (the folder should be empty)
rm -R <dir> Delete a folder with its contents
touch <file> Create a new file without any extension
cp <file> <dir>
Copy a file to a folder
cp <file> <newfile> Copy a file to the current path
cp <file> ~ / <dir> / <newfile>
Copy a file in a folder and rename the file
cp -R <dir> <“new dir”>
Copy a folder in a new folder
cp -i <file> <dir>
If a file with the same name exists, it will alert you before copying
cp <file1> <file2> <file3> / Users / <dir>
Copy multiple files to a folder
mv * .png ~ / <dir>
Transfer all files with the PNG extension from the current path to another path
Ctrl + R
Searching for previous commands
history n Show the last executed commands. Using the number n limits the number of commands to n the last number
! [Value] Run the last command that starts with the value
!! Run the last command that was typed
Show home path permissions
ls -ld / <dir>
View permissions to read, write, and access a particular folder
chmod 755 <file>
Change the permission of a file to 755
chmod -R 600 <dir>
Change the permission of a folder (with its contents) to 600
chown <user>: <group> <file>
Appoint a file to a user or group. By adding -R the contents of the folder are also included
Output all running processes (a represents the processes of all users and x represents processes that are not connected to the terminal)
View all processes along with CPU usage, memory, PID and command
View live information about running processes
Processes displayed based on CPU usage (updated every 5 seconds)
Show processes based on memory usage
kill the PID
Stop processing using PID (This ID is visible in a column in the Activity Monitor)
ps -ax | grep <appname>
Find a process by name or PID
Get Ping from Host and View Status
Display WHOIS information of a domain
curl -O <url / to / file>
Receive file via HTTP, HTTPS or FTP
The next step is to customize the terminal
In this article, many commands are mentioned. Once you have mastered these orders, it’s time to personalize your terminal. In another article, this issue will be dealt with.