A Collection of the Best Commands for Terminal Mac Cheat

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)
Basic items
/ Top level level (/)
. (Single point) current path
.. (two points) mother path
~ Home path
sudo [command]
Run command with super user privileges
n

 

 

 

 

 

 

 

 

 

ls -C
List output as multi-column
ls -a
List all items including single point and two points
ls -1
The output of the file list as a result in each line
ls-f
A / (slash), after each path, displays a * (star) after executable files and scripts and @ after a symbolic link.
ls -s
Sort files by size
ls -l
The list is in full view including file type, owner, date and time, path, and so on.
ls
View files that are sorted according to the last edit time (newest first)
ls -lh
Create complete list with file size in kilobytes, megabytes or gigabytes
ls -lo
List of files plus size, owner and bookmark
ls -la
Create a detailed list of content from a path (with hidden files).
File size and disk space
two
List of uses of each subcategory and its content
du -sh [folder]
Creates human readable output for all files in a path
two-s
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)
df -h
Calculation of system space
df -H
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
Command history
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
Permissions
ls -ld
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
Processes
ps -ax
Output all running processes (a represents the processes of all users and x represents processes that are not connected to the terminal)
ps -aux
View all processes along with CPU usage, memory, PID and command
top
View live information about running processes
top-copy-5
Processes displayed based on CPU usage (updated every 5 seconds)
top-o rsize
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
Network
ping <host>
Get Ping from Host and View Status
whois <domain>
Display WHOIS information of a domain
curl -O <url / to / file>
Receive file via HTTP, HTTPS or FTP
ss

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.

What is your opinion about these orders? Do you use them? What is the text environment more than the graphical environment?

Leave a Reply

Your email address will not be published. Required fields are marked *