TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Linux commands

Linux Command Syntax

Overview

In this tutorial, we will learn about Linux Command Syntax and sample Linux commands.

Linux Shell

In Linux, a shell is a command-line interpreter. Shell provides an interface between the users and the Linux kernel. It executes the Linux commands and programs. For example, if a user enters the ls then the shell executes the ls command.

The shell has many utilities built into the shell called builtins.

The shell parses the command and finds the program or utility to execute. It passes the command line switches, arguments to the program as part of a new process.

To check what shell has been configured on the machine:

$ echo $SHELL

echo SHELL variable

 

Different Linux distributions provide a GUI wrapper for the shell. For example, Terminal is the default shell application on Ubuntu Linux distribution. Konsole is the default GUI application for OpenSuse.

Linux Command Syntax

$ command command-flags [command-arg1]  [command-arg2] 

Command

Linux command is the utility or program that is executed by the shell.

Command flags or Switches

Command flags, options or switches alter or modify the effects of the Linux command. Linux commands require prefix switches with a hyphen symbol.( – )

$ pwd -P

Here pwd is the Linux command. -P is the command line switch for the command. We can also group multiple command switches together with a single hyphen.

$ ps -aux

Command Arguments

Command arguments are data, objects, text, digits, etc that the Linux command acts on.  Command arguments are optional. Linux commands can be executed with or without command arguments. Some Linux commands require mandatory arguments that we need to pass for the command to work.

For example, the cp Linux command requires two command arguments. The existing file to copy and the target name of the copy of the file.

$ cp exisitingFile.txt  newFileCopy.txt

—

Linux Commands Tutorial page:

https://www.testingdocs.com/linux-basic-commands-tutorial/

More Information on Ubuntu Linux:
https://ubuntu.com/

Related Posts

sudo auth log entry

Linux commands /

sudo Linux Command with Examples

Common File Commands in Linux

Linux commands /

Common File Commands in Linux

su linux command

Linux commands /

su Linux Command

ls linux command

Linux commands /

ls Linux Command with Examples

touch create file

Linux commands /

touch Linux Command

‹ Linux directory commands› which Linux command

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version