LinuxCommandLibrary

counter-strike-2

Launch Counter-Strike 2

TLDR

Run a game with one map

$ [path/to/cs2] -dedicated +map [de_dust2]
copy

Run a game with specified maximum number of players
$ [path/to/cs2] -dedicated +map [de_dust2] -maxplayers [64]
copy

Run a game with specified server IP and port
$ [path/to/cs2] -dedicated +map [de_dust2] -ip [1.2.3.4] -port [27015]
copy

Shut the server down
$ quit
copy

SYNOPSIS

cs2 [options...]

PARAMETERS

-novid
    Skips the Valve intro video when the game launches.

-nojoy
    Disables joystick support, which can resolve some input conflicts.

-high
    Starts the game process with high CPU priority.

-low
    Starts the game process with low CPU priority.

-fullscreen
    Launches the game in fullscreen display mode.

-windowed
    Launches the game in windowed display mode.

-noborder
    When used with -windowed, removes the window border.

-w <width>
    Sets the game's initial resolution width (e.g., -w 1920).

-h <height>
    Sets the game's initial resolution height (e.g., -h 1080).

-freq <rate>
    Sets the monitor's refresh rate (e.g., -freq 144). Also seen as -refresh.

-console
    Opens the in-game developer console upon launching the game.

-exec <filename>
    Executes a specified configuration file (e.g., -exec autoexec.cfg) after default configs.

-language <lang>
    Sets the game's display language (e.g., -language english).

-threads <count>
    Specifies the number of CPU threads the game should use. Often auto-detected, but can be set manually (e.g., -threads 8).

-vulkan
    Forces the game to use the Vulkan rendering API on supported systems, often beneficial for Linux performance via Proton.

+<cvar> <value>
    Executes a console variable (Cvar) command with a specified value upon startup (e.g., +cl_showfps 1).

DESCRIPTION

Counter-Strike 2 (CS2) is a highly competitive, team-based tactical first-person shooter developed by Valve. It serves as a free upgrade to Counter-Strike: Global Offensive (CS:GO), bringing the beloved franchise to the Source 2 engine. Players engage in objective-based rounds, primarily as terrorists attempting to plant a bomb or hostages, or as counter-terrorists trying to prevent the bomb or rescue hostages. Its core gameplay revolves around precise gunplay, strategic utility usage (grenades), and intricate map control. CS2 features updated maps, volumetric smokes, improved visual fidelity, and a sub-tick update system for more responsive gameplay. On Linux, CS2 is typically run through Steam Play, utilizing Valve's Proton compatibility layer, which allows Windows-native games to run on Linux distributions.

CAVEATS

Counter-Strike 2 is not a traditional Linux command-line utility. It's a commercial video game primarily distributed and launched via the Steam client. The "command-line options" listed are typically entered into the game's "Launch Options" within the Steam client for CS2. Direct execution of a 'cs2' binary from a standard Linux shell is usually not how the game is intended to be launched, as it relies on Steam's environment and Proton for compatibility on Linux.

LAUNCH VIA STEAM

On Linux, CS2 is almost exclusively launched through the Steam client. To use the command-line options listed, navigate to your Steam Library, right-click on Counter-Strike 2, select 'Properties', and then enter the desired options in the 'Launch Options' text box under the 'General' tab. Steam then passes these arguments to the game's executable.

PROTON COMPATIBILITY LAYER

Since Counter-Strike 2 is developed for Windows, its execution on Linux relies on Proton, a compatibility layer developed by Valve. Proton integrates Wine and other components to translate Windows API calls into Linux equivalents, allowing the game to run. Users may need to ensure Proton is enabled for CS2 in Steam's compatibility settings.

CONFIGURATION FILES

Many in-game settings and custom commands can be persistently stored in configuration files. The primary user configuration file is config.cfg, located in the game's user data directory (e.g., ~/.steam/steam/steamapps/common/Counter-Strike Global Offensive/cs2/cfg/). Users often create an autoexec.cfg in the same directory to automatically execute custom commands and bind keys upon game startup.

HISTORY

Counter-Strike 2 is the latest iteration in the Counter-Strike series, which began in 1999 as a Half-Life mod. It evolved through versions like Counter-Strike 1.6 and Counter-Strike: Source, before the highly successful Counter-Strike: Global Offensive (CS:GO) was released in 2012. CS2 was officially announced and released in September 2023 as a free upgrade to CS:GO, migrating the game to Valve's Source 2 engine. This move brought significant graphical and technical improvements, including physically-based rendering, dynamic smoke effects, and a new 'sub-tick' architecture aimed at improving gameplay responsiveness.

SEE ALSO

steam(6)

Copied to clipboard