Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-o in Linux terminal (Dash o); What does it mean?

Tags:

linux

terminal

I'm new to Linux Terminal and a lot of commands use the -o in it.

For example to compile a NASM program you say

gcc prgram1.o -o prgram1

I can guess that it has something to do with output but can anyone provide me with a proper definition and intuition for when it is used?

P.S. I did a lot of Googling, found a lot of pages with command references for Linux terminal but nothing that covered the simple -o.

like image 803
CodyBugstein Avatar asked Feb 27 '13 23:02

CodyBugstein


People also ask

What does the dash mean in Linux?

dash is the standard command interpreter for the system. The current version of dash is in the process of being changed to conform with the POSIX 1003.2 and 1003.2a specifications for the shell.

What does o mean in shell script?

Its quite basic actually: -z means test for empty string (zero length) -o is a OR operation.

What is dash R on terminal?

the -R flag when used with chmod means: apply recursively. This is a very useful command. The -R flag would would change permissions of all the files and sub-folders contained within the mozilla folder to 777 file permissions.


2 Answers

in most cases -o will stand for output but it's not a defined standard it can potentially mean anything the developer wanted it to mean, the only way someone can know which commands is to use a command line option of --help, -h, or something -? to display a simple list of commands, again because the developer of the program chooses the possible input arguments and there meaning this might differ from program to program.

The safest way to know is typically run

man gcc

replacing the second part with the program name you want.

man <program name>

This lists a full guide for the program with a lot more detail and is usually well formated to read on a terminal. just press Q when your finished reading it.

like image 170
Peter Fox Avatar answered Oct 11 '22 08:10

Peter Fox


the -o flag is often used to denote the name of the output file. However since it is a flag you should lookup in the manual what the specific flags are. Also you might run a program with -h or --help to show a list of options and flags.

like image 29
hetepeperfan Avatar answered Oct 11 '22 09:10

hetepeperfan