What is Linux¶
Linux is an operating system that was developed by Linus Torvalds in 1991. The name “Linux” originates from the Linux kernel. It is an open-source software that is completely free to use. It is used for computer hardware and software, game development, mainframes, etc. It can run various client programs.
Command-line interface¶
A command line interface (CLI) is a text-based interface where you can input commands that interact with a computer's operating system.
Get Help on Shell/Terminal¶
8 Ways To Get Help On The Linux Shell
How to use --h or --help?
I prefer --help
mkdir: invalid option -- 'h'
Try 'mkdir --help' for more information.
[root@rhel ~]#
mkdir -h
mkdir --help
[root@rhel ~]# mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, --mode=MODE set file mode (as in chmod), not a=rwx - umask
-p, --parents no error if existing, make parent directories as needed
-v, --verbose print a message for each created directory
-Z set SELinux security context of each created directory
to the default type
--context[=CTX] like -Z, or if CTX is specified then set the SELinux
or SMACK security context to CTX
--help display this help and exit
--version output version information and exit
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation <https://www.gnu.org/software/coreutils/mkdir>
or available locally via: info '(coreutils) mkdir invocation'
[root@rhel ~]#
-h vs --help
To sum up, the Linux shell provides access to help information for commands through both -h and —help.
However, —help is a more uniform and universal option that may be used with a variety of commands. Shorter and occasionally used, -h can have varying availability and significance.
It is advised to use --help to reliably obtain help information, particularly for commands that are unknown.
-h
--help
man
info
apropos
whatis
dpkg -S
https://vitux.com/get-help-on-linux-shell/
File System Operations¶
ls - List Directory Contents
cd
pwd
mkdir
cp
mv
rm
touch
cat nano
System Information¶
uname -
df
free
hostname
Shell Scripting¶
File Transfer¶
File Permissions¶
Process Management¶
Networking¶
Package Management¶
User and Group Management¶
System Service¶
Extra¶
IPCS¶
[root@oracle ~]# ipcs -l
------ Messages Limits --------
max queues system wide = 32000
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 18014398509465599
max total shared memory (kbytes) = 18446744073709551612
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 32000
max semaphores per array = 32000
max semaphores system wide = 1024000000
max ops per semop call = 500
semaphore max value = 32767
[root@oracle ~]# cat /proc/sys/kernel/sem
32000 1024000000 500 32000
[root@oracle ~]# ipcs --help
Usage:
ipcs [resource-option...] [output-option]
ipcs -m|-q|-s -i <id>
Show information on IPC facilities.
Options:
-i, --id <id> print details on resource identified by <id>
-h, --help display this help
-V, --version display version
Resource options:
-m, --shmems shared memory segments
-q, --queues message queues
-s, --semaphores semaphores
-a, --all all (default)
Output options:
-t, --time show attach, detach and change times
-p, --pid show PIDs of creator and last operator
-c, --creator show creator and owner
-l, --limits show resource limits
-u, --summary show status summary
--human show sizes in human-readable format
-b, --bytes show sizes in bytes
For more details see ipcs(1).
[root@oracle ~]# ipcs man
------ Message Queues --------
key msqid owner perms used-bytes messages
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x9700f349 98304 root 600 3294 2
0x8c00f34a 98305 root 600 1473 2
0x2e00f34b 98306 root 600 3294 2
0x2f00f34c 98307 root 600 1473 2
0x6500f34d 98308 root 600 3294 2
0xb700f355 98309 root 600 1473 2
0x8b00f356 98310 root 600 3294 2
0x5d00f357 98311 root 600 1473 2
0x6200f345 65596 root 600 3294 2
0x1000f346 65597 root 600 1473 2
0x3700f347 65598 root 600 3294 2
0x4e00f348 65599 root 600 1473 2
------ Semaphore Arrays --------
key semid owner perms nsems
0x00000000 19 lpfsg 600 32
[root@oracle ~]# see ipcs
bash: see: command not found...
man ipcs
^C
[root@oracle ~]# man ipcs
IPCS(1) User Commands IPCS(1)
NAME
ipcs - show information on IPC facilities
SYNOPSIS
ipcs [options]
DESCRIPTION
ipcs shows information on System V inter-process communication facilities. By default it shows information about all three resources: shared memory segments,
message queues, and semaphore arrays.
OPTIONS
-i, --id id
Show full details on just the one resource element identified by id. This option needs to be combined with one of the three resource options: -m, -q or -s.
-h, --help
Display help text and exit.
-V, --version
Display version information and exit.
Resource options
-m, --shmems
Write information about active shared memory segments.
-q, --queues
Write information about active message queues.
-s, --semaphores
Write information about active semaphore sets.
-a, --all
Write information about all three resources (default).
Output formats
Of these options only one takes effect: the last one specified.
-c, --creator
Show creator and owner.
-l, --limits
Show resource limits.
-p, --pid
Show PIDs of creator and last operator.
-t, --time
Write time information. The time of the last control operation that changed the access permissions for all facilities, the time of the last msgsnd(2) and
msgrcv(2) operations on message queues, the time of the last shmat(2) and shmdt(2) operations on shared memory, and the time of the last semop(2) operation on
semaphores.
-u, --summary
Show status summary.
Representation
These affect only the -l (--limits) option.
-b, --bytes
Manual page ipcs(1) line 1/87 55% (press h for help or q to quit)
Tuning and Optimizing Red Hat Enterprise Linux
https://www.ibm.com/docs/en/db2/11.1?topic=unix-modifying-kernel-parameters-linux
Setting Semaphore Parameters¶
To determine the values of the four described semaphore parameters, run:
cat /proc/sys/kernel/sem
250 32000 32 128
These values represent SEMMSL, SEMMNS, SEMOPM, and SEMMNI. Alternatively, you can run:
ipcs -ls