Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

78 total results found

Pipe

Linux Command Line and Shell Scripting ... Process

Basic Concepts A pipe can use the output of one command as the input of the next command, represented by the symbol | in the command-line environment, which is a form of one-way communication between processes, implemented based on file descriptors. Working ...

proc
lclssb
linux
operating-system

Systemd

Linux Command Line and Shell Scripting ... Process

The first process of the system, with a process ID of 1. ps -p 1 PID TTY TIME CMD 1 ? 00:00:04 systemd However, when we want to display detailed information, the result will be different. ps -p 1 -f UID PID PPID C STIME TTY TIME CMD r...

proc
lclssb
linux
operating-system

ULIMIT

Linux Command Line and Shell Scripting ... Process

[todo]

lclssb
proc
linux
operating-system

Linux Torvalds

Linux Command Line and Shell Scripting ...

How to pronounce this name is quite curious, searched it, and someone even made a collection, oh my god, haha. Definition of Linux According to Wikipedia, Linux is both a Unix-like kernel and a generic term for an open-source Unix-like operating system based...

lclssb
linux
operating-system

Condition

Linux Command Line and Shell Scripting ... Script

If Statement If the exit code of command is 0, then execute the content of then. if command then ... fi Another form. if command; then ... fi Else if command; then ... else ... fi Elif if command; then ... elif command; then ... fi ...

script
lclssb
linux
operating-system

Function

Linux Command Line and Shell Scripting ... Script

Creating a Function function name { commands } or name() { commands } Function Return Value There are multiple forms of return values. Using $? Represents the exit status code of the last command in the function. echo $? Using Return #!/usr/bin/en...

operating-system
linux
script
lclssb

Input

Linux Command Line and Shell Scripting ... Script

Positional Parameters Positional Parameters, script positional parameters. $0: script name, including path. $1: the first argument, and so on. ${10}: arguments greater than 9 need to use curly braces. #!/usr/bin/env bash echo $0 echo $1 ./foo a ./foo a ...

script
lclssb
linux
operating-system

Loop

Linux Command Line and Shell Scripting ... Script

For Statement for var in list do ... done The var variable can be normally used outside the loop body. #!/usr/bin/env bash for var in apple banana do echo "hello $var" done echo "outside $var" hello apple hello banana outside var Storing a list in...

lclssb
script
linux
operating-system

Output

Linux Command Line and Shell Scripting ... Script

Standard File Descriptors Standard File Descriptors. Name Number Description STDIN 0 Standard Input STDOUT 1 Standard Output STDERR 2 Standard Error Standard Input The cat command reads content from the standard input by default. If you run cat ...

script
lclssb
linux
operating-system

Parameter Expansion

Linux Command Line and Shell Scripting ... Script

In Bash, parameter expansion is a mechanism for manipulating and handling the contents of variables. Through parameter expansion, you can get the value of a variable, modify the value of a variable, or provide a default value for an unset variable. Shell Param...

script
lclssb
linux
operating-system

Signal

Linux Command Line and Shell Scripting ... Script

Bash Shell By default, the Bash Shell ignores the SIGQUIT(3) and SIGTERM(15) signals, so executing the following commands will not have any effect ($$ is the process ID of the current Shell). kill -3 $$ kill -15 $$ If the SIGHUP(1) signal is received, the B...

script
lclssb
linux
operating-system

Special Parameters

Linux Command Line and Shell Scripting ... Script

Parameters: $? The exit code of the previous command or script, 0 for success, non-0 for failure. ls 404 echo $? Will output 2, indicating failure. The return code can be specified in scripts using exit. Parameters: $# Indicates the number of arguments pas...

script
lclssb
linux
operating-system

Basic Syntax

Linux Command Line and Shell Scripting ... Script

Shebang #!/usr/bin/env bash Variable Assignment No spaces are allowed around the = sign. name=foo Double Quotes Can interpret variables. name=foo echo "hello, $name" # hello, foo echo "hello, \$\$" # hello, $$ echo "hello, \"\"" # hello, "" Single Quo...

lclssb
script
linux
operating-system

Basic Operations

Linux Command Line and Shell Scripting ... Shell

Default Shell echo $SHELL /bin/bash If you start a new Shell in the current terminal (e.g., switching from Bash to Zsh), this command still displays the default login Shell, which is configured in /etc/passwd. grep root /etc/passwd root:x:0:0:root:/root:/b...

shell
lclssb
linux
operating-system

Command History

Linux Command Line and Shell Scripting ... Shell

The Mysterious ^[[A First, start a new Shell /bin/sh. /bin/sh Then enter the following command, everything is normal. ls -l Press the up arrow key ⬆️ to view the previous command. ^[[A You will find that you cannot see the previous command, instead, these ...

shell
lclssb
linux
operating-system

Command Type

Linux Command Line and Shell Scripting ... Shell

Builtin Commands Builtin commands are implemented by the Shell itself, they run without starting a new process or calling an external program, which is the basic functionality of Shell operations. Builtin Commands Ex cd:Change the current working directory. ...

operating-system
shell
lclssb
linux

What is Shell

Linux Command Line and Shell Scripting ... Shell

A shell is a command-line interpreter that lets you interact with the operating system by typing and executing commands. GNU Bash Manual Bash is the default Shell in Linux, the official manual is forever divine. Bash Reference Manualhttps://www.gnu.org/softwa...

shell
lclssb
linux
operating-system

Subshell

Linux Command Line and Shell Scripting ... Shell

The definition of Subshell in some books or materials is unclear, and the explanations often contradict each other, making it difficult to understand. Therefore, to avoid this semantic and logical problem, we will not provide its definition (it is recommended ...

lclssb
shell
linux
operating-system

Terminal

Linux Command Line and Shell Scripting ... Shell

A terminal is a user interface, while a shell is running inside a terminal. Early Terminals Early terminals were standalone hardware devices used to connect to main computers or servers. They typically included: Input Device: such as a keyboard, used for in...

shell
lclssb
linux
operating-system

GAWK 1

Linux Command Line and Shell Scripting ... Text

Gnu Awk Gawk is the GNU version of the text processing tool. In most GNU/Linux distributions, Gawk is the default awk implementation, so there is usually no difference in daily use. readlink -f /usr/bin/awk /usr/bin/gawk The Gawk command defaults to using E...

text
lclssb
linux
operating-system