Sort
Profile photo for Lorin Ricker

Well, it is reasonable to assume that, in a GNU/Linux command line (shell), a "+" would "turn on" or enable a command option, while "-" would "turn off" or disable an option... Unfortunately, and for purely historical reasons, this assumption is wrong.

First of all, note that the "-" character is known (in English anyway) by several names, each name having a different meaning or connotation: dash (a generic name for it), minus (implying subtraction or negation), and hyphen (in the context of hyphenating or breaking words into syllables) are probably the most common ones.

In the context of the GN

Well, it is reasonable to assume that, in a GNU/Linux command line (shell), a "+" would "turn on" or enable a command option, while "-" would "turn off" or disable an option... Unfortunately, and for purely historical reasons, this assumption is wrong.

First of all, note that the "-" character is known (in English anyway) by several names, each name having a different meaning or connotation: dash (a generic name for it), minus (implying subtraction or negation), and hyphen (in the context of hyphenating or breaking words into syllables) are probably the most common ones.

In the context of the GNU/Linux command line, it's best to not use the name "minus" when talking about command options, thus removing the notion of "negation" from this use. It's more helpful, in the command line context, to refer to this character which leads (introduces) each command option as a "dash" or a "hyphen". In fact, the man-page (online documentation) for bash (see below) doesn't call the "-" character by any name... it just uses the character literally to stand for (name) itself.

A command option (or simply option) is also known as a switch or flag, and is always introduced (preceded) by one "-" or two "--" character(s). A single "-" is used to introduce single-character options like "-h", "-v" and "-d" (for example); this form is called a "short" or "single-character" option (switch or flag).

A double "--" is used to introduce what is called a "multi-character" or "long-form" option, like "--help", "--verbose" and "--debug" (for example).

The rules, conventions and common practice for command options in Unix-family shells are seemingly simple at first glance; here are some examples:

$ cp -v file1.txt subdir/file2.txt

This is a rather ordinary copy command, using the -v "verbose" flag to copy the first file into a subdirectory using a (slightly) different filename. Using more than one switch is likewise simple, in two equivalent forms:

$ cp -v -n file1.txt subdir/file2.txt # options specified separately...

$ cp -vn file1.txt subdir/file2.txt # ...or "combined" with one leading dash

Using the equivalent long-form flags:

$ cp --verbose --no-clobber file1.txt subdir/file2.txt

Here, -v is equivalent to --verbose, and -n is equivalent to --no-clobber (which means "don't copy if the target file already exists"; and note that the appearance of yet another hyphen in "no-clobber" is not a problem).

A few other things to note:

  • The rules for options are primarily enforced (by the software developers who write and maintain Unix and GNU/Linux programs designed for use at the command line) by convention, not by formal standards — certain rare exceptions to (breakages of) these conventions do exist across the large repertory of Unix/GNU/Linux command-line utilities.
  • Although there's a common practice, there is no formal standard which covers what a single-letter command option means, nor about using the same single letter to mean the same thing (option) across command utilities (programs). Thus, although -h usually (conventionally) means "display help", and -v usually means "verbose mode", this is not enforced, and some other program is free to define its own single-letter options any way it wants.
  • If both lower- and upper-case options exist for a particular command (program), such as -d and -D, they would implement different, distinct options, following the Unix principle of case-sensitivity.
  • Both short and long-form options can be used in the same command, but short-form options must appear before long-form options (this according to the bash man-page).
  • All options must appear following the command (program) name, but must precede any command arguments (things like filenames, directories, etc.).
  • Although the basic syntax involving command options is pretty simple — and this will suffice for most folk's casual use, there are more involved syntax rules for special and advanced situations. See the bash man-page for more information.

The notion, vocabulary, syntax and practice of Unix-family (including GNU/Linux) command line options inherits from the original Unix command shell, the Bourne shell sh, written in the mid-1970s by Stephen Bourne of Bell Labs, and first released in 1977 as a standard component of Unix Version 7 (see the Wikipedia articles: Unix shell; Bourne shell; Shell (computing); Comparison of command shells; and Command-line interface (command options) for a history of command-line shells in general, and likely more than you wanted to know about them).

On GNU/Linux, bash (the so-called "Bourne-Again shell") is the command-line shell distributed by most Linux distros by default. Other descendants of the original sh include csh (the "C shell"), ksh (the "Korne shell"), a POSIX shell (reference standard), and assorted ash, zsh, tcsh, scsh and pdksh shells. As all of these command-line shells operate within the Unix family of operating systems, they share the basic command option syntax using the "-" as the option-leading character.

Contemporary command-line interpreters (CLI, another name for a shell) which do not follow the "-" command option syntax include DCL (Digital Command Language on VMS and OpenVMS), CMD.EXE and COMMAND.COM (on Microsoft Windows). These command line syntaxes generally follow a convention for specifying command options which dates back to Digital Equipment Corporation's older CLIs on PDP-11 operating system like RT-11, RSX-11M and RSTS/E, where the command option is preceded (introduced) by a "/" slash.

Just for a quick comparison, the DCL (VMS) copy command which is (mostly) equivalent to the first cp command give above is:

$ COPY /LOG FILE1.TXT [.SUBDIR]FILE2.TXT

I've shown this command in upper-case, although it could have been entered in lower- or mixed-case — DCL case-folds lowercase letters into uppercase. Here, /LOG is (roughly) equivalent to -v and --verbose, and the VMS directory path specification [.SUBDIR] is equivalent to the Unix/Linux subdir/ ...

Where do I start?

I’m a huge financial nerd, and have spent an embarrassing amount of time talking to people about their money habits.

Here are the biggest mistakes people are making and how to fix them:

Not having a separate high interest savings account

Having a separate account allows you to see the results of all your hard work and keep your money separate so you're less tempted to spend it.

Plus with rates above 5.00%, the interest you can earn compared to most banks really adds up.

Here is a list of the top savings accounts available today. Deposit $5 before moving on because this is one of th

Where do I start?

I’m a huge financial nerd, and have spent an embarrassing amount of time talking to people about their money habits.

Here are the biggest mistakes people are making and how to fix them:

Not having a separate high interest savings account

Having a separate account allows you to see the results of all your hard work and keep your money separate so you're less tempted to spend it.

Plus with rates above 5.00%, the interest you can earn compared to most banks really adds up.

Here is a list of the top savings accounts available today. Deposit $5 before moving on because this is one of the biggest mistakes and easiest ones to fix.

Overpaying on car insurance

You’ve heard it a million times before, but the average American family still overspends by $417/year on car insurance.

If you’ve been with the same insurer for years, chances are you are one of them.

Pull up Coverage.com, a free site that will compare prices for you, answer the questions on the page, and it will show you how much you could be saving.

That’s it. You’ll likely be saving a bunch of money. Here’s a link to give it a try.

Consistently being in debt

If you’ve got $10K+ in debt (credit cards…medical bills…anything really) you could use a debt relief program and potentially reduce by over 20%.

Here’s how to see if you qualify:

Head over to this Debt Relief comparison website here, then simply answer the questions to see if you qualify.

It’s as simple as that. You’ll likely end up paying less than you owed before and you could be debt free in as little as 2 years.

Missing out on free money to invest

It’s no secret that millionaires love investing, but for the rest of us, it can seem out of reach.

Times have changed. There are a number of investing platforms that will give you a bonus to open an account and get started. All you have to do is open the account and invest at least $25, and you could get up to $1000 in bonus.

Pretty sweet deal right? Here is a link to some of the best options.

Having bad credit

A low credit score can come back to bite you in so many ways in the future.

From that next rental application to getting approved for any type of loan or credit card, if you have a bad history with credit, the good news is you can fix it.

Head over to BankRate.com and answer a few questions to see if you qualify. It only takes a few minutes and could save you from a major upset down the line.

How to get started

Hope this helps! Here are the links to get started:

Have a separate savings account
Stop overpaying for car insurance
Finally get out of debt
Start investing with a free bonus
Fix your credit

Profile photo for Satyam Mishra

Minus sign is put to differentiate options from parameters.

Profile photo for Brian Bi

In GNU programs generally, a command line option may have a short form, a long form, or both.

The short form is a single character, usually a letter, and preceded by a single hyphen, such as f in rm -f. Multiple short options may be combined, so that rm -rf is equivalent to rm -r -f. A short option may take an argument, which goes after the option either with or without intervening whitespace, so that for example gcc foo.c -o foo is equivalent to gcc foo.c -ofoo. If multiple short options are combined, only the last is allowed to take an argument.

The long form may be one or more characters, and

In GNU programs generally, a command line option may have a short form, a long form, or both.

The short form is a single character, usually a letter, and preceded by a single hyphen, such as f in rm -f. Multiple short options may be combined, so that rm -rf is equivalent to rm -r -f. A short option may take an argument, which goes after the option either with or without intervening whitespace, so that for example gcc foo.c -o foo is equivalent to gcc foo.c -ofoo. If multiple short options are combined, only the last is allowed to take an argument.

The long form may be one or more characters, and starts with two hyphens. Generally these are considered a GNUism. For example, every GNU program accepts the arguments --help and --version (yes, that includes GNU dd). Long options cannot be combined. If a long option takes an argument, it must be set off by either whitespace or an equals sign, so that, for example, grep --context=1 is equivalent to grep --context 1, but grep --context1 is invalid.

Almost all short options have a corresponding long option; rm -f is equivalent to rm --force. Many long options, though, have no corresponding short option. For programs like gcc with hundreds of options, this is clearly a mathematical necessity.

Two dashes alone indicate the end of options. If you have a file called -f, you can remove it with rm -- -f. (However, note that rm ./-f will also work, and is more portable.)

A single dash alone is usually interpreted to mean "standard input". For example, cat foo - bar will print the contents of file foo, followed by a copy of whatever you type into the terminal (followed by Ctrl-D to signal end of file), followed by the contents of file bar.

So to answer your question, an argument prefixed with two hyphens is simply a long option, and will likely not be recognized by non-GNU programs.

Profile photo for Jesse Pollard

Depends on the application…

But this is sometimes used to indicate that there are no options for the application that follow.

For a terminal application it is used to separate options that are for the TERMINAL emulation from the command and options for the application that is to be run under the terminal emulation.

In other cases, it is used to indicate “long option name” follows.

This is because the default option names (or most commonly used) are single letters, such as that for gnome-terminal:

gnome-terminal [-e, --command=STRING] [-x, --execute ] [--window-with-profile=PROFILENAME] [--tab-with-

Depends on the application…

But this is sometimes used to indicate that there are no options for the application that follow.

For a terminal application it is used to separate options that are for the TERMINAL emulation from the command and options for the application that is to be run under the terminal emulation.

In other cases, it is used to indicate “long option name” follows.

This is because the default option names (or most commonly used) are single letters, such as that for gnome-terminal:

gnome-terminal [-e, --command=STRING] [-x, --execute ] [--window-with-profile=PROFILENAME] [--tab-with-profile=PROFILENAME] [--window-with-profile-internal-id=PROFILEID] [--tab-with-profile-internal-id=PROFILEID] [--role=ROLE] [--show-menubar] [--hide-menubar] [--geometry=GEOMETRY] [--disable-factory] [-t, --title=TITLE] [--working-directory=DIRNAME] [--usage] [-?, --help]

The options with the [] show both the short form and long form identity for the option. For quick typing… the classic “-e” (which is to be followed by the string to execute); but where some self documentation is intended (like some scripts) the long form “—command=…” can be used instead.

In some cases “—” by iteself is used to indicate “no more input”.

How it is interpreted is up to each application.

Profile photo for Grammarly

Communicating fluently in English is a gradual process, one that takes a lot of practice and time to hone. In the meantime, the learning process can feel daunting: You want to get your meaning across correctly and smoothly, but putting your ideas into writing comes with the pressure of their feeling more permanent. This is why consistent, tailored suggestions are most helpful for improving your English writing abilities. Seeing specific writing suggestions based on common grammatical mistakes multilingual speakers make in English is key to improving your communication and English writing fluen

Communicating fluently in English is a gradual process, one that takes a lot of practice and time to hone. In the meantime, the learning process can feel daunting: You want to get your meaning across correctly and smoothly, but putting your ideas into writing comes with the pressure of their feeling more permanent. This is why consistent, tailored suggestions are most helpful for improving your English writing abilities. Seeing specific writing suggestions based on common grammatical mistakes multilingual speakers make in English is key to improving your communication and English writing fluency.

Regular feedback is powerful because writing in a language that isn’t the first one you learned poses extra challenges. It can feel extra frustrating when your ideas don’t come across as naturally as in your primary language. It’s also tough to put your writing out there when you’re not quite sure if your grammar and wording are correct. For those communicating in English in a professional setting, your ability to write effectively can make all the difference between collaboration and isolation, career progress and stagnation.

Grammarly Pro helps multilingual speakers sound their best in English with tailored suggestions to improve grammar and idiomatic phrasing. Especially when you’re writing for work, where time often is in short supply, you want your communication to be effortless. In addition to offering general fluency assistance, Grammarly Pro now includes tailored suggestions for writing issues common among Spanish, Hindi, Mandarin, French, and German speakers, with more languages on the way.

Features for all multilingual speakers

Grammarly’s writing suggestions will catch the most common grammatical errors that multilingual speakers make in English. For example, if you drop an article or misuse a preposition (such as “on” instead of “in”), our sidebar will flag those mistakes within the Fix spelling and grammar category with the label Common issue for multilingual speakers. Most importantly, it will provide suggestions for fixing them. While these errors seem small, one right after another can make sentences awkward and more difficult to absorb. Eliminating them all in one fell swoop is a powerful way to put a more fluent spin on your document.

Features for speakers of specific languages

With Grammarly Pro, speakers of French, German, Hindi, Mandarin, and Spanish can get suggestions specifically tailored to their primary language, unlocking a whole other level of preciseness in written English. For speakers of those languages, our sidebar will flag “false friends,” or cognates, which are words or phrases that have a similar form or sound in one’s primary language but don’t have the same meaning in English.

But now Grammarly Pro’s writing suggestions will catch these types of errors for you and provide suggestions on how to fix them. You can find these suggestions in the Sound more fluent category in our floating sidebar. Simply click on the suggestion highlighted in green, and voila, your English will be more polished and accurate.

PS: Tailored suggestions for other language backgrounds are on the way!

Profile photo for Quora User

The short answer is it's up to the person who wrote the software to decide how many hyphens to use and how to format options.

However there are some conventions:

  1. Generally a single letter option will be prefixed by a single hyphen (e.g. -a -l -t )
  2. Generally an option which is a word (like "amend" in your example) will have 2 hyphens (e.g. --size --type ).
  3. Often the single letter option with the single hyphen will be a short cut for a longer version (e.g. in ls --all and -a are equivalent).
  4. Sometimes the longer version will use "=" e.g.:
    myapp --user=bob
    whereas the short version won't
    myapp -u bo

The short answer is it's up to the person who wrote the software to decide how many hyphens to use and how to format options.

However there are some conventions:

  1. Generally a single letter option will be prefixed by a single hyphen (e.g. -a -l -t )
  2. Generally an option which is a word (like "amend" in your example) will have 2 hyphens (e.g. --size --type ).
  3. Often the single letter option with the single hyphen will be a short cut for a longer version (e.g. in ls --all and -a are equivalent).
  4. Sometimes the longer version will use "=" e.g.:
    myapp --user=bob
    whereas the short version won't
    myapp -u bob
  5. Generally, but again not always, single letter options with a single hyphen can be strung together whereas longer versions can't, such as "ls -lart" is the same as "ls -l -a -r -t"

However there are some notable exceptions, and in some cases (like tar or ps) the "-" isn't required at all.

Profile photo for Kyle Manel

A minus sign before the command name is a convention that login programs use to start login shells. A login program is a program where you typically type your password and that starts a session for you, such as login, sudo -i, su -, sshd, etc. A login shell is the initial shell of a text mode session.

What does it mean to have a minus sign as the first character of a command in htop output?
In htop, or other commands that show process status, all bash processes have in the command column: /bin/bash but one process has in the command column: -bash What does the leading minus/hyphen/d...
As an actuary, use your math skills to help bring predictability to an uncertain world.
Profile photo for David Gray

By “the terminal” I take it that you mean the common shells for Unix/Linux (or Mac Terminal…which is Unix-based).

The Unix programming environment has, for the most part, “evolved” rather than being “intelligently designed”. This aspect is well-illustrated by the manner in which named options to shell commands are specified.

The original model was for one-character flags which would be indicated as such by prefixing a “-” to them. For convenience, multiple such options could be concatenated after an initial “-” (they were one-character, after all).

Now not all early commands followed this scheme.

By “the terminal” I take it that you mean the common shells for Unix/Linux (or Mac Terminal…which is Unix-based).

The Unix programming environment has, for the most part, “evolved” rather than being “intelligently designed”. This aspect is well-illustrated by the manner in which named options to shell commands are specified.

The original model was for one-character flags which would be indicated as such by prefixing a “-” to them. For convenience, multiple such options could be concatenated after an initial “-” (they were one-character, after all).

Now not all early commands followed this scheme. For example, the tar command (short for “tape archive” but subsequently used for general packaging) dispensed with the “-” in front of its flags. (The “-” can now be used but it is safest to omit it.).

There is also the find command which uses wordy (non-single-character) commands each prefixed by a single “-”. As the number and complexity of the command sets of Unix shells increased, a better way of specifying such wordy commands was devised: they were each prefixed by “--… so that is one use

However the use of a leading “-” as (in effect) a keyword prevented it from being used as the initial character of an ordinary argument. Now since the shell was responsible for denying this capability to the user it was the shell’s responsibility to address it. This was done by recognizing the special argument “--” as an indicator that there are no more manifestly optional arguments on that particular command invocation … and that is the other use

As a side note, one might wonder why a singe, stand-alone “-” was not given that responsibilty. That was because that construct was already defined to mean “take standard input (stdin) from the terminal”.

Profile photo for Ankush Chauhan

These are not

command line arguments

but

command parameters\options

.

Just do ls --help and look at the options, it should be obvious to you.

It has nothing to do with parameters at all. Many options have a short form and a long form, and many have one and not the other.
And also, regarding parameters, it's simply that in the long form when they take a parameter it looks like it's always with an equa

These are not

command line arguments

but

command parameters\options

.

Just do ls --help and look at the options, it should be obvious to you.

It has nothing to do with parameters at all. Many options have a short form and a long form, and many have one and not the other.
And also, regarding parameters, it's simply that in the long form when they take a parameter it looks like it's always with an equals. But obviously short ones can take parameters just as much just they don't use an equals.
Here is an extract from man ls or ls --help. Notice how some have a long form without a short form (--author, --block-size). Some have a short form without a long form (-c, -f, -g), and some have both a long form and a short form (-A/--almost-all, -b/--escape)


In

The Art of Unix Programming [ http://www.faqs.org/docs/artu/index.html ]

Eric Steven Raymond describes how this practice evolved:


> In the original Unix tradition, command-line options are single letters preceded by a single hyphen... The original Unix style evolved on slow ASR-33 teletypes that made terseness a virtue; thus the single-letter options...

Profile photo for Quora User

Here’s the thing: I wish I had known these money secrets sooner. They’ve helped so many people save hundreds, secure their family’s future, and grow their bank accounts—myself included.

And honestly? Putting them to use was way easier than I expected. I bet you can knock out at least three or four of these right now—yes, even from your phone.

Don’t wait like I did. Go ahead and start using these money secrets today!

1. Cancel Your Car Insurance

You might not even realize it, but your car insurance company is probably overcharging you. In fact, they’re kind of counting on you not noticing. Luckily,

Here’s the thing: I wish I had known these money secrets sooner. They’ve helped so many people save hundreds, secure their family’s future, and grow their bank accounts—myself included.

And honestly? Putting them to use was way easier than I expected. I bet you can knock out at least three or four of these right now—yes, even from your phone.

Don’t wait like I did. Go ahead and start using these money secrets today!

1. Cancel Your Car Insurance

You might not even realize it, but your car insurance company is probably overcharging you. In fact, they’re kind of counting on you not noticing. Luckily, this problem is easy to fix.

Don’t waste your time browsing insurance sites for a better deal. A company called Insurify shows you all your options at once — people who do this save up to $996 per year.

If you tell them a bit about yourself and your vehicle, they’ll send you personalized quotes so you can compare them and find the best one for you.

Tired of overpaying for car insurance? It takes just five minutes to compare your options with Insurify and see how much you could save on car insurance.

2. Ask This Company to Get a Big Chunk of Your Debt Forgiven

A company called National Debt Relief could convince your lenders to simply get rid of a big chunk of what you owe. No bankruptcy, no loans — you don’t even need to have good credit.

If you owe at least $10,000 in unsecured debt (credit card debt, personal loans, medical bills, etc.), National Debt Relief’s experts will build you a monthly payment plan. As your payments add up, they negotiate with your creditors to reduce the amount you owe. You then pay off the rest in a lump sum.

On average, you could become debt-free within 24 to 48 months. It takes less than a minute to sign up and see how much debt you could get rid of.

3. You Can Become a Real Estate Investor for as Little as $10

Take a look at some of the world’s wealthiest people. What do they have in common? Many invest in large private real estate deals. And here’s the thing: There’s no reason you can’t, too — for as little as $10.

An investment called the Fundrise Flagship Fund lets you get started in the world of real estate by giving you access to a low-cost, diversified portfolio of private real estate. The best part? You don’t have to be the landlord. The Flagship Fund does all the heavy lifting.

With an initial investment as low as $10, your money will be invested in the Fund, which already owns more than $1 billion worth of real estate around the country, from apartment complexes to the thriving housing rental market to larger last-mile e-commerce logistics centers.

Want to invest more? Many investors choose to invest $1,000 or more. This is a Fund that can fit any type of investor’s needs. Once invested, you can track your performance from your phone and watch as properties are acquired, improved, and operated. As properties generate cash flow, you could earn money through quarterly dividend payments. And over time, you could earn money off the potential appreciation of the properties.

So if you want to get started in the world of real-estate investing, it takes just a few minutes to sign up and create an account with the Fundrise Flagship Fund.

This is a paid advertisement. Carefully consider the investment objectives, risks, charges and expenses of the Fundrise Real Estate Fund before investing. This and other information can be found in the Fund’s prospectus. Read them carefully before investing.

4. Earn Up to $50 this Month By Answering Survey Questions About the News — It’s Anonymous

The news is a heated subject these days. It’s hard not to have an opinion on it.

Good news: A website called YouGov will pay you up to $50 or more this month just to answer survey questions about politics, the economy, and other hot news topics.

Plus, it’s totally anonymous, so no one will judge you for that hot take.

When you take a quick survey (some are less than three minutes), you’ll earn points you can exchange for up to $50 in cash or gift cards to places like Walmart and Amazon. Plus, Penny Hoarder readers will get an extra 500 points for registering and another 1,000 points after completing their first survey.

It takes just a few minutes to sign up and take your first survey, and you’ll receive your points immediately.

5. Get Up to $300 Just for Setting Up Direct Deposit With This Account

If you bank at a traditional brick-and-mortar bank, your money probably isn’t growing much (c’mon, 0.40% is basically nothing).

But there’s good news: With SoFi Checking and Savings (member FDIC), you stand to gain up to a hefty 3.80% APY on savings when you set up a direct deposit or have $5,000 or more in Qualifying Deposits and 0.50% APY on checking balances — savings APY is 10 times more than the national average.

Right now, a direct deposit of at least $1K not only sets you up for higher returns but also brings you closer to earning up to a $300 welcome bonus (terms apply).

You can easily deposit checks via your phone’s camera, transfer funds, and get customer service via chat or phone call. There are no account fees, no monthly fees and no overdraft fees. And your money is FDIC insured (up to $3M of additional FDIC insurance through the SoFi Insured Deposit Program).

It’s quick and easy to open an account with SoFi Checking and Savings (member FDIC) and watch your money grow faster than ever.

Read Disclaimer

5. Stop Paying Your Credit Card Company

If you have credit card debt, you know. The anxiety, the interest rates, the fear you’re never going to escape… but a website called AmONE wants to help.

If you owe your credit card companies $100,000 or less, AmONE will match you with a low-interest loan you can use to pay off every single one of your balances.

The benefit? You’ll be left with one bill to pay each month. And because personal loans have lower interest rates (AmONE rates start at 6.40% APR), you’ll get out of debt that much faster.

It takes less than a minute and just 10 questions to see what loans you qualify for.

6. Lock In Affordable Term Life Insurance in Minutes.

Let’s be honest—life insurance probably isn’t on your list of fun things to research. But locking in a policy now could mean huge peace of mind for your family down the road. And getting covered is actually a lot easier than you might think.

With Best Money’s term life insurance marketplace, you can compare top-rated policies in minutes and find coverage that works for you. No long phone calls. No confusing paperwork. Just straightforward quotes, starting at just $7 a month, from trusted providers so you can make an informed decision.

The best part? You’re in control. Answer a few quick questions, see your options, get coverage up to $3 million, and choose the coverage that fits your life and budget—on your terms.

You already protect your car, your home, even your phone. Why not make sure your family’s financial future is covered, too? Compare term life insurance rates with Best Money today and find a policy that fits.

Profile photo for Quora User

./ Here . represent current directory and / is for the file or directory.

The Common use of this command is for .sh file which are executable files and .sh is specific for shell executable.

Alternative for this command /path/to/script/script_name

As . Refer to current position you can also use ./

For example

Here you see there is an executable file called File_permission and it is present inside /Users/mukulgautam/, to execute this script we have two ways.

  • Run directly using full path of file like this
  • Or use ./ command but to this first navigate to script file location and then run as shown in image

./ Here . represent current directory and / is for the file or directory.

The Common use of this command is for .sh file which are executable files and .sh is specific for shell executable.

Alternative for this command /path/to/script/script_name

As . Refer to current position you can also use ./

For example

Here you see there is an executable file called File_permission and it is present inside /Users/mukulgautam/, to execute this script we have two ways.

  • Run directly using full path of file like this
  • Or use ./ command but to this first navigate to script file location and then run as shown in image.
Profile photo for Wayne Lewis

There is no specific meaning for -s in Linux commands, it is entirely up to the author of the program to assign. You can always find out by reviewing the man command for the terminal program you want to know about:

$man ls

In this case, the part of the man page for ls talking about the -s option is:

-s Display the number of file system blocks actually used by each

file, in units of 512 bytes, where partial units are rounded up

to the next integer value. If the output is to a terminal, a

total sum for all the file sizes is output on a line before the

listing. The environment variable BLOCKSIZE overrid

There is no specific meaning for -s in Linux commands, it is entirely up to the author of the program to assign. You can always find out by reviewing the man command for the terminal program you want to know about:

$man ls

In this case, the part of the man page for ls talking about the -s option is:

-s Display the number of file system blocks actually used by each

file, in units of 512 bytes, where partial units are rounded up

to the next integer value. If the output is to a terminal, a

total sum for all the file sizes is output on a line before the

listing. The environment variable BLOCKSIZE overrides the unit

size of 512 bytes.

Profile photo for Manuel López

Whenever you want or need to know something about linux commands (more properly, shell commands) or *NIX programs, like ls in this case (yes, it is a separate “system” program, not a shell (sh, bsh, bash, csh, zsh… you name it) internal command), one must recall that MANY has a manual entry, so, if you type

  1. $ man ls 

you will get the “instruction manual” for the command/program ls. Something like this:

As you can see, the -a option instructs ls to not ignore entries starting with . and, as you may know, “current directory” is the . “file”, while “previous directory” is the .. “file”. And, more int

Whenever you want or need to know something about linux commands (more properly, shell commands) or *NIX programs, like ls in this case (yes, it is a separate “system” program, not a shell (sh, bsh, bash, csh, zsh… you name it) internal command), one must recall that MANY has a manual entry, so, if you type

  1. $ man ls 

you will get the “instruction manual” for the command/program ls. Something like this:

As you can see, the -a option instructs ls to not ignore entries starting with . and, as you may know, “current directory” is the . “file”, while “previous directory” is the .. “file”. And, more interestingly, hidden files begin with . because, as you see, ls does not show files beginning by . per se. So, technically, they are not hidden files, simply “ignored by the file listing program” files. :-D

As stated in other answer, configuration files are usually “hidden” files, like .profile .bashrc .zshrc .vimrc etc, etc, etc… And it is useful to use the -a option to show them. As you can also see in the image above, you can use the -A to show the directories and files “hidden” (yes! directories beginning with . are hidden! . and .. are directories :-) ), as this option show all of them except, precisely, the “this” and “previous” directories entries.

Profile photo for Rory Browne

Depends on the context. It can mean practically anything.

The best example I can think of is where it means Stdin or Stdout, when used in place of a file to be read from or written to respectively.

Eg

  1. print_tar_to_stdout | tar -zxf -  
  2. tar -zcf - . /stuff | process_tar_file 

Other uses would telling the command that there is a lot to be flags.

  1. ls -lrt 
  2. ls --long 

In the first example the single - indicates that there are going to be flags, specifically the l, r, and t flags respectively. The second - in the latter shows that this is going to be a long firm option. This however is just one particular conve

Depends on the context. It can mean practically anything.

The best example I can think of is where it means Stdin or Stdout, when used in place of a file to be read from or written to respectively.

Eg

  1. print_tar_to_stdout | tar -zxf -  
  2. tar -zcf - . /stuff | process_tar_file 

Other uses would telling the command that there is a lot to be flags.

  1. ls -lrt 
  2. ls --long 

In the first example the single - indicates that there are going to be flags, specifically the l, r, and t flags respectively. The second - in the latter shows that this is going to be a long firm option. This however is just one particular convention; the thing about conventions is there are many to choose from.

Profile photo for Quora User

Dot character and $ character depends on your usage.

Can you modify your question to exact query.

Dot character at windows:

a) Change directory to current directory

C:\Windows\System32> CD .

b) Change directory to parent directory

C:\Windows\System32> CD ..

c) Executing a binary at command prompt:

Using dot backslash character

C:\Program Files (x86)\Microsoft\Edge\Application> .\msedge.exe

d) echo PATH environment variable:

C:> ECHO %PATH%

C:> ECHO %CD% current directory

C:> ECHO %COMPUTERNAME%

C:> echo testing | C:\Windows\System32\find.exe “murugesan openssl”

C:> echo %ERRORLEVEL%

1

e)

bash.exe and simulating

Dot character and $ character depends on your usage.

Can you modify your question to exact query.

Dot character at windows:

a) Change directory to current directory

C:\Windows\System32> CD .

b) Change directory to parent directory

C:\Windows\System32> CD ..

c) Executing a binary at command prompt:

Using dot backslash character

C:\Program Files (x86)\Microsoft\Edge\Application> .\msedge.exe

d) echo PATH environment variable:

C:> ECHO %PATH%

C:> ECHO %CD% current directory

C:> ECHO %COMPUTERNAME%

C:> echo testing | C:\Windows\System32\find.exe “murugesan openssl”

C:> echo %ERRORLEVEL%

1

e)

bash.exe and simulating Linux oriented commands at windows:

$ cd /usr/bin

$ ./ls

$# or based on your OS

$ ./ls.exe

$ echo $PWD like %CD% at windows

$ echo $? result of previous command zero or non zero like %ERRORLEVEL% at windows.

$ echo export search=\"murugesan openssl\" > delete.txt

$ chmod u+x ./delete.txt

$ ./delete.txt

$ echo "search : $search : not set"

search : : not set

$ . ./delete.txt

$ #execute above script to current shell

$ echo "search : $search : set"

search : murugesan openssl : set

$$ represent the previous process executed at background process.

Example at bash.exe on windows:

C:> bash.exe

$ a.out >/dev/null 2>&1 &

$ echo $$

Profile photo for Jesse Pollard

Nope. It is a result of whatever tool you are using to read the manpage.

History wouldn’t be an effect in any case. The manpage was written well before UTF-8 was even a concept. It was written using ANSI standard ASCII.

That doesn’t prevent someone to have done an “update” that changes things, but none of my manpages uses UTF-8. Some web sites, on the other hand, may.

Profile photo for Hari Kishan

The -- is used to indicate the end of command line options. This enables you to use arguments starting with --. For example, if you create a file called --foo:

  1. $ > '--foo' $ ls --foo 

And then try to delete it, rm will think you're giving it an argument:

[code]$ rm --foo rm: unrecognized option '--foo' Try 'rm ./--foo' to remove the file '--foo'. Try '...

Profile photo for Andrew Daviel

“.” represents the current working directory. For example, if you wish to run a program from the current directory, rather than an installed one in the execution path, you might write “./ls” rather than just “ls”. If you wish to copy something to the current directory you might write “cp /tmp/foo.txt .”.

“$” is used to introduce an environment variable. For instance, $HOME is the user’s home directory, $HISTSIZE is the number of previous commands saved in the shell history. Numeric variables are those passed to a shell script on the command line; $1 is the first argument, $2 the second etc.. Ot

“.” represents the current working directory. For example, if you wish to run a program from the current directory, rather than an installed one in the execution path, you might write “./ls” rather than just “ls”. If you wish to copy something to the current directory you might write “cp /tmp/foo.txt .”.

“$” is used to introduce an environment variable. For instance, $HOME is the user’s home directory, $HISTSIZE is the number of previous commands saved in the shell history. Numeric variables are those passed to a shell script on the command line; $1 is the first argument, $2 the second etc.. Other single-character variables have special meaning, for instance $$ is the process ID of the shell, $? is the exit status of the most recent foreground pipeline (most recent command, basically, indicating if it failed).

Profile photo for Wayne Brehob

There are a couple of reasons you might place a “./” at the beginning of a command:

  1. To specifically run a command in the CURRENT directory with the same name as something else that is in your path. Say your current working directory is /home/alex/bin and you want to run the script /home/alex/bin/cat. If you type command “cat” it would normally run “/bin/cat”, but if you type “./cat” it will run the script you want.
  2. To run a command in the current directory if the current directory is not in your path. Say you created /home/alex/bin/myscript but that is not in your path. You could run it with “cd

There are a couple of reasons you might place a “./” at the beginning of a command:

  1. To specifically run a command in the CURRENT directory with the same name as something else that is in your path. Say your current working directory is /home/alex/bin and you want to run the script /home/alex/bin/cat. If you type command “cat” it would normally run “/bin/cat”, but if you type “./cat” it will run the script you want.
  2. To run a command in the current directory if the current directory is not in your path. Say you created /home/alex/bin/myscript but that is not in your path. You could run it with “cd /home/alex/bin; ./myscript”.

In the middle of a command or filename, though, it does nothing. For instance, “/bin/ls” and “/bin/./ls” are the same command.

Profile photo for Peter Vanroose

It’s the name of a directory (followed by a slash, to make it very clear it’s a directory). Not only in a Linux command, but also in Unix, and also in any programming context or system call, when a certain directory is to be accessed or named.

That particular directory is the “current directory”.

For example, if you want to list all files in the current directory, you could use the command

ls ./

or just

ls .

since the slash is there only to explicitly mention it’s a directory

Or even just

ls

since, coincidently, the default argument for ls is “the current directory”.

Most other commands don’t have “.” a

It’s the name of a directory (followed by a slash, to make it very clear it’s a directory). Not only in a Linux command, but also in Unix, and also in any programming context or system call, when a certain directory is to be accessed or named.

That particular directory is the “current directory”.

For example, if you want to list all files in the current directory, you could use the command

ls ./

or just

ls .

since the slash is there only to explicitly mention it’s a directory

Or even just

ls

since, coincidently, the default argument for ls is “the current directory”.

Most other commands don’t have “.” as a default argument, so you’ll need to use that “.” often explicitly.

E.g., to copy some file(s) to your current directory, you need to do something like

cp /some/file1 /some/file2 ./

or (of course) also

cp /some/file1 /some/file2 .

Profile photo for Anoop Bhaskaran

The UNIX shell displays a command prompt when the system is ready to accept commands on the command line. The default command prompt is a single character (typically $ or # for Bash and ksh). “$” is displayed when you log in as a normal user and “#” is displayed when you log in as a root user.

An example is given below:

In the example it can be seen that apart from the “$” and “#” symbol the shell also displays the username and host-name. This is configured by a prompt string PS1 in Bash.

The prompt string PS1 can be configured to display useful information on shell.

Here:

  1. \u -- Username 
  2. \h -- Host  

The UNIX shell displays a command prompt when the system is ready to accept commands on the command line. The default command prompt is a single character (typically $ or # for Bash and ksh). “$” is displayed when you log in as a normal user and “#” is displayed when you log in as a root user.

An example is given below:

In the example it can be seen that apart from the “$” and “#” symbol the shell also displays the username and host-name. This is configured by a prompt string PS1 in Bash.

The prompt string PS1 can be configured to display useful information on shell.

Here:

  1. \u -- Username 
  2. \h -- Host name 
  3. \W -- Basename of the current working directory  
Profile photo for Thomas Obernosterer

“Why do we use -i in Linux commands?”

I am sorry but, which programs do you mean?

Many programs have different flags (a flag is a dash followed by a letter [called a short-flag] or another dash which then is followed by a word).

And each developer can decide what flags their application has, and how they effect the application. As there are only so many lowercase letters, you will find many same short flags but with different meanings in a collection of applications.

To know what the -i flag does in for example sed, you can check it's description with 'sed --help' or 'man sed'. (As you can see, th

“Why do we use -i in Linux commands?”

I am sorry but, which programs do you mean?

Many programs have different flags (a flag is a dash followed by a letter [called a short-flag] or another dash which then is followed by a word).

And each developer can decide what flags their application has, and how they effect the application. As there are only so many lowercase letters, you will find many same short flags but with different meanings in a collection of applications.

To know what the -i flag does in for example sed, you can check it's description with 'sed --help' or 'man sed'. (As you can see, the sed program supports the --help flag, and it print a help dialogue)

This is the man output for sed regarding the -i flag:

-i[SUFFIX], --in-place[=SUFFIX]

edit files in place (makes backup if

SUFFIX supplied)

And as you can read it directly modifies the file you use sed on, but you can make a backup of the file by adding something to the flag, for example: -ibak1

I hope that this short info allows you to find out what -i does in the programs you where thinking about when you write this question.

(I refer to “commands” as programs because 90% of what you execute in any shell is a standalone program and not a shell command. This is true for Linux, *nix, macOS and even Windows)

Profile photo for Paresh Tripathi

When you use ‘ls’ , it simply lists all files, directories.

when you use -r option, it lists in reverse order i.e

when you -d option, it lists only directories (with */ option)

as you see test.txt file is not shown when we use -d.

When you use ‘ls’ , it simply lists all files, directories.

when you use -r option, it lists in reverse order i.e

when you -d option, it lists only directories (with */ option)

as you see test.txt file is not shown when we use -d.

Profile photo for Andrew Daviel

rm -i means “interactive”, ask for confirmation. Otherwise Linux assumes that you know what your are doing - rm deletes things, without asking, and without possibility of easy recovery.

Often “rm” may be aliased to “rm -i”, e.g. for root on RedHat. That’s because even Linus users can make mistakes. Type “which rm” to see. You can usually override that with -f, e.g. rm -rf apples, and if that does not work, /bin/rm -rf apples to force the unaliased behaviour.

As Jakob says, read the manpage. Even without -i, recursive deletes will prompt for confirmation.

Profile photo for Isaiah Boutz

In my experience and varied research, it is a negative sign if it is

  1. preceded by a different operator. For example, in 5+-1. You can pretty well assume that that (+) sign has no other reason to be there other than as an operator, so it must mean plus. Equations can not have addition and subtraction happening at the same time, so that (-) sign must be a negative symbol.
  2. If the number and the (-) sign are in parentheses together. This is the correct way to write equations if the negative sign is preceded by an operator. For example, 5+(-1). The 1 is quite obviously negative.

If the (-) sign is by i

In my experience and varied research, it is a negative sign if it is

  1. preceded by a different operator. For example, in 5+-1. You can pretty well assume that that (+) sign has no other reason to be there other than as an operator, so it must mean plus. Equations can not have addition and subtraction happening at the same time, so that (-) sign must be a negative symbol.
  2. If the number and the (-) sign are in parentheses together. This is the correct way to write equations if the negative sign is preceded by an operator. For example, 5+(-1). The 1 is quite obviously negative.

If the (-) sign is by itself, as with 5–1, then you can probably make the assumption that the (-) represents subtraction.

Profile photo for Daniel Chen

Typically, - represents STDIN. A common usage of this is for an on the fly tar/untar over a network: tar -cf - /some/file | ssh host.name tar -xf - -C /destination

For the cd builtin, - goes to the last directory. For example, if you are in your home directory and execute
cd /usr/local/src/linux
cd -
you will be back in your home directory.

Profile photo for Vijay Saravana

The “-” denotes the parameters or arguments passed to the command.

For example if we take ls command it will list out the files in a directory.

And if we pass sh as a parameter to ls command then it will list out the files with human readable format

  1. ls -sh 

Thank you 😊

Profile photo for Het Daftary

“-” indicates a char flag is after it in that command.

Like “ ls -a”. Here -a is used to say I also want hidden files in this directory.

“—” means a string argument is behind it.

Like “gcc --help” gives you help manual for gcc.

Profile photo for Gerard

My guess is that someone used a “smart editor” to edit the text, which silently changed the minus-hyphen character into a minus sign.

Profile photo for Joe Smith

You are using the wrong syntax. Those kinds of substitution start with a dollar sign and an open brace.

  1. var1=${1:-"default"} 
  2. var2=${2:+"present"} 
  3. var3=${3:?"Arg 3 must be specified"} 
  4. echo "\$var1=$var1 \$var2=$var2 \$var3=$var3." 

This is found in man bash in the “Parameter Expansion” section.

Profile photo for Bryan Holds a Doctorate in Sarcasm

Q: What does -i mean in Linux terminal?

I want to delete a folder in my /home directory with rm-r apples

A: -i stands for “interactive.”

It basically instructs the command (rm) to ask “are you sure?” for every item which is slated to be removed. You enter “y” or “yes” each time you agree a file can go away.

In this example the directory to remove is named “test” containing three files, and the rm command and its output will look like this (it stopped each time to wait for me to type “y” and answer the question):

  1. rm -ri test 
  2. rm: descend into directory ‘test’? y 
  3. rm: remove regular empty file ‘test/text 

Q: What does -i mean in Linux terminal?

I want to delete a folder in my /home directory with rm-r apples

A: -i stands for “interactive.”

It basically instructs the command (rm) to ask “are you sure?” for every item which is slated to be removed. You enter “y” or “yes” each time you agree a file can go away.

In this example the directory to remove is named “test” containing three files, and the rm command and its output will look like this (it stopped each time to wait for me to type “y” and answer the question):

  1. rm -ri test 
  2. rm: descend into directory ‘test’? y 
  3. rm: remove regular empty file ‘test/text1.txt’? y 
  4. rm: remove regular empty file ‘test/text2.txt’? y 
  5. rm: remove regular empty file ‘test/test3.txt’? y 
  6. rm: remove directory ‘test’? y 

The opposite of -i is -f (force), and it’ll remove everything without asking once. By the way the -r means recursive, which is required to descend into a directory. Without it you many only remove files.

-i has the same effect on many commands, but not all. Read the man page to learn more about any of them.

UPDATE:

Your sample command directory is “apples.” Is this a homework question? Don’t ask those here. Don’t ask them on Stack Exchange. Or LinuxQuestions.

If you have questions that can’t be answered with “man rm” or your course documentation then ask your instructor; that’s why you are taking a class—TO LEARN. Study with classmates,

I realize it sounds funny to discourage asking questions on a Q&A site—and I admit Quora is a wonderful resource—but in asking here, you’re requesting that other people do your work for you.

Not only is that cheating, it robs you of your chance to truly LEARN the course material, and again…that’s why you’re taking a class. What happens when you get a job and don’t know how to do it without constantly keeping browser tabs open to Quora? Someone else will have your job before long, that’s what.

If it’s not a homework question, please ignore the above rant. If it *is*, then Jakob’s answer is far better, and don’t read mine.

Profile photo for Quora User

One way to prevent accidental deletion of files and directories is to add an immutable e2fs attribute:

[code]
rep ~ $ ls > test.txt
rep ~ $ ls -l test.txt
-rw-r--r-- 1 rep wheel 864 Apr 1 12:34 test.txt
rep ~ $ sudo chattr +i test.txt
rep ~ $ ls -l test.txt
-rw-r--r-- 1 rep wheel 864 Apr 1 12:34 test.txt
rep ~ $ rm -rf test.txt
rm:...

Profile photo for Dan Franklin

As another poster said, there are two use cases:

  1. When you have a script performing installations or configuration changes, and you want to make sure a directory exists. Without -p you’ll get an error if it already exists. With -p you will only get an error if the directory did not exist, and mkdir was unable to create it.
  2. When you need to create several levels of directory tree at once. By default mkdir will only create one level, so if you want to have /var/something/somethingelse, you need to issue two mkdir commands; with -p, you can issue one command to create /var/something/somethingelse an

As another poster said, there are two use cases:

  1. When you have a script performing installations or configuration changes, and you want to make sure a directory exists. Without -p you’ll get an error if it already exists. With -p you will only get an error if the directory did not exist, and mkdir was unable to create it.
  2. When you need to create several levels of directory tree at once. By default mkdir will only create one level, so if you want to have /var/something/somethingelse, you need to issue two mkdir commands; with -p, you can issue one command to create /var/something/somethingelse and it will create both directory levels.

Sometimes I’ve needed to do both - make sure several levels of directory tree exist when one or more of the levels might already exist. mkdir -p handles that very well.

Profile photo for Quora User

Assuming this is not quoted, it is one of the file wildcard notations. It defines a character range. [0–9] matches any single digit. [a-d] would match a, b, c, or d. So if a directory contains abu.tmp, ace.tmp and any.tmp:

$ls a[b-c][c-g].tmp

ace.tmp

Instead of defining a range with two characters separated by a dash, you can also list the characters you want to match inside the brackets. For example [afh] matches a, f or h.

In -[0–9], the first - is just a normal character, matches only itself.

Several utility programs in Linux, such as grep and sed, take a regular expression as an argument (which

Assuming this is not quoted, it is one of the file wildcard notations. It defines a character range. [0–9] matches any single digit. [a-d] would match a, b, c, or d. So if a directory contains abu.tmp, ace.tmp and any.tmp:

$ls a[b-c][c-g].tmp

ace.tmp

Instead of defining a range with two characters separated by a dash, you can also list the characters you want to match inside the brackets. For example [afh] matches a, f or h.

In -[0–9], the first - is just a normal character, matches only itself.

Several utility programs in Linux, such as grep and sed, take a regular expression as an argument (which usually must be quoted, otherwise the shell may try to use it as a file wildcard). Regular expressions differ a bit from file wildcards, but the simple forms of the bracket notation work the same way in both.

About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025