--Memo the content you were interested in as a memorandum ――Please note that the description is not exhaustive.
| --- | --- | --- |
|---|---|---|
| rpm | -e(--erase) | Uninstall a package |
| -l (--list) | View files contained in the specified package | |
| -a (--all) | View all installed packages | |
| Other | remove | Uninstall a package |
| list | Search and view installed packages | |
| dpkg | -s(--status) | Detailed package information |
| apt-cache | show | Detailed package information |
| Other | info | Detailed package information |
| dpkg | -S (--search) | Shows from which package the specified file was installed |
| Other (apt is apt-Become a cache) | search | Search for packages with the specified keyword |
| --- | --- | --- |
|---|---|---|
| yum | chack-update | View updatable packages |
| zypper | list-updates(lu) | View updatable packages |
| --- | --- | --- |
|---|---|---|
| yum | Do not omit options | -Do not use |
| apt | Do not omit options | -Do not use |
| zypper | Omit options to 2 characters | -Do not use |
--Create partition
- fdisk
- parted
--File system implementation
- ext2~4
--ext2 does not support journals
--Commands: mkfs, mke2fs
--Parameter setting command: tune2fs
- XFS
--Command; mkfs.xfs
--Mount
--Description in fstab, etc.
| system | Overview | command |
|---|---|---|
| dmesg | A command to display the message output by the Linux kernel at boot time | dmesg |
| systemd-journald | Standard log collection and storage service | journalctl |
--Ext2 is selected by default (all of the following use ext2 for type)
| --- | --- |
|---|---|
| mkfs /dev/hda1 | mkfs -t ext2 /dev/hda1 |
| mke2fs /dev/hda1 | mke2fs -t ext2 /dev/hda1 |
| --- | --- |
|---|---|
| rescue.target | runlevel1.target |
--- b t (number the lines excluding blank lines) is the default
--Usually change the runlevel using numbers - telinit 5 - init 5 --As an exception, if you want to reload "/ etc/inittab" without restarting the system, do the following: --telinit q or telinit Q --init q or init Q
| Distribution | Package management | Dependency management |
|---|---|---|
| Red Hat | rpm | yum (There is also dnf as a successor to yum) |
| Fedora | rpm | dnf (Also the successor to yum)(Became the default management tool from Fedora 22) |
| Debian | dpkg | apt |
| openSUSE | rpm | zypper |
Only --f takes a file name as an argument. Only --p takes a package file name as an argument.
| option | Overview |
|---|---|
| -q(--query)package name | Check if the specified package is installed |
| -V(--verify)package name | Package inspection |
| The following combined options | Overview |
| -a (--all) | View all installed packages |
| -l (--list) | View files contained in the specified package |
| -i (--info) | Detailed information on the specified package |
| -f (--file)file name | Shows from which package the specified file was installed |
| -p (--package)Package file name | Referral target is a package file |
| --changelog | Display change history of specified package |
| -c (--configfiles) | Display configuration file |
| --nomd5 | Do not inspect file tampering with MD5 |
| -R (--require) | View files that the specified package depends on |
| option | Overview |
|---|---|
| -i(--install)Package file name | Package installation |
| -U(--upgrade)Package file name | Package upgrade (install if not) |
| -F(--freshen)Package file name | Package upgrade (do not install without) |
| -e(--erase)package name | Uninstall a package |
| The following combined options | Overview |
| -v | Display detailed information |
| -h (--hash) | Show progress with "#" |
| --test | Do not run, run test |
| -nodeps | Ignore dependencies |
| option | Overview |
|---|---|
| dpkg-reconfigure | Reconfigure as you did when you installed the installed packages |
| -E | If the same version is already installed, do not install |
| -G | Do not install if the new version is already installed |
| -R | Specify the directory name, recursively search the package files stored in the specified directory, and install the packages together. |
| The following actions | Overview |
| -i (--install) | Package installation |
| -r (--remove) | Uninstall the package leaving the settings fal |
| -P (--purge) | Uninstall including setting fal |
| -l (--list) | Search and view installed packages |
| -L (--listfiles) | List files installed from the specified package |
| -s (--status) | View detailed information about installed packages |
| -S (--search) | Shows from which package the specified file was installed |
| -C (--audit) | View packages that have not been installed (incomplete) |
--yum configuration file - /etc/yum.conf --/etc/yum.repos.d = Package acquisition source (repository) is set in the file in the directory --zypper config file =
| yum subcommand | Overview | zypper subcommand |
|---|---|---|
| install package name | Installation | install (in) |
| update Package name (If executed without specifying a package, all updatable packages will be updated) | update | update(up) |
| remove package name | Uninstall | remove(rm) |
| info Package name | Display detailed information | info |
| list package name | List display / version and whether it is installed or not | None |
| search keyword | Search for packages with the specified keyword | search(se) |
| check-update package name | View updatable packages | list-updates(lu) |
| grouplist | List of package groups | None |
| groupinstall group | Group installation of packages | None |
| None | List repositories | repos(lr) |
| None | Repository update | refresh |
| Subcommand | Overview |
|---|---|
| install package name | Installation |
| update | Updated package database to the latest version |
| upgrade | Upgrade all installed packages |
| info Package name | Display detailed information |
| dist-upgrade | Upgrade your distribution to the latest version |
| clean | Delete the package file acquired in the past |

ldd --Command to search library --You can use ldd/etc/ls to search for the library used by the command. --Command to update the cache file "/etc/ld.so.cache" of the shared library - ldconfig
--Called after booting the BIOS to boot the OS and kernel
grub-install
version
GRUB
setting file - /boot/grub/grub.conf - /boot/grub/menu.list
GRUB2
setting file --/boot/grub/grub.cfg (do not edit directly) - /etc/default/grub - /etc/grub.d
--Saved in 446 bytes of storage --The rest is the route table 16 bytes * 4 and 2 bytes boot signature
| name | Feature |
|---|---|
| SysVinit | Manage system state by runlevel |
| Upstart | Manage system state by runlevel |
| systemd | Manage system state by target |
--systemd subcommand collection --systemd command is systemctl --systemctl subcommand [Unit name]
| name | Feature |
|---|---|
| Shell variables | Valid only on the shell |
| Environment variable | Can be called by any action of an application command executed in the shell |
--Major premise --The value of the environment variable cannot be retained permanently with the export command, so it must be described in the configuration file. (.Zshrc for zsh, .bash_profile for bash) --Environment variable (path) --Search and execute from the directory set in the environment variable PATH (the so-called path is in the path) --export PATH = $ PATH: directory --If the command is in a directory that is in the path, you can execute it only by the command name without specifying the path where the command is stored. --Environment variables are provided for each user. For example, the environment variables used by user1 and user2 can have different values. --Environment variables (other than paths) --Some are set by default (USER, HOME, etc.) --Set with export environment variable name = "value"
--Change shell variables to environment variables --Set by export shell variable name (after all, with export environment variable name = "value")
--tar [option] [directory name] [file name]
--When creating hoge.tar that archives aa, bb, cc, the description is as follows (The archive name is described first)
% tar cf hoge.tar aa bb cc
--- c (Create new archive) --- x (extract from archive) --- t (Display archive information) --It is not compressed, and if you keep the information before putting it together, it may be larger than the original file procedure.
--cpio [option]
--- o (create a new archive)
--- i (extract from archive)
-- Accept only from standard input
% cpio -i <file name.cpio
--Search for various things from the process to the contents of the file
--By default, the line corresponding to the search target is displayed.
| name | Feature | Example |
|---|---|---|
| grep | Search using regular expressions | grep search regular expression filename |
grep -E |
Search using both extended regular expressions and regular expressions | grep -E Extended regular expression file name |
| egrep | Search using both extended regular expressions and regular expressions | egrep search regular expression or extended regular expression filename |
| fgrep | Search for the entered character string as it is | egrep "String"file name |
grep -F |
Search for the entered character string as it is | grep -F "String"file name |
| pgrep | In a running processFind the process ID using patterns that represent process names, users, groups, terminal names, etc. |
pgrep [option] [Patterns such as process names] |
% dmesg | tee -a log.txt
--Receive the standard output of dmesg as a standard input with a pipe, and add both the standard output (1) and log.txt. If you do not specify the option -a (probably an abbreviation for add), it will be overwritten (>).
--ln [option] Link source Link destination --Create hard link without options --Hard link --A link that directly refers to the actual file --Director hard links cannot be created (to prevent the creation of circular directories) --Cannot be created on different partitions (because inodes are managed separately and may be duplicated) --Create symbolic link with option -s --Symbolic link --A link pointing to the location of the original file (like a shortcut in Windows)
--Files (including directories) are managed using "file entity (data body)" and "inode" --inode is like a label --Files are deleted when inode (hard link) reaches 0
--Move the "test1.txt" file to the "dir1" directory in the current directory and rename the file to "test2.txt"
% mv test1.txt dir1/test2.txt
| command | Feature |
|---|---|
| kill | Specify PID |
| killall | Specify the target by process name |
| pkill | Specify the target process name with a regular expression |
--kill [-signal name or-signal number] [process ID] --killall [-signal name or-signal number] --killall -s [-signal name or-signal number] --pkill [-signal name or-signal number] process name (command name) --pkill --signal [-signal name or-signal number] process name (command name) -* 15 (TERM) is selected if no signal is specified for killall and pkill.
| option | Overview |
|---|---|
| top | The command to update and display the process operation status at regular intervals is top |
| ps | A command that displays the currently running process, but does not update the displayed content at regular intervals. |
| uptime | Show current system load average |
| free | Display memory and swap area usage |
--ps [option] --There are BSD options without "-" and UNIX options starting with "-".
Docker
| command | Overview |
|---|---|
| cat | Show all file contents |
| tail | Display by specifying the end of the file |
| nl | View files with line numbers |
| head | Show top of file |
| sort | Sort the contents of the file by line |
| paste | Combine multiple files line by line |
| fmt | Format text by specifying the maximum number of characters per line |
| wc | Check the number of characters and lines in the file |
| uniq | Show consecutive duplicate lines in a sorted file on one line |
| cut | Extracts and displays the specified field from each line of the text file |
| split | Split the file by the specified number of lines |
A means of using multiple terminals on one terminal by operating a program that controls virtual terminals instead of using a large number of terminal programs.
VM virsh --A shell for working with libvirt (a library for open source virtualization management) --Various operations such as virtual machine resource management and virtual network management are possible --Command collection
--You can change the owned group --chown [-R]: group name file or directory --chgrp [-R] group name file or directory --Use the "-R" option to recursively change the owning user or group of the specified directory and the files under it. --If there is no "-R" option, change the owning group for directories only
--Three digits represent the status of users (U), groups (G), and others (O) --The situation is the total value of the following numbers --If it is 753, [Full authority (4 + 2 + 1)] [Read / execute (4 + 1)] [Write / execute (2 + 1)]
| Authority | symbol | Numerical value |
|---|---|---|
| reading | r | 4 |
| Writing | w | 2 |
| Run | x | 1 |
--Command to search files and directories under the specified directory --find [search starting directory] [search expression] [action]
| Feature | the difference | |
|---|---|---|
| snap shot | Updated data | Updated dataのみ更新 |
| backup | All storage contents | Save all of the storage area |
--To execute Linux commands without exiting the vi editor, execute the following vi command in command mode. -:![Command] --Example:! Ls The left indicates that the ls command was executed in the current directory.
| name | Feature |
|---|---|
| -n lines or-Number of lines | 指定したNumber of linesをファイルの末尾から表示 |
| -c bytes | Display the specified number of bytes from the end of the file |
| -f | Keep displaying lines added to the end of the file |
--Sed seems to be considered as upward compatible with tr
| command | Feature | important |
|---|---|---|
| tr | Can be replaced and deleted | Standard input and standard outputIs used, so if you want to process the file, use the "cat" command etc. |
| sed | In addition to the tr function, you can add | Specified fileIs processed according to the command and output to standard output. |
--Nice values (priority) are both -20 to 19 (-20 is the highest priority and 19 is the lowest priority)
--The default nice value if nothing is specified is 10
--The default reason value when nothing is specified is 0
--Nice value description method is different for each
--In nice, -(hyphen) is accompanied, so -10 becomes --10.
--In renice, -(hyphen) is not accompanied, so -10 becomes 10.
| command | Feature | Example |
|---|---|---|
| nice | Execute the command by specifying the run-time priority | nice -10 Command name, or nice-n 10 command name |
| renice | Change the priority of running processes | renice 10 (-p)Process ID, Or renice-n 10 (-p)Process ID |
| command | Feature |
|---|---|
| du (abbreviation for disk usage) | Directory usage |
| df (abbreviation for disk free) | Directory availability |
| command | Feature | Example |
|---|---|---|
| Symbolic link | Record the path | |
| Hard link | Link to the actual situation based on the inode number |
| command | Feature | Example |
|---|---|---|
| fdisk | MBR format partition operation command | |
| parted | MBR and gpt format partition operation commands | |
| mkfs | Create a file system |
--mount is a mounting operation that embeds a disk device in a Linux directory and makes it usable.
| command | Feature | Example |
|---|---|---|
| fstab(filesystem table) | Describes the devices that are mounted by default at boot time | |
| mtab(mounted filesystem table) | Describes the device currently cloaked,Automount is not set at startup, and what is mounted after startup is described in the file |
tune2fs --Perform existing file system management operations --Different from mkfs in that it creates a file system
| command | Feature | Example |
|---|---|---|
| tune2fs | ext2, ext3, ext4 file system parameters changed |
telinit --Try to change the runlevel.
UUID --UUID (Universally Unique Identifier) is an identifier that uniquely identifies an object on software.
--Device files that transfer data in block units instead of character units when accessed --Commands that can display the UUID of the device
| command |
|---|
| lsblk |
| blkid |
Recommended Posts