Trending December 2023 # The Bash Special Characters You Should Know About # Suggested January 2024 # Top 20 Popular

You are reading the article The Bash Special Characters You Should Know About updated in December 2023 on the website Bellydancehcm.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 January 2024 The Bash Special Characters You Should Know About

Not all characters are equal in Bash. Some of them carry out special functions, tweak commands, and help us manipulate data. That’s why we’ve compiled the following list with the most important Bash special characters. Read on to find out how to use them and how they can make your daily Bash life easier.

Folder Path Separator (/)

In Bash, the forward-slash (/)separates the parts of a path, the subfolders-within-folders. To visit the folder named “pictures” inside your home folder, you’ll have to use the command cd as:

cd

/

home

/

USERNAME

/

Pictures

Everything after a forward slash in the above example resides within what precedes the slash.

Home Directory (~)

Instead of typing the full name of your home folder in your Bash terminal, you can use the tilde character (~). For example, to go to your home folder, use:

cd

~

You can also incorporate it into more complex paths. For example, to edit a file named “mydata.txt” inside the “Personal” folder in your Home directory, use:

nano

~

/

Personal

/

mydata.txt Current / Above Folder (.)

You can use a single (.) or double dot (..)to define whether an action should be performed inside the current directory or the one above, respectively. A single dot (.) maps to the current folder while a double dot (..) maps to the folder above it.

Let’s say you’re in the folder “/home/USERNAME/Pictures” and want to execute the script called “transform_images.sh” within the same directory. In this case, type:

sh

.

/

transform_images.sh

If, after executing the script, you want to return to the folder above the one you’re currently in, type:

cd

..

That would return you from the folder “/home/USERNAME/Pictures” to “/home/USERNAME.”

#!/bin/bash

cp

chúng tôi

/

home

/

USERNAME

/

scripts

/

file2.txt

Hashes are useful even if you’re not writing a script since they allow you to cancel parts of a command. To see that in action, try the following straightforward command:

echo

I am YOUR_NAME

Then, try the following instead:

echo

I am

#YOUR_NAME

You’ll only see “I am” returned in the second version because the hash will have canceled everything that followed after.

Ranges ([])

You can define character ranges by enclosing them in brackets ([]). To see that in action, let’s say you want to look for folder names that start with either D or M. Type:

ls

[

DM

]

*

Perhaps you’re in a folder filled with subfolders named after each year instead. To copy the folders for the previous five years into “/home/USERNAME/backup,” use:

cp

-r

201

[

56789

]

/

home

/

USERNAME

/

backup

You can even simplify them further with a dash (-):

cp

201

[

5

-

9

]

/

home

/

USERNAME

/

backup

Bash will iterate from 5 to 9 to include the numbers between them.

Suppose you have a huge file with thousands of entries and want to locate your name in it. Instead of searching for it in a text editor, do the following:

Tip: Learn more about pipes, data streams and redirection by using sed in Linux.

Command Separator (;)

Bash allows you to issue multiple commands in one go by separating them with semicolons (;). For example, to copy two folders to two different destinations with one command:

cp

-r

folder1 destination1;

cp

-r

folder2 destination2

The semicolon separates the two commands and tells Bash to execute them sequentially. Note that you can use more than two commands if you wish.

Wildcards (*)

You’ve probably already used the asterisk (*) in some commands. It matches any sequence of characters and allows actions like copying all JPG files from one folder to another:

cp

/

home

/

USERNAME

/

folder1

/*

.jpg

/

home

/

USERNAME

/

folder2

/

The question mark (?) is also a wildcard in Bash but only matches a single character. For example:

cp

/

home

/

USERNAME

/

201

?

/*

.jpg

/

home

/

USERNAME

/

folder2

/

The above command will copy all jpg files in folders that begin with “201.” Since the wildcard translates to any alphanumeric character, not only numbers, the above command would also copy any folder that might be named “201A” or “201z.”

Launch in Background (&)

You can run commands as background processes just by appending the command with an ampersand symbol (&):

Variables ($)

The dollar sign ($) allows you to set up variables for use in your commands. To see them in action, try entering the following in your terminal:

myname

=YOUR_NAME

myage

=YOUR_AGE

echo

"I'm

$myname

"

Note that there’s no dollar sign when assigning values to variables.

FYI: Bash variables can do more than just store static data. Learn how to create arrays and subshells inside shell variables.

Escapes () and Quotes (”)

If you want to use any of the special characters as it is in a command, you’ll have to escape it. You can do that by preceding the special character with a backslash (). For example, if you have a file with a name that includes an exclamation mark, you’d have to type ! instead for Bash to interpret it as an exclamation mark and not as a special character.

Another way would be using either single ('') or double-quotes (""). By enclosing a string in quotes, any special character in it will be treated as the actual character. There is a difference between single and double quotes, too. Single quotes will evaluate the enclosed string as text while double quotes allow you to use variables ($) within the enclosed string.

Aside from redirecting the output of programs, it is also possible to control where a program’s input comes from. The less-than (<) operator allows you to “pull” data out of files instead of “pushing” into them. For example, the following will remove all duplicate lines in the file “sort.txt” and sort them alphabetically:

A control character is an operator that allows you to include non-typeable characters inside your script. For example, the following will move the prompt one space down and one tab to the right:

printf

"

v

t

"

Control characters can support features such as Unicode formatting. It does this by using the x operator to interpret each byte value as a segment of a Unicode glyph.

The following code will print a null sign along with a delta character:

printf

"xe2x88x85 xe2x88x86

n

"

Note: You can find the hex value of your Unicode glyph by piping it to the xxd utility:

The Arithmetic Expansion character is an operator that can do mathematical equations without any external programs. It works by treating anything inside the expansion as arguments for an integer calculation.

For example, the following line will add two numbers and print the result on the screen:

echo

$

(

(

2

+

3

)

)

Further, you can also use variables inside any arithmetic expansion. The following code, for example, uses this as basis for a simple multiplication program:

#!/bin/bash

# Get the first ten multiples of a number.

for

(

(

i =

1

; i

<

=

10

; i++

)

)

;

do

echo

$

(

(

$1

*

$i

)

)

;

done

Evaluation Character

The Evaluation character is a logical operator that helps you create test conditions inside your scripts. It contains the ability to detect files as well as variable inequalities:

#!/bin/bash

string1

=

'Hello'

string2

=

'World'

if

[

[

$string1

!

=

$string2

]

]

;

then

echo

"The strings are not equal."

;

fi

The following example also uses the evaluation character as a way to test whether the current directory contains a “maketecheasier” file:

#!/bin/bash

if

[

[

-e

"maketecheasier"

]

]

;

then

echo

"There is a file with the name maketecheasier"

;

One of the downsides of the evaluation character is that it can only do a single test condition at any moment. To fix this, Bash provides two additional operators which extend the features of the evaluation character.

The AND character allows you to test two conditions and only return a value when both are true. For example, you can use it to make sure that a function will only run if it is in the right directory with the right file:

#!/bin/bash

target

=

"/home/ramces/maketecheasier"

if

[

[

$target

== $

(

pwd

)

&&

-e

"maketecheasier.txt"

]

]

;

then

echo

"Both conditions are true!"

fi

Similar to AND, the OR character also allows you to test two conditions in a single evaluation. However, it will return a value even if only one of the conditions is true. The following example uses this to check for two similar directories:

#!/bin/bash

then

echo

"A suitable directory exists!"

fi

Subshell Execution and Grouping

A subshell is an independent shell process that you can run from inside the current session. Unlike a regular shell, a subshell will only open when you call it and it will close as soon as it resolves.

This approach prevents subshells from passing information between other shells. For example, the cat program in the following code will not find “test.txt” even if the subshell goes to the right directory:

Frequently Asked Questions Is it possible to make a multi-line command in Bash?

Yes. You can do this by adding an escape character at the end of your command. This will move your cursor to the next line without running your program.

Can you get an earlier background program back to the foreground?

Yes. To do this, you need to run the jobs command and find the job number of the process that you want. Next, run fg followed by the number of your command to return it to the front.

Image credit: Xavier Cee via Unsplash. All alterations and screenshots by Ramces Red.

Ramces Red

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

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.

You're reading The Bash Special Characters You Should Know About

3 Best Things You Should Know About Hyperlocal Supply Chains

We talk about hyperlocal e-commerce in this article, explaining what a hyperlocal e-commerce business is and what you can expect to see in the next two years.

Hyperlocal Ecommerce Business

Hyperlocal online retail Business are popping up in urban areas all around the world.

I have been calling it the”mom and pop” response to large online retail companies.

In this informative article, I’m likely to breakdown what a hyperlocal e-commerce business is and what we could expect to see within another few years.

Related: – What is A Network-Based Supply Chain Platform?

What Do You Mean By Hyperlocal Ecommerce?

One distinct characteristic that puts a hyperlocal business aside from a massive merchant is that the whole supply chain is situated in near proximity to the purchaser and the vendor.

So, though the neighborhood coffee shop 5 blocks off does not provide,”Joe Blow” on Postmates, UberEats or some more localized support will bring coffee directly to your workplace or sofa for a minimal fee. Why not possess the hyperlocal business pickup windshield wipers for you from AutoZone to get a couple of added dollars; Query clips from Office Max?

The hyperlocal business operates within a neighborhood proximity to the large population and retail density. Thus a dependent subset supply series is made to appeal to the”on-demand” consumer. Essentially, the hyperlocal supply series is”piggybacking” on which the bigger brick and mortar retailers have in stock currently.

Related: – Supply Chains should Reduce their Plastic Footprint

What Is The Attraction To Hyperlocal?

Rate:-

Hyperlocal companies can provide products and services quicker than bigger online retailers. Hyperlocal food shipping period is currently less than one hour normally. Products that you would ordinarily need to purchase by a particular time to get next day support are now available for you in a matter of hours. Also, the majority of these deliveries are all located on your precise vicinity and not entirely dependent upon a street address.

Trust:-

The customer is put in a location where they can view and comprehend each of the measures of the distribution chain from buy to sourcing to shipping. Consumers understand where the item is created and most probably who’ll be delivering them. Hyperlocal companies have a massive incentive to catch and keep customers with building that confidence and improving the overall customer experience.

In layman’s terms, the beef tastes better once you understand the butcher and the butcher understands your cut. Word of mouth is going to be an integral element for hyperlocal small business success in their market communities.

Related: – Top 6 ways to Achieve supply Chain Sustainability

What’s Next?

The principles of hyperlocal ecommerce business continue to be composed.

As we see modifications to urban infrastructure and landscape, it is going to get easier for bigger eCommerce retailers to compete with all the hyperlocal groups of now.

In addition, I hope to see last-mile supply and B2B solutions emerging fast within dense urban cores, as spin-offs out of B2C versions.

This is particularly true in central business districts (CBDs) as workplace couriers branch away of conventional models.

Hyperlocal supply chains can alter the plan of restaurants, grocery shops and general retailers moving forward.

Drive-through/pickup lanes will soon be more streamlined to adapt and improve food shipping traffic. Grocery stores will probably be redesigned to reevaluate delivery orders.

Everything You Need To Know About The Iphone 4

Today Apple unveiled the long-awaited and imazing iPhone 4. Despite the fact Gizmodo spoiled the announcement, I’m still more than impressed with what I saw. Enough boring talk, let’s see what this iPhone 4 has to offer.

Features of the iPhone 4

9.3 mm thick (that’s 24% thinner than the iPhone 3GS)

Front-facing camera

Micro SIM

LED flash for the camera

A second microphone for sound cancellation

Integrated antennas

Glass on the front and the back

326 pixels per inch display

Powered by Apple’s A4 chipset

The integrated antennas

If you look at the edge of the iPhone 4, you will see 3 lines that are part of the structure of the device. With the iPhone 4, Apple introduced something new. The stainless steel band around the iPhone is actually part of the antenna system.

In other words, the iPhone 4 has got integrated antennas right in the structure of the phone.

Retina Display makes the iPhone 4 an HD device

In any display, there are pixels. Retina Display dramatically increases the pixel density by 4 in the same amount of chúng tôi result is that you get far more precised display.

Inside iPhone 4

Apple went with a Micro SIM because they needed the place for everything else, especially for the battery, which is the largest component of the iPhone 4.

A bigger battery

Because Apple gave the iPhone 4 a bigger battery and also because the A4 chip is better at power management, the battery life has been considerably improved. A fully charged iPhone 4 battery will get you as far as this

7 hours of 3G talk time

6 hours of 3G browsing

10 hours of wifi browsing

10 hours of videos

40 hours of music

300 hours in standby

Three-axis gyroscope

Don’t know what a 3-axis gyroscope is? Don’t worry, I guess no one knew what it was until Apple introduced it today. I’m still very confused what this is about but I’m sure we’ll learn more in the next few days.

My guess is that this is a much-improved accelerometer that will make your gaming experience better.

A 5MP camera

I was right when I predicted Apple will add a 5MP camera to the iPhone. Like Steve said, megapixels are nice but cellphone cameras are about capturing light. Apple kept the pixel sensors the same size while increasing them to 5MP.

Last but not least, the iPhone 4 also has a 5X digital zoom and a LED flash.

HD video recording

With such a nice camera, a powerful chipset, and a beautiful display like the iPhone 4, HD video recording doesn’t really come as a surprise.

iMovie for iPhone

Ok, now I’m going completely nuts just typing this. I can’t wait to have my hands on the new iPhone 4.

For great videos, you need a great video editor. That’s what Apple created with the iMovie for iPhone app.

With iMovie for iPhone, you will be able to edit your HD videos, add titles, transitions, import music from iTunes. According to Apple (and I believe it), there is nothing remotely comparable to this in terms of mobile video editing.

iMovie for iPhone will be for sale in the App Store for $4.99.

iPhone OS 4 is now iOS4

Apple renamed iphone OS to iOS. Why? I suppose the “phone” wasn’t needed anymore now that the same OS goes into the iPhone, the iPod Touch and the iPad.

iOS4 comes with over 1,500 developer APIs, the biggest of them being multitasking.

iOS4 will come to the iPhone 3G, 3GS and iPod Touch for free on June 21st.

Unified inbox

That’s one simple feature I’ve been waiting for a long time. Now you can get all your emails in one convenient spot.

Bing is not the default search engine

Remember the rumor saying the Bing would replace Google as the default search engine on the iPhone? Well, that was just a rumor. Although Bing will not replaced Google by default, it is an option you can choose in the settings, just like you can choose to make Yahoo your default search engine.

iBooks for iPhone

If you liked iBooks on the iPad, you will love it on the iPhone 4.

FaceTime brings video chat to the iphone 4

This front-facing camera is going to be very useful to make video calling with the iPhone 4.

The downside is that FaceTime is only for iPhone 4 to iPhone 4 and only works over wifi. Apple says they are talking with cellular providers to get things ready for them. AT&T must be shaking right now…

The upside? Apple is going to make FaceTime an open industry standard. I’m not sure but I think this means that devs will be able to work around it to integrate it in their apps (Skype?).

AT&T offering early upgrades

Steve Jobs confirmed that AT&T will be offering generous upgrade offers to anyone whose iPhone contract expires sometimes in 2010. If you’re one of those happy people, you’ll be able to get the new iPhone 4 at the same $199 or $299 as a new AT&T customer.

iPhone 4 for sale on June 24

Forget the crazy rumor saying the iPhone 4 would be on sale the same day as the announcement. That was just silly.

The iPhone 4 will be available for pre-order on June 15 and will be for sale in 5 countries on June 24 (US, France, UK, Germany and Japan). 24 more countries will get it in July, and 88 more in September.

Colors and Pricing

The iPhone 4 will come in black or white, in 16GB ($199) or 32GB ($299). I’m kinda disappointed about the poor storage capacity…

Conclusion

First, I really want to thank Ryan Block and all the Team at GDGT who provided me with all the images and part of the info contained in this article. Thanks GDGT.

I really trashed Apple and the iPhone 3GS last year because this device didn’t bring anything new. This year though, it’s an all new device, much more powerful and packed with features I couldn’t have dreamed of.

This is the Apple I like. This is a product I want to buy. This is something I believe in. The iPhone 4 is more than ever the phone of the future.

I’m not into waiting in line but I will pre-order my iPhone 4 as soon as it is possible.

What do you think of the iPhone 4? Are you impressed? Surprised?

Everything You Need To Know About The Satiating Diet

Reducing calories to lose weight might make you hungry and dissatisfied, and even make you so miserable that you give up eating well. But what if there were a diet that was made particularly to make you feel satisfied and full so that you would follow it? The core of the satiating diet is that.

Vegetables, fruits, lean proteins, whole grains, and certain healthy fats are all included in the satiating diet, along with a fiery pepper ingredient called capsaicin. Here is an explanation of how the diet program functions, if it promotes weight reduction, and what you might consume if you decide to try it.

What can you eat when following the Satiating diet?

The satiating diet takes cues from the Mediterranean diet by urging you to consume plenty of fresh fruits, vegetables, whole grains, lean proteins, and healthy fats in moderation.

The satiating diet emphasizes getting in touch with your body’s hunger cues and making healthy choices to satisfy those demands rather than prescribing set times of day to eat or not eat or solely focusing on calories and macronutrients.

Foods to avoid while following the Satiating diet

On the satiating diet, you will concentrate more on what you can eat and less on what you must avoid. Having said that, there are certain suggested rules to assist you in organizing your meals. Avoid foods that don’t promote general health, such as those that lack fiber, protein, or healthy fats.

Food containing trans fatty acids

Trans-fatty acid-containing foods

Foods containing too many saturated fatty acids

Avoid excess Alcohol consumption

Avoiding excess consumption of caffeinated drinks

Not consuming too much salt

Sustainability and practicality in everyday life: This diet may be simpler to follow since it focuses more on choosing wholesome foods that fill you up. The strategy is also practical and sustainable because it is meant to become a way of life.

Versatility − Since you won’t need to purchase any particular meals, you may find it simpler to follow the rules when eating out, at events, or while you’re on the go.

Charge − Your shopping spending shouldn’t increase as the satiating diet doesn’t call for you to buy any extra foods or supplements.

Safety − The satiating diet is generally safe for the majority of populations. Before implementing this strategy, you must speak with your doctor or dietician if you are on a controlled, low-calorie diet. Likewise, consult your doctor before beginning the satiating diet if you follow a specific diet for diabetes, hypertension, or any other medical condition.

General dietary habits − The satiating diet incorporates evidence-based recommendations for these meal selections and promotes a variety of wholesome, nutritious foods. The most nutrient-dense foods are frequently those that truly satisfy your hunger because they provide the nutrients your body needs for optimum health.

Balanced approach − With the satiating diet, no food is forbidden. Instead of adhering to a “don’t eat” list, you are urged to choose nutritious, satisfying foods that are typically available.

Losing weight sustainably − It is considerably less probable that you would feel starved and give up the diet because the satiating diet emphasizes keeping you full and content between meals. Sustained weight loss results from persistence and long-term lifestyle modifications.

Lack of resources about the plan − The satiating diet’s fundamental tenet was derived from a study. Hence the study is the only source of information regarding the diet. Following the satiating diet may create some difficulties for persons who would rather consult a book, online, or app that outlines the specifics of the diet.

There is no formal plan to follow − The satiating diet does not go into specifics about meal preparation, timing, calorie intake, or diet duration, in contrast to other well-known diet programs. For some people, a diet can be challenging to stick to because there aren’t any sample meals, weekly calendars, or details on specific macronutrients.

Calorie insufficiency − The satiating diet does not set calorie limits. Given that calorie intake is the primary element in weight maintenance, this might be challenging to control. If you have trouble controlling your portions, consult a qualified dietician.

Conclusion

Everything You Need To Know About The Deadly Meningitis Outbreak

Yeah. Two hundred and five cases reported so far. And 15 people have died.

The first case was reported on September 18 in Tennessee.

No. It was never spreading. It came from a pretty sizable batch of contaminated steroid medication. Over 17,000 doses shipped to 76 medical clinics in 24 states.

There’s a drug called methylprednisolone acetate—a steroid—that doctors sometimes inject into their patients’ necks and backs to ease pain. Millions of Americans get these injections, and it’s usually fine, because drug treatments are usually formulated in perfectly sterile Clean Rooms. This batch was apparently made in a not-so-Clean Room.

Not all of the doses got used. There were about 4,000 left when the CDC got wise to the contamination. So about 13,000 people could have been exposed, but it’s possible that some of the doses weren’t contaminated, and not everyone who was exposed will get sick.

Yeah. It’s pretty serious.

It is not.

Aspergillus and Exserohilum. Fungi.

They don’t have to–they’re already everywhere. Exserohilum is a common mold that grows in soil and on plants, and Aspergillus, another common mold, is probably growing somewhere in my kitchen, and possibly in my shower, right now.

Look, all I’m saying is, it’s very common, because it’s good at living in the same environment that we live in. We breathe it into our lungs on a daily basis.

Correct. That’s because these molds are great at colonizing our defenseless bread and houseplants, but pathetic when it comes to invading our bodies. In order to set up shop on your meninges, aspergillus and exserohilum would have to multiply in your mucous, get into your bloodstream somehow, survive the trip through your very well-defended bloodstream, and then squeeze past the immune fortress that separates your brain and spinal cord from the rest of your body. That last step, getting past what doctors call the ‘blood-brain barrier’, is nearly impossible for most pathogens. Meningococcus—the saliva-loving campus bug– has a few tricks up its membrane that allow it to achieve all of that, but unless your immune system is really hurting, like if you have another really serious infection going on, these common molds don’t have a prayer.

Remember how I said this medicine was for back and neck pain?

Well, that’s how. Aspergillus didn’t have to fight its way past anyone’s immune system. Doctors injected it directly into their spinal column, right under the meninges. Can’t ask for a better invitation than that.

Yeah. If they catch it early, they can treat people with heavy doses of antifungal medication. But it’s dicey. You’re dealing with something that can cause brain injury really fast. And it’s not what doctors are looking for when they encounter a case of meningitis.

Welllll… it’s not really a ‘drug manufacturer’ in the way you’re thinking. It’s a compounding pharmacy.

A compounding pharmacy. A company that mixes stuff together to make small batches of medicine. Like in the old movies, where the pharmacist has all those rows of jars on his shelves, and he combines different stuff to make everyone’s medicine.

Mine also glares at me.

Because the drug manufacturing companies don’t make all the medications that people need. If a drug isn’t making money, for example, the big companies may stop making and selling it. Compounding pharmacies can whip up those discontinued drugs or other specialized treatments on a small scale. These pharmacies are pretty rare but most big cities have at least one.

Excellent question.

Actually, they were. The same drug is available under several brand names.

No. They’re supposed to just be sort of filling this small role. They don’t invent drugs or even synthesize stuff from scratch, and they aren’t giant corporations. And they don’t have to answer to the FDA.

Well, drug manufacturers have to be licensed by the FDA. And the FDA is very meticulous and anal and annoying about stuff, so they do all kinds of ongoing quality control, and the drug manufacturers have to spend a boatload of money just complying. But compounding pharmacies are regulated by state rules. Which vary.

In this case, it appears that the pharmacy was able to make the treatment for cheaper—not surprising given that they don’t have to worry about FDA compliance—and the clinics were happy to buy it for cheaper. Most clinics aren’t exactly rich these days.

At this point, it’s safe to say she doesn’t.

Hard to say. On the one hand, all of the rules about drug safety that have been made so far have followed on the heels of a mistake like this. For example, the FDA didn’t exist until a bunch of kids died from contaminated vaccines. And after that, researchers could test new medicine on people without having to show it was safe first. Then one drug company decided to make a drinkable version of this treatment for strep throat, but the company used something similar to antifreeze, and 107 people died. So the rules changed again. On the other hand, there have been plenty of incidents over the past decade that haven’t resulted in any changes: a diabetes drug called Rezulin that caused toxic liver failure in some people, and an arthritis drug called Vioxx that was linked to heart attacks and strokes. There was a bill in Congress that would have required drug companies to do follow-up studies after their drugs hit the market–so they could catch problems with medications like Vioxx and Rezulin much earlier–but it didn’t end up getting pushed through to law. But this fungal meningitis outbreak is different. It’s a lot less murky. People are dying and the reason why isn’t that complicated.

10 Mac Terminal Commands You Should Know

One of the best ways to get the most out of Terminal on your Mac is to learn what all it can do for you. While it looks like more of a programmer’s thing, it is really easy to use once you have learned some commands for it. There are a number of commands, and they can accomplish different tasks for you.

Here we have compiled ten of those terminal commands that – as a Mac user – you should know.

1. Restart Your Mac When It Is Frozen

sudo

systemsetup

-setrestartfreeze

on

The above command helps you reboot your Mac when it is frozen. Just type it once in Terminal and it will reboot your machine whenever it freezes up.

2. Show Hidden Folders and Files

defaults

write

com.apple.finder AppleShowAllFiles

-bool

true

The above command enables Finder to show hidden files and folders on your Mac. It is quite useful when you wish to see the system folders that are hidden by default.

3. Disable Delete Prompt

defaults

write

com.apple.finder WarnOnEmptyTrash

-bool

false

It disables the prompt that you get while emptying the Trash on your Mac. All the files in the Trash will be gone without you first confirming the action.

4. Make Your Mac Speak Text

say TEXT

Enter anything in the place of TEXT in the above command and your Mac will speak it out for you. Sometimes it helps to hear things out loud, such as checking to see if it is correct or to fully understand what it means.

5. Activate AirDrop on Older Macs

defaults

write

com.apple.NetworkBrowser BrowseAllInterfaces

-bool

TRUE

While AirDrop can be used on newer Macs just out of the box, older Macs require you to execute the above command to enable the functionality. It lets you exchange files between several of your Macs instantly.

6. Rebuild the Spotlight Index

sudo

mdutil

-E

/

Spotlight lets you quickly search for files and folders on your Mac. In order to do that it builds an index of all the files for faster searching. Sometimes the index needs to be rebuilt for various reasons, and the command above lets you do that. It helps you rebuild the Spotlight index on your Mac.

7. Enable Text Selection in Quick Look

8. Prevent Your Mac From Sleeping

caffeinate

Like humans, your Mac does fall asleep when it is not used for a certain amount of time. To prevent your Mac from falling asleep you can use the above command.

9. Remove Dashboard From Your Mac

defaults

write

com.apple.dashboard mcx-disabled

-boolean

YES

When was the last time you used Dashboard on your Mac? If you do not remember you probably do not need it. The command above should help you remove it from your Mac.

If you ever want to get it back on your machine simply replace “YES” with “NO” in the above command, and it will be back.

10. See Commands History

history

Have you ever wondered what all the commands are that you have typed into the Terminal so far? The command above should list out all of those commands for you.

Conclusion

Knowing these commands should help you make the most out of the Terminal app on your Mac. It will no longer be an app that only a geek uses; it will become an app that everyone uses.

Mahesh Makvana

Mahesh Makvana is a freelance tech writer who’s written thousands of posts about various tech topics on various sites. He specializes in writing about Windows, Mac, iOS, and Android tech posts. He’s been into the field for last eight years and hasn’t spent a single day without tinkering around his devices.

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.

Update the detailed information about The Bash Special Characters You Should Know About on the Bellydancehcm.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!