Command line options. Command line programs for everyday use method: launching a system application

There are situations when you need to open a browser with a specific set of parameters, for example: open a specific address in InPrivate mode, launch a browser with disabled add-ons, disable automatic tab recovery when it falls, etc. Of course, all these operations can be called using the graphical interface of the program, but from the point of view of process optimization, it is better to use the command line. Why, for example, every time launch the browser in InPrivate mode, then enter the address of the payment system, if all this can be done with one click !?

Supported command line parameters

Table 1 - Supported command line parameters with a brief description.

-embeddingLaunch Internet Explorer 9 using OLE (Object Linking and Embedding) technology.
-extoffSupported starting from Internet Explorer 7. Launches the browser, completely disabling all add-ons (only for the current session, that is, when you restart the add-ons will be automatically enabled).
-framemergingSupported since Internet Explorer 8. Allows the browser to use frame based label fusion. It is not recommended for use by users who are accustomed to browsing websites in several sessions, for example, to log into several mail accounts at the same time.
-kLaunches the browser in "Kiosk mode". At the same time, there are no visual controls, and the browser itself is expanded to full screen. still work.
-noframemergingSupported since Internet Explorer 8. Prevents the browser from using the frame merging feature.
-nohangrecoverySupported since Internet Explorer 9. Disables the function of reloading a frozen web page. Used primarily by developers to debug add-ons, ActiveX controls, etc.
-privateSupported starting with Internet Explorer 8. Launches the browser in InPrivate mode.
UrlWhen launched, the browser will open the typed address for you. If you enter 2 or more parameters, the browser will redirect you to the search page for this expression.

Examples of using the command line in Internet Explorer 9

Since many people do not use the command line, I will give examples of using commands on desktop shortcuts. Right-click on an empty space on the desktop. We choose Create - Shortcut... V Property location we enter the command from the example.

Simultaneous login to the site with two different accounts

If it becomes necessary to work simultaneously in two mailboxes of the same mail service, use the parameter - noframemerging:

"C: \ Program Files \ Internet Explorer \ iexplore.exe" -noframemerging

Now you need to launch two copies of the browser, and then go to different mailboxes of the same mail service in both (for example, I used gmail.com). Moreover, if you leave one account, the second will continue to work (which is not available with the usual launch of two copies of Internet Explorer 9).

Figure 1 - Simultaneous work with two gmail accounts using the -noframemerging parameter.

Privacy Mode

Let's create a shortcut for working with the payment system (in this case, PayPal), in InPrivate mode:

"C: \ Program Files \ Internet Explorer \ iexplore.exe" -private paypal.com

Figure 2 - Browser launched with the -private parameter.

Kiosk mode

Let's say you need to launch Internet Explorer in full screen, while opening a specific site (in our case, the site). Command:

"C: \ Program Files \ Internet Explorer \ iexplore.exe" -k site

Figure 3 - Internet Explorer running in kiosk mode.

Debug mode

To debug a web developer, you need to start the browser without all the add-ons, and also disable the automatic tab repair system. We use the following command:

"C: \ Program Files \ Internet Explorer \ iexplore.exe" -extoff -nohangrecovery

Figure 4 - Launching a browser with the -extoff parameter, accompanied by such a warning page (always, except when used in conjunction with -private).

The command line is still a powerful Windows tool used by OS users and supported by many applications. Internet Explorer 9 is no exception - working with the command line is simple and intuitive, and the semantics of commands clearly reflect the function that it (command) implements. Don't forget about this toolkit to expand the capabilities of your browser and automate your daily tasks.

Original: Command-line programs for everyday use in Linux
Author: Rares Aioanei
Publication date: January 31, 2012
Translation: A. Krivoshey
Date of transfer: May 2012

1. Introduction

I must admit that I am a command line fanatic. Whenever possible, regardless of the operating environment and distribution used, I open up a terminal and start doing all sorts of nonsense. Of course, this does not mean that everyone should follow me. Most people prefer to use a mouse and a graphical interface. However, there are many situations where it is easier to complete a task using the command line. And sometimes, for example, when updating the kernel or video card driver, the graphics mode may simply turn off due to some bug in the new version. And at this time, for example, you urgently need to send a very important letter ... All basic operations performed in graphical mode (of course, with some exceptions) can be just as easily performed on a machine running in the console. If you are interested in this topic, you are welcome.

2. Tasks

First, let's define what we mean by everyday tasks. This can be e-mail, watching something interesting on YouTube (yes, it is possible), chatting, or just surfing the web. We will talk about all these tasks in our article. By the way, one more advantage of working in the command line (in addition to efficiency and undemanding system resources) is monotony. When working on any Linux-based computer, you don't have to worry about your favorite graphical environment not installed - the programs we'll talk about will look the same regardless of the graphical interface. It should be noted that in this article we will talk about the basic concepts and principles of using programs, it is not a step-by-step guide to using them.

2.1. Surfing the web

Of course, you won't be able to view images, but console browsers will work very quickly, much faster than any graphical counterpart. In addition, security will also be great, because some of them don't even support Javascript, unless you compile them with specially specified options. Let me introduce you links, elinks and lynx. In almost all distributions, you can install them using the standard package management system, or build them yourself from source code, which is not difficult, since they have few dependencies. links also has a command line flag (-g) which, if links was compiled with the correct options, produces a simple yet fast graphical browser.

On Debian, when I tried to launch the browser using the "links -g" command, I got the message "Graphics not enabled when compiling (use links2 instead for graphics mode)". By installing links2 and entering the command

I got what I wanted. If I need to go to a site in a text browser that uses Javascript for authorization, I use elinks. Nowadays, with the development of the market for mobile devices, many sites have special mobile versions (and Gmail has an HTML version that is great for such purposes) that can be viewed in text browsers, unless you need images or flash. Another advantage of console browsers is significantly lower traffic consumption. If you want the most minimalistic and fast option, we advise you to pay attention to lynx. This is the smallest and fastest browser, even in comparison with its counterpart.
Above, I mentioned watching youtube videos on the command line. They can be downloaded using the youtube-dl utility, and then, after a short study of the mplayer options, view them.

2.2. Chat room

Most Linux users use Pidgin for this, as it supports a large number of protocols, history (does anyone else remember Gaim?) And has a beautiful interface. Unbeknownst to many, the Pidgin development team offers a command line equivalent called Finch. It can be installed without any problems in most distributions, but you need to warn you that unlike most command line programs, Finch has quite a lot of dependencies, since it is associated with Pidgin, which, in turn, requires a lot of them. Finch supports all protocols that Pidgin supports. The only difference is in the interface.
When it comes to communication, the Linux community prefers IRC. Although Finch already supports IRC, I would like to introduce you to an IRC-only client called irssi. It's very easy to use, but don't underestimate its capabilities. irssi allows you to write scripts and supports all the advanced IRC features you might need. On first launch, the program creates a configuration file in ~ / .irssi /, which can be edited if necessary. It is quite easy to master, since this file already contains a large number of examples of ready-made configurations. I prefer to use irssi directly from the command line:

$ irssi -c $ host -n $ nick

2.3. Multimedia

Who said that you need an X server to listen to music? Of course, this is not the case, and there are many applications besides mplayer, which we already talked about, that allow you to do this. Of course I didn't work with everyone, I usually use mp3blaster. It supports mp3 and ogg, playlists, id3 and has a beautiful and user-friendly interface.

It is available in Debian, also available in Ubuntu, Mint and their derivatives. OpenSUSE users with Packman repository enabled can also install mp3blaster. It doesn't seem to be available in new Fedora releases, so you'll have to compile it yourself (or build a package).

2.4. news

When I say news, I mean two things: RSS and NNTP, which is Usenet. Of course, Linux has no problem using them, but when it comes to RSS, the same question arises: images. Again, it all depends on the type of news you are reading. If it's comics, for example, then it's bad. In any case, consider these programs, keeping in mind that they are by no means the only alternative available. It's just that I use them, that's why I write about them.
For RSS, I use Snownews, a really small and fast reader. On the project website you can see how the program will look like, since it is almost an exact copy of its interface. Unfortunately, I cannot please Debian users, as the program (as a package) is available only for Lenny. Packages are available for Fedora, Gentoo, BSD, and Solaris. What I love about Snownews is that it is really fast, although parsing XML is quite a challenge.
When it comes to reading Usenet, every Linux veteran should know about Tin, the Threaded Internet News reader. Hope I didn't misrepresent the acronym, correct if I'm wrong. It has a rich history, is fast and easy to set up, is distributed under a liberal license (BSD), and is available on virtually all Unix-based systems such as BSD, Solaris, and even OpenVMS. I use it to read news remotely, and so I run it with the -r flag, otherwise tin will try to use a local buffer that is not on my machine. Below I give an example of my settings for Tin.

// edit ~ / .newsrc and enter the groups you want to subscribe to, one per line // if you already have such a file, replace the trailing "!" with a semicolon // for the groups you want to subscribe to $ export NNTPSERVER = $ server $ tin -Q

3. Conclusion

Research says that despite all the efforts to develop graphical interfaces, humans are most effective at the command line. I can't tell if this is true or not. What I can really say is that I myself am actually more productive at the command line, despite the time it takes to learn such a job. What do you think about this?

Command line options are used to define various startup options for Mozilla applications. For example, you can use command line options to bypass the Profile Manager and open a specific profile (if you have more than one). You can also control how to open Mozilla applications, which components to open initially, and what to do when they open. This page describes commonly used options and their use.

Syntax rules

First, let's describe the syntax rules that apply to all options.

  • Command parameters containing spaces must be enclosed in quotation marks, for example "Joel User".
  • Command actions are not case sensitive.
  • Command parameters (except for the profile name) are not case sensitive.
  • Commands and parameters are separated by spaces.
  • The syntax for message fields is field = value, for example:
    • to = [email protected]
    • subject = cool page
    • attachment = www.mozilla.org
    • attachment = "file: /// c: /test.txt"
    • body = check this page
  • Multiple message fields are separated by a comma (,), for example: " [email protected], subject = cool page". There must be no spaces before or after the separating comma. To specify multiple values ​​for a field, enclose the values ​​in single quotation marks ("), for example: " to = " [email protected],[email protected]", subject = cool page" .

Using command line options

Command line options are specified after the command to start the application. Some options have arguments. They are specified after the command line option. Some options are abbreviated. For example, the command line option "-editor" can be abbreviated as "-edit". (Available abbreviations are described in the text below). In some cases, option arguments must be enclosed in quotation marks. (This is noted in the option descriptions below). Several command line options can be specified. In general, their syntax is as follows:

Application -option -option "argument" -option argument

Examples of

The following examples illustrate the use of the "-ProfileManager" option, which opens the Profile Manager before starting Firefox or Thunderbird:

Windows

Select Run from the Windows Start menu and type:

Firefox -ProfileManager

Mac OS X

Go to Applications> Utilities. Open a terminal and enter:

/Applications/Firefox.app/Contents/MacOS ./firefox -ProfileManager

Linux

Open a terminal and enter:

Cd Thunderbird installation directory ./thunderbird -ProfileManager

The example above uses the "-ProfileManager" command line option for the Mozilla Thunderbird mail client.

User profile

-CreateProfile profile_name

Creates a new profile named profile_name in the default directory, but does not launch the application. Profile_name must not contain spaces ().

Firefox -CreateProfile JoelUser

-CreateProfile "profile_name profile_dir"

Creates a new profile, profile_name, in the profile_dir directory, but does not launch the application. Note that profile_name and profile_dir are quoted together and separated by exactly one space ().

For successful use, there must be no application instances already running or the -no-remote option used.

Note: The profile_dir must not exist and you must not have an existing profile named profile_name.

Firefox -CreateProfile "JoelUser c: \ internet \ moz-profile"

-ProfileManager

Launching the Profile Manager. Short form: -P (no username).

-P "profile_name"

Skips the launch of the profile manager and launches the application with the profile profile_name. Useful when working with multiple profiles. Note that the profile name profile_name is case sensitive. If no profile name is specified, the Profile Manager will start. You must use uppercase P on Linux versions earlier than 7.x, as lowercase P will run in cleanup mode ( leak detection memory). On other platforms, both upper and lower case are allowed.

Firefox -P "Joel User"

-profile "profile_path"

Launch with a profile with the specified path. Only Firefox, Thunderbird and SeaMonkey2.x.

The "profile_path" path can be either absolute ("/ path / to / profile") or relative ("path / to / profile").

Note: Specifying relative paths on Mac OS X is no longer supported due to regression in Firefox 4.0 and up, see bug 673955.

-new-instance

Launches a new instance of the application instead of a new window in an already running application, which allows you to keep multiple copies of the application open at the same time.

Firefox -new-instance -P "Another Profile"

-no-remote

Does not allow receiving or sending remote commands; implicit use of the -new-instance option.

Firefox -no-remote -P "Another Profile"

Note: As of Firefox 9, this really means what is meant on all platforms, i.e. instances created using this parameter do not receive or send remote teams, see bug 650078. This means that such instances cannot be reused. Also when using this argument anyway a new instance is created.

-migration

Launching the application with the Migration Wizard.

-override / path / to / override.ini

Loads the specified override.ini file to override application.ini (). This can be used to suppress the Migration Wizard when it starts by loading the next override.ini file. Only Firefox.

EnableProfileMigrator = 0

Browser

-browser

Launching the browser component. Only Firefox and SeaMonkey.

-url URL

Opens the URL in a new window or tab, depending on your browser settings. The -url option name can be omitted. Several URLs are allowed, separated by spaces. Only Firefox and SeaMonkey.

Note: When opening multiple URLs, Firefox always opens them as tabs in a new window.

Firefox www.mozilla.com firefox www.mozilla.com website

-private

Opens Firefox in private browsing mode. Only Firefox 3.6 and later.

Not applicable in Ubuntu for Firefox 20 and later.

-private-window

Opens a new private window for an existing Firefox instance. Only Firefox 20 and later.

-private-window Url

Opens Url in a new window in privacy mode. If the private window is already open, a new tab will be opened in the existing window. Firefox 29 and later. Doesn't work in Firefox 31 on linux mint 17 (the page opens in a non-private window).

-new-tab URL

Opens a URL in a new tab. Only Firefox and SeaMonkey2.x.

-new-window URL

Opens a URL in a new window. Only Firefox and SeaMonkey2.x.

-search term

Search for term in the default search engine. Only Firefox and SeaMonkey 2.1 and later.

-preferences

Opens the settings window. Only Firefox and SeaMonkey2.x.

-setDefaultBrowser

Sets the application as the default browser. Only Firefox.

Mail and news

-mail

Launches the mail client. Only Thunderbird and SeaMonkey.

-news news_URL

Launches a news client. If news_URL is specified (optional), opens the specified newsgroup. Only Thunderbird and SeaMonkey.

Thunderbird -news news: // server / group

-compose message_options

Opens the mail message editor. Cm. . Only Thunderbird and SeaMonkey.

Thunderbird -compose " [email protected] "

-addressbook

Opens the address book. Only Thunderbird and SeaMonkey.

-options

Opens the "Tools / Options" window. Only Thunderbird.

-offline

Start in standalone mode. Only Thunderbird and SeaMonkey.

-setDefaultMail

Installs the application as the default mail client. Only Thunderbird.

Calendar

-calendar

Launches the calendar application. Only Sunbird.

-subscribe URL or -url URL

-showdate date

Show your schedule for the specified date date. Only Sunbird.

Sunbird -showdate 08/04/2008

Other components

-editor URL or -edit URL

Launches the editor for the specified URL (where URL is an optional parameter). Only SeaMonkey.

Seamonkey -edit www.mozilla.org

-jsdebugger

-start-debugger-server port

-inspector URL

firefox -chrome chrome: // inspector / content

-register chrome_URL

Registers the specified chrome, but does not start the application.

Add-ons

Gecko 1.9.2 notice

The -install-global-extension and -install-global-theme options have been removed from Gecko 1.9.2 and later.

-install-global-extension / path / to / extension

Installs the extension to the application folder. The path to the extension is specified as a parameter. To install, you must have administrator rights.

-install-global-theme / path / to / theme

Same as above for topics. To install, you must have administrator rights.

Note: Starting with Firefox 2.0.0.7, the use of the -install-global-extension and -install-global-theme command line options has been limited to installing only those add-ons that are located on a local or network drive. Direct installation from a network share is no longer allowed.

-safe-mode

Launches the application with plugins disabled for this session only. (Extensions are not loaded, but are not permanently disabled in the extension manager).

Localization

-UILocale locale

Launch with the user interface language specified in locale.

Firefox -UILocale en-US

Remote control

-remote remote_command

Note: This feature was removed in Firefox 36.0, restored in 36.0.1, and removed again in version 39.0. See bug 1080319.

Executes the remote command remote_command in an already running application process (see remote control).

Firefox -remote "openURL (www.mozilla.org, new-tab)"

Note: This option is only available for UNIX platforms running X-Windows.

Miscellaneous

-tray

Launching the application minimized to the tray. Useful when autostarting.

-silent

Do not open windows by default. Useful when used with options that open their own windows, but do not prevent default windows from opening. Only Firefox, Thunderbird3.x and SeaMonkey2.x.

-console

Launching the application with the debug console.

Note: Supported for Windows only.

-attach-console

Write messages to the debug console of the window that launched the application instead of opening a new window for debug messages.

Most users of the Windows operating system are accustomed to launching the desired application or game by double-clicking on the shortcut located on the desktop, or by finding it in Start. Alternatively, you can open the folder in which it is installed, and from there run the exe file.

Since such launching of applications may not always be suitable, in this article, let's look at several different ways that you can use to launch a program from the command line.

Method 1: launching a system application

In order to start one of the system applications from the console, use the "start" command and indicate the desired name separated by a space. The system name must be entered as the name. For Explorer, this is explorer, task manager - taskmgr, control panel - control, system configuration - msconfig.

To open notepad write notepad, Windows Media Player - wmplayer, Paint - mspaint, symbol table - charmap. If you write cmd, a new command prompt window will open.

For example, let's open the symbol table. Type in the line:

and press "Enter".

Method 2: specifying the full path to the file

If you need to run any other installed application, then you should specify the full path to the executable file of the program.

For example, in my Downloads folder there is a program for installing the Film Studio, let's open it. I go into the folder and click on the field where the path is registered. This entire line must be written on the command line (since copy-paste does not work there) and at the end add the name of the utility that we want to run.

The console will write:

c: \ users \ master \ downloads \ wlsetup-all

After pressing "Enter", preparations began for the installation of the Film Studio. As you can see, when writing the path, it is not necessary to use capital letters, you can enter only small letters.

If there are spaces in the path to the desired file, then a window will appear with a message that the specified file cannot be found. The point is that the command line recognizes the path to the first space, not the entire line you entered. In the example, she decided that I want to open c: \ program.

Now let's move a little away from the topic, and consider how to find out the full path to the program that we want to run.

To do this, find the executable file of the required application through the Explorer window. To understand that this is it, look so that opposite it in the "Type" field is indicated "Application". Then click on the field at the top - this is the path.

For example, Total Commander is launched by the file "totalcmd", and it is located along the path: "C: \ program files \ total commander".

Or another option. If there is a shortcut to the desired application on the desktop, you do not need to search for it through Explorer. Just right-click on it and select the item File Location.

The window that we have already examined will open. The file that launches the utility will be highlighted in it, and at the top you can find out the path to it.

Method 3: using path

With this command, we will save the path to the folder in which the executable file is located, and then run it.

Consider the same Total Commander. In the console we write:

path c: \ program files \ total commander

Be sure to put a space after "path". It is on this path that the file "totalcmd" we need is located. Press Enter.

The specified program will be launched. It is not necessary to include an extension at the end. Thus, you can run any executable file in the specified folder.

Method 4: using the cd command

This command will open the specified folder, and from there we will launch the file we need. For example, let's go to the TeamViewer folder:

cd c: \ program files \ teamviewer

After "cd", add a space. Press "Enter".

This folder contains the file that starts TeamViewer, it has the same name. Therefore, I further enter:

I press "Enter" and the utility starts.

If you need to open an application that is not installed on the system drive, you can use the path command. If I type:

path d: \ program files \ ccleaner

(after entering each line, press "Enter"), then CCleaner will open for me. It is he who is installed at the specified path on the D: drive.

But with the help of the cd command, this will not work.

Method 5: through the context menu

To do this, find the folder in which the executable file is stored, and right-click on it while holding down the Shift key. Next, in the context menu, select "Open command window".

After that, the folder we need will immediately open in the command line. Enter in the line the name of the file that launches the utility, and press "Enter". We launched CCleaner, located not on the system drive (I have D :).

If you need to run a program that is installed in the same place as the operating system, the steps are the same. Let's open the Google Chrome browser. We find the folder in which the file is stored, which launches it, and select the item mentioned above.

Then we enter the name of the file with the extension. * Exe: chrome, and press "Enter". The browser will launch.

Method 6: path in quotes

At the beginning, I mentioned that if there are spaces in the specified path, the file will not open. But if you write it in quotes, the console will understand everything. Quotation marks must be double and straight, not commas. They are placed using the combination "Shift + E" with the selected English keyboard layout.

In them you need to write the full path and at the end specify the file itself with the extension that will be launched:

"C: \ program files \ total commander \ totalcmd.exe"

Using quotes, you can open programs on both the system drive and the data drive.