| 編集の要約なし | |||
| (同じ利用者による、間の91版が非表示) | |||
| 1行目: | 1行目: | ||
| 昔はこれら全て1つ1つが''アプリ''だった。粒度が小さく、基本的には役割分担が明確だったので  | 昔はこれら全て1つ1つが''アプリ''だった。粒度が小さく、基本的には役割分担が明確だったので Unix哲学の象徴だと言える。略語の意味を示すために説明は英語表記。 | ||
| __TOC__ | __TOC__ | ||
| 12行目: | 10行目: | ||
| !説明 | !説明 | ||
| |- | |- | ||
| |<code><nowiki>!!</nowiki></code> | |<code><nowiki>!!</nowiki></code> || 直前に実行したコマンドを実行 | ||
| |直前に実行したコマンドを実行 | |||
| |- | |- | ||
| | | |<code>Ctrl</code> + <code>r</code> || 履歴を検索して実行 | ||
| |履歴を検索して実行 | |||
| |- | |- | ||
| |<code>CMD1 ; CMD2</code> | |<code>CMD1 ; CMD2</code> || CMD1 を実行してから CMD2 を実行 | ||
| |CMD1 を実行してから CMD2  | |||
| |- | |- | ||
| |<code>CMD1 && CMD2</code> | |<code>CMD1 && CMD2</code> || CMD1 の終了ステータスが「0」なら CMD2 を実行 | ||
| |CMD1 の終了ステータスが「0」なら CMD2  | |||
| |- | |- | ||
| |<code><nowiki>CMD1 || CMD2</nowiki></code> | |<code><nowiki>CMD1 || CMD2</nowiki></code> || CMD1 の終了ステータスが「0」以外なら CMD2 を実行 | ||
| |CMD1 の終了ステータスが「0」以外なら CMD2  | |||
| |- | |- | ||
| |<code><nowiki>CMD1 | CMD2</nowiki></code> | |<code><nowiki>CMD1 | CMD2</nowiki></code> || CMD1 の出力を、CMD2 の入力へと渡すパイプ | ||
| |CMD1 の出力を、CMD2 の入力へと渡すパイプ | |||
| |- | |- | ||
| |<code>></code>, <code>1></code> | |<code>></code>, <code>1></code> || 標準出力先を指定 | ||
| |標準出力先を指定 | |||
| |- | |- | ||
| |<code>>></code> | |<code>>></code> || 標準出力先を指定(追記) | ||
| |標準出力先を指定(追記) | |||
| |- | |- | ||
| |<code>2></code> | |<code>2></code> || 標準エラー出力先を指定 | ||
| |標準エラー出力先を指定 | |||
| |- | |- | ||
| |<code>&></code> | |<code>&></code> || 標準出力先、標準エラー出力先の両方を指定 | ||
| |標準出力先、標準エラー出力先の両方を指定 | |||
| |- | |- | ||
| |<code><< eof</code> | |<code><< eof</code> || here document(EOF文字が出現するまでの内容を標準入力とする) | ||
| |here document(EOF文字が出現するまでの内容を標準入力とする) | |- | ||
| |<code>vi /etc/profile</code> || 全ユーザに共通するシェル環境を設定 | |||
| |} | |} | ||
| ==シェルスクリプト== | |||
|  if test -f /home/lpicuser/lpic.sh | |||
|  then | |||
|      /home/lpicuser/lpic.sh | |||
|  else | |||
|      /home/lpicuser/default.sh | |||
|  fi | |||
| * [[シェルスクリプト]] まとめ | |||
| ==コピー&ペースト== | ==コピー&ペースト== | ||
| 67行目: | 66行目: | ||
| !コマンド | !コマンド | ||
| !説明 | !説明 | ||
| |- | |||
| |<code>[[grub-mkconfig]]</code> || generate a GRUB configuration file | |||
| |- | |- | ||
| |<code>mkinitramfs</code> || initramfs image generator ( Debian ) | |<code>mkinitramfs</code> || initramfs image generator ( Debian ) | ||
| 75行目: | 76行目: | ||
| |- | |- | ||
| |<code>lsmod</code> || list Linux Kernel modules | |<code>lsmod</code> || list Linux Kernel modules | ||
| |- | |||
| |<code>modinfo</code> || show information about a Kernel modules | |||
| |- | |- | ||
| |<code>insmod</code> || insert a Kernel module | |<code>insmod</code> || insert a Kernel module | ||
| 83行目: | 86行目: | ||
| |- | |- | ||
| |<code>modprobe</code> || add and remove modules from Kernel | |<code>modprobe</code> || add and remove modules from Kernel | ||
| |} | |} | ||
| 104行目: | 105行目: | ||
| |virtual memory statistics | |virtual memory statistics | ||
| |- | |- | ||
| |<code>lsblk</code> || list storage, partition infomation | |<code>[[lsblk]]</code> || list storage, partition infomation | ||
| |- | |- | ||
| |<code>[[df]]</code> | |<code>[[df]]</code> | ||
| 110行目: | 111行目: | ||
| |- | |- | ||
| |<code>[[du]]</code> | |<code>[[du]]</code> | ||
| |disk used | |disk used on directory | ||
| |- | |- | ||
| |<code>lspci</code> || list  | |<code>[[lspci]]</code> || list Peripheral Component Interconnect devices | ||
| |- | |- | ||
| |<code>lsusb</code> || lsit USB devices | |<code>lsusb</code> || lsit USB devices | ||
| 118行目: | 119行目: | ||
| |<code>lsscsi</code> || list SCSI devices | |<code>lsscsi</code> || list SCSI devices | ||
| |- | |- | ||
| |<code>hwclock</code> || set hardware clock | |<code>[[hwclock]]</code> || set hardware clock | ||
| |- | |- | ||
| |<code>hdparm</code> || show HDD/SATA/IDE parameters | |<code>hdparm</code> || show HDD/SATA/IDE parameters | ||
| 165行目: | 166行目: | ||
| |make an ext2/ext3/ext4 filesystem | |make an ext2/ext3/ext4 filesystem | ||
| |- | |- | ||
| |<code>tune2fs</code> | |<code>[[tune2fs]]</code> | ||
| |adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems | |adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems | ||
| |- | |- | ||
| |<code>e2fsck</code> | |<code>[[e2fsck]]</code> | ||
| |check a Linux ext2/ext3/ext4 file system | |check a Linux ext2/ext3/ext4 file system | ||
| |- | |- | ||
| 193行目: | 194行目: | ||
| !コマンド | !コマンド | ||
| !説明 | !説明 | ||
| |- | |||
| |<code>[[systemctl]]</code> | |||
| |system mamager | |||
| |- | |- | ||
| |<code>screen</code> || terminal screen manager | |<code>screen</code> || terminal screen manager | ||
| 205行目: | 209行目: | ||
| |Tell how long the system has been running. | |Tell how long the system has been running. | ||
| |- | |- | ||
| |<code>uname</code> | |<code>[[uname]]</code> | ||
| |show system information | |show system information | ||
| |- | |- | ||
| 211行目: | 215行目: | ||
| |( = uname -m) show system hardware name | |( = uname -m) show system hardware name | ||
| |- | |- | ||
| |<code>hostname</code> | |<code>[[hostname]]</code> | ||
| |hostname | |hostname | ||
| |- | |- | ||
| 222行目: | 226行目: | ||
| |<code>initctl</code> | |<code>initctl</code> | ||
| |? | |? | ||
| |- | |- | ||
| |<code>chkconfig</code> | |<code>chkconfig</code> | ||
| 235行目: | 236行目: | ||
| |set System-V initial links | |set System-V initial links | ||
| |- | |- | ||
| |<code>sysctl</code> | |<code>[[sysctl]]</code> | ||
| |configure Kernel parameters | |configure Kernel parameters | ||
| |- | |- | ||
| |<code>ldd</code> | |<code>[[ldd]]</code> | ||
| | | |Library DepenDencies | ||
| |- | |- | ||
| |<code>ldconfig</code> | |<code>ldconfig</code> | ||
| 253行目: | 254行目: | ||
| |halt, power off, reboot machine | |halt, power off, reboot machine | ||
| |- | |- | ||
| |<code>shutdown</code> | |<code>[[shutdown]]</code> | ||
| |shutdown machine | |shutdown machine | ||
| |- | |- | ||
| 283行目: | 284行目: | ||
| |show machine's running processes | |show machine's running processes | ||
| |- | |- | ||
| |<code>[[ | |<code>[[pgrep]]</code> | ||
| | | |process grep. look up PID using process's name | ||
| |- | |||
| |<code>pkill</code> | |||
| |kill processes by name and other attributes | |||
| |- | |- | ||
| |<code> | |<code>killall</code> | ||
| | | |kill all processes by name | ||
| |- | |- | ||
| |<code>[[kill]]</code> | |<code>[[kill]]</code> | ||
| |kill process by PID | |kill process by PID | ||
| |- | |- | ||
| |<code> | |<code>[[nice]]</code> | ||
| | | |set program priority | ||
| |- | |- | ||
| |<code> | |<code>[[renice]]</code> | ||
| | | |alter program priority | ||
| |- | |- | ||
| |<code>lsof</code> | |<code>[[lsof]]</code> | ||
| |list files opened by processes | |list files opened by processes | ||
| |- | |- | ||
| 334行目: | 335行目: | ||
| |- | |- | ||
| |<code>last</code> | |<code>last</code> | ||
| |show  | |show a listing of last logged in users | ||
| |- | |- | ||
| |<code>lastlog</code> | |<code>lastlog</code> | ||
| | | |all users' the most recent login | ||
| |- | |- | ||
| |<code>w / who</code> | |<code>w / who</code> | ||
| 345行目: | 346行目: | ||
| |show logged-in users | |show logged-in users | ||
| |- | |- | ||
| |<code>useradd</code> | |<code>groups</code> | ||
| |show user's groups | |||
| |- | |||
| |<code>[[useradd]]</code> | |||
| |add a user ( useradd -m -s /bin/bash -G sudo hoge ) | |add a user ( useradd -m -s /bin/bash -G sudo hoge ) | ||
| |- | |- | ||
| |<code> | |<code>[[usermod]]</code> | ||
| |modify a user | |modify a user | ||
| |- | |- | ||
| |<code> | |<code>[[userdel]]</code> | ||
| | | |delete a user | ||
| |- | |- | ||
| |<code>groupadd</code> | |<code>groupadd</code> | ||
| |add a group | |add a group | ||
| |- | |- | ||
| |<code>groupmod</code> | |<code>groupmod</code> | ||
| |modify a group | |modify a group | ||
| |- | |- | ||
| |<code> | |<code>groupdel</code> | ||
| | | |delete a group | ||
| |- | |- | ||
| |<code> | |<code>[[getent]]</code> | ||
| | | |get entries from nsswitch.conf | ||
| |- | |- | ||
| |<code>passwd</code> | |<code>[[passwd]]</code> | ||
| |change user's password | |set or change user's password | ||
| |- | |- | ||
| |<code>gpasswd</code> | |<code>gpasswd</code> | ||
| |manage group password | |manage group password | ||
| |- | |||
| |<code>newgrp</code> | |||
| |log in to a new group | |||
| |- | |- | ||
| |<code>chpasswd</code> | |<code>chpasswd</code> | ||
| |change password in batch mode | |change password in batch mode | ||
| |- | |||
| |<code>[[chage]]</code> | |||
| |change / show user's account and password age | |||
| |- | |||
| |<code>[[chsh]]</code> | |||
| |change login shell | |||
| |- | |- | ||
| |<code>pwck</code> | |<code>pwck</code> | ||
| |check password file | |check password file | ||
| |- | |||
| |<code>finger</code> | |||
| |user's fingerprint | |||
| |- | |||
| |<code>chfn</code> | |||
| |change user's fingerprint | |||
| |- | |- | ||
| |<code>grpck</code> | |<code>grpck</code> | ||
| 398行目: | 405行目: | ||
| |<code>pwconv</code> | |<code>pwconv</code> | ||
| |convert password file | |convert password file | ||
| |- | |||
| |<code>quota</code> | |||
| |show user and group quota of strage | |||
| |- | |||
| |<code>repquota</code> | |||
| |show quota status | |||
| |- | |||
| |<code>quotaon</code> | |||
| |activate quota | |||
| |- | |- | ||
| |<code>edquota</code> | |<code>edquota</code> | ||
| 428行目: | 444行目: | ||
| |<code>[[date]]</code> | |<code>[[date]]</code> | ||
| |show date | |show date | ||
| |- | |||
| |<code>tzselect</code> | |||
| |select timezone | |||
| |- | |||
| |<code>timedatectl</code> | |||
| |Control the system time and date | |||
| |- | |- | ||
| |<code>cal</code> | |<code>cal</code> | ||
| 434行目: | 456行目: | ||
| |<code>[[set]]</code> | |<code>[[set]]</code> | ||
| |show shell environment. set >> env | |show shell environment. set >> env | ||
| |- | |||
| |<code>[[unset]]</code> | |||
| |unset shell environment | |||
| |- | |- | ||
| |<code>env</code> | |<code>env</code> | ||
| 441行目: | 466行目: | ||
| |(= env) show environment | |(= env) show environment | ||
| |- | |- | ||
| |<code>export</code> | |<code>[[locale]]</code> | ||
| |get locale-specific information | |||
| |- | |||
| |<code>[[export]]</code> | |||
| |export environment from shell's env to user's env | |export environment from shell's env to user's env | ||
| |- | |- | ||
| 447行目: | 475行目: | ||
| |show command history | |show command history | ||
| |- | |- | ||
| |<code>alias  | |<code>alias</code> | ||
| |make alias | |make alias | ||
| |- | |||
| |<code>unalias</code> | |||
| |unmake alias | |||
| |- | |- | ||
| |<code>fc</code> | |<code>fc</code> | ||
| 465行目: | 496行目: | ||
| |run command with special root directory | |run command with special root directory | ||
| |- | |- | ||
| |<code>crontab</code> | |<code>[[crontab]]</code> | ||
| |manage cron | |manage cron | ||
| |- | |- | ||
| 555行目: | 586行目: | ||
| |show tee-style directory | |show tee-style directory | ||
| |- | |- | ||
| |<code>ls</code> | |<code>[[ls]]</code> | ||
| |list | |list | ||
| |- | |- | ||
| 612行目: | 643行目: | ||
| |move, change | |move, change | ||
| |- | |- | ||
| |<code>rm</code> | |<code>[[rm]]</code> | ||
| |remove | |remove | ||
| |- | |- | ||
| 630行目: | 661行目: | ||
| |user mask | |user mask | ||
| |- | |- | ||
| |<code>split</code> | |<code>[[split]]</code> | ||
| |split a file into pieces. 1,000 rows chunk as default | |split a file into pieces. 1,000 rows chunk as default | ||
| |- | |- | ||
| 666行目: | 697行目: | ||
| |calculate md5 or sha1 | |calculate md5 or sha1 | ||
| |- | |- | ||
| |<code>iconv</code> | |<code>[[iconv]]</code> | ||
| |change file encoding | |change file encoding | ||
| |- | |- | ||
| 696行目: | 727行目: | ||
| !説明 | !説明 | ||
| |- | |- | ||
| |<code>echo</code> | |<code>[[echo]]</code> | ||
| |display a line of text | |display a line of text | ||
| |- | |- | ||
| |<code>tee</code> | |<code>[[tee]]</code> | ||
| |write std-output and life | |write std-output and life | ||
| |- | |- | ||
| 705行目: | 736行目: | ||
| |viewer | |viewer | ||
| |- | |- | ||
| |<code>less</code> | |<code>[[less]]</code> | ||
| |viewer | |viewer | ||
| |- | |- | ||
| 714行目: | 745行目: | ||
| |show tail part of file | |show tail part of file | ||
| |- | |- | ||
| |<code>cat</code> | |<code>[[cat]]</code> | ||
| |concatinate | |concatinate | ||
| |- | |- | ||
| 751行目: | 782行目: | ||
| |- | |- | ||
| |<code>ed</code> | |<code>ed</code> | ||
| |line editor | |line editor (Ken Thompson) | ||
| |- | |- | ||
| |<code>[[sed]]</code> | |<code>[[sed]]</code> | ||
| 857行目: | 888行目: | ||
| !コマンド | !コマンド | ||
| !説明 | !説明 | ||
| |- | |||
| |<code>[[netstat]]</code> | |||
| |network status | |||
| |- | |- | ||
| |<code>[[ss]]</code> | |<code>[[ss]]</code> | ||
| |show sockets | |show sockets | ||
| |- | |- | ||
| |<code>arp</code> | |<code>arp</code> | ||
| 869行目: | 900行目: | ||
| |<code>ipcalc</code> | |<code>ipcalc</code> | ||
| |ip calculator | |ip calculator | ||
| |- | |- | ||
| |<code>route</code> | |<code>route</code> | ||
| |ip routing table manager | |ip routing table manager | ||
| |- | |- | ||
| |<code>ifconfig</code> | |<code>[[ip]]</code> | ||
| |internet protocol mnager | |||
| |- | |||
| |<code>[[ifconfig]]</code> | |||
| |interface configure | |interface configure | ||
| |- | |- | ||
| 903行目: | 934行目: | ||
| |firewall manager | |firewall manager | ||
| |- | |- | ||
| |<code>ping</code> | |<code>[[ping]]</code> | ||
| |send ICMP ECHO_REQUEST | |send ICMP ECHO_REQUEST | ||
| |- | |- | ||
| |<code> | |<code>[[traceroute]]</code> | ||
| | | |print the route packets trace to network host | ||
| |- | |- | ||
| |<code>arping</code> | |<code>arping</code> | ||
| 960行目: | 991行目: | ||
| |? | |? | ||
| |- | |- | ||
| |<code>host</code> | |<code>[[host]]</code> | ||
| |DNS lookup | |DNS lookup | ||
| |- | |- | ||
| 966行目: | 997行目: | ||
| |DNS lookup | |DNS lookup | ||
| |- | |- | ||
| |<code>dig</code> | |<code>[[dig]]</code> | ||
| |DNS lookup | |DNS lookup | ||
| |- | |- | ||
| 987行目: | 1,018行目: | ||
| |network investigator | |network investigator | ||
| |- | |- | ||
| |<code>gpg</code> | |<code>[[gpg]]</code> | ||
| | | |OpenPGP encryption and signing tool | ||
| |- | |- | ||
| |<code>openssl</code> | |<code>openssl</code> | ||
| 1,028行目: | 1,059行目: | ||
| ===画像を一括して圧縮=== | ===画像を一括して圧縮=== | ||
|   # find /var/www/html/wp-content/uploads/ -name *.jpg | xargs -t -I{} convert {} -sampling-factor 4:2:0 -strip -quality 90 -interlace JPEG -colorspace sRGB {} |   # find /var/www/html/wp-content/uploads/ -name *.jpg | xargs -t -I{} convert {} -sampling-factor 4:2:0 -strip -quality 90 -interlace JPEG -colorspace sRGB {} | ||
| * root が<code>/etc/</code>に nologinファイルを作成すると全ての一般ユーザがログイン不可になる。ファイルに内容を記載した場合は、それがログイン拒否時に表示される | |||
2022年11月29日 (火) 23:35時点における最新版
昔はこれら全て1つ1つがアプリだった。粒度が小さく、基本的には役割分担が明確だったので Unix哲学の象徴だと言える。略語の意味を示すために説明は英語表記。
シェルコマンド
| コマンド | 説明 | 
|---|---|
| !! | 直前に実行したコマンドを実行 | 
| Ctrl+r | 履歴を検索して実行 | 
| CMD1 ; CMD2 | CMD1 を実行してから CMD2 を実行 | 
| CMD1 && CMD2 | CMD1 の終了ステータスが「0」なら CMD2 を実行 | 
| CMD1 || CMD2 | CMD1 の終了ステータスが「0」以外なら CMD2 を実行 | 
| CMD1 | CMD2 | CMD1 の出力を、CMD2 の入力へと渡すパイプ | 
| >,1> | 標準出力先を指定 | 
| >> | 標準出力先を指定(追記) | 
| 2> | 標準エラー出力先を指定 | 
| &> | 標準出力先、標準エラー出力先の両方を指定 | 
| << eof | here document(EOF文字が出現するまでの内容を標準入力とする) | 
| vi /etc/profile | 全ユーザに共通するシェル環境を設定 | 
シェルスクリプト
if test -f /home/lpicuser/lpic.sh
then
    /home/lpicuser/lpic.sh
else
    /home/lpicuser/default.sh
fi
- シェルスクリプト まとめ
コピー&ペースト
Linux では通常の「クリップボード」に加えて「X・プライマリ・セレクション」も利用できる。
| コマンド | 説明 | 
|---|---|
| ハイライト + ホイールボタン | ハイライト部分を新規にペースト | 
| xclip | clip to X-selections and clipboard | 
カーネル管理
| コマンド | 説明 | 
|---|---|
| grub-mkconfig | generate a GRUB configuration file | 
| mkinitramfs | initramfs image generator ( Debian ) | 
| dracut | initramfs image generator ( RH ) | 
| dmesg | display Kernel message ring | 
| lsmod | list Linux Kernel modules | 
| modinfo | show information about a Kernel modules | 
| insmod | insert a Kernel module | 
| rmmod | remove a Kernel module | 
| depmod | generate modules.dep | 
| modprobe | add and remove modules from Kernel | 
デバイス管理
| コマンド | 説明 | 
|---|---|
| lscpu | list CPU info | 
| dmidecode | dumping a computer's DMI table contents | 
| free | free memory | 
| vmstat | virtual memory statistics | 
| lsblk | list storage, partition infomation | 
| df | disk free on filesystem | 
| du | disk used on directory | 
| lspci | list Peripheral Component Interconnect devices | 
| lsusb | lsit USB devices | 
| lsscsi | list SCSI devices | 
| hwclock | set hardware clock | 
| hdparm | show HDD/SATA/IDE parameters | 
| sdparm | access SCSI mode page | 
| loadkeys | loadkeybords | 
| wodim | write to CD/DVD | 
| growisofs | write iso image to DVD | 
パーティション管理
| コマンド | 説明 | 
|---|---|
| fdisk | fixed disk. manipulate disk partition table | 
| gdisk | GUID Partition Table (GPT) manipulator | 
| parted | a partition edit program | 
| gparted | GNU partition edit program | 
| partx | show partitions | 
| mkswap | make a Linux swap area | 
| swapon | enable devices and files for swapping | 
| swapoff | disable devices and files for swapping | 
ファイルシステム管理
| コマンド | 説明 | 
|---|---|
| mke2fs | make an ext2/ext3/ext4 filesystem | 
| tune2fs | adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems | 
| e2fsck | check a Linux ext2/ext3/ext4 file system | 
| mkfs | make a Linux filesystem | 
| fsck | file system check | 
| debugfs | ext2/ext3/ext4 file system debugger | 
| mount | mount a filesystem | 
| umount | unmount a filesystem | 
システム管理
| コマンド | 説明 | 
|---|---|
| systemctl | system mamager | 
| screen | terminal screen manager | 
| setterm | terminal settings | 
| tmux | ? | 
| chvt | change vertual terminal | 
| uptime | Tell how long the system has been running. | 
| uname | show system information | 
| arch | ( = uname -m) show system hardware name | 
| hostname | hostname | 
| hostnamectl | mamage hostname | 
| init | system mamager | 
| initctl | ? | 
| chkconfig | old way of systemctl | 
| runlevel | show runlevel | 
| update-rc.d | set System-V initial links | 
| sysctl | configure Kernel parameters | 
| ldd | Library DepenDencies | 
| ldconfig | ldd configure | 
| logger | enter message to system log | 
| journalctl | system log manager | 
| halt | halt, power off, reboot machine | 
| shutdown | shutdown machine | 
| which | locate a command | 
| whereis | locate the binary, source, and manual page files for a command | 
| busybox | command tool box | 
プロセス管理
| コマンド | 説明 | 
|---|---|
| top | ( = htop ) show top processes | 
| pstree | show machine's running processes as tree | 
| ps | show machine's running processes | 
| pgrep | process grep. look up PID using process's name | 
| pkill | kill processes by name and other attributes | 
| killall | kill all processes by name | 
| kill | kill process by PID | 
| nice | set program priority | 
| renice | alter program priority | 
| lsof | list files opened by processes | 
| pidof | process id open file | 
| fuser | identify file opening process | 
| pwdx | pwd for process | 
| jobs | show working jobs | 
| bg | doing job at background | 
| fg | doing job at forgraound | 
| nohup | run command without logout hang up | 
ユーザ管理
| コマンド | 説明 | 
|---|---|
| last | show a listing of last logged in users | 
| lastlog | all users' the most recent login | 
| w / who | show logged-in users | 
| users | show logged-in users | 
| groups | show user's groups | 
| useradd | add a user ( useradd -m -s /bin/bash -G sudo hoge ) | 
| usermod | modify a user | 
| userdel | delete a user | 
| groupadd | add a group | 
| groupmod | modify a group | 
| groupdel | delete a group | 
| getent | get entries from nsswitch.conf | 
| passwd | set or change user's password | 
| gpasswd | manage group password | 
| newgrp | log in to a new group | 
| chpasswd | change password in batch mode | 
| chage | change / show user's account and password age | 
| chsh | change login shell | 
| pwck | check password file | 
| finger | user's fingerprint | 
| chfn | change user's fingerprint | 
| grpck | check group file | 
| vipw / vigr | edit password / group file | 
| pwconv | convert password file | 
| quota | show user and group quota of strage | 
| repquota | show quota status | 
| quotaon | activate quota | 
| edquota | edit quota for user disk | 
| write / wall | write a massage to all users | 
| htpasswd | httpd basic authentication | 
| htdigest | httpd digest authentication | 
ユーザツール
| コマンド | 説明 | 
|---|---|
| id | show user's id | 
| whoami | who am i ? | 
| date | show date | 
| tzselect | select timezone | 
| timedatectl | Control the system time and date | 
| cal | show calendar | 
| set | show shell environment. set >> env | 
| unset | unset shell environment | 
| env | show user's enviroment | 
| printenv | (= env) show environment | 
| locale | get locale-specific information | 
| export | export environment from shell's env to user's env | 
| history | show command history | 
| alias | make alias | 
| unalias | unmake alias | 
| fc | ? | 
| su | switch user | 
| sudo | switch user do | 
| sg | switch group | 
| chroot | run command with special root directory | 
| crontab | manage cron | 
| expect | expect response | 
| at | ? | 
| script | ? | 
| stdbuf | modify buffering | 
| time | show round trip time | 
| watch | run program periodically | 
| sleep | set a moment before run | 
| exit | exit terminal | 
| make | compile file | 
| install | copy files | 
| yes | always say "yes" | 
| xargs | x-arguments | 
| git | git | 
| cvs | cvs | 
| svn | svn | 
| mysql | mysql client / server | 
| mysqldump | mysql dump databases | 
| xl | ? | 
| VBoxManage | ? | 
| lpadmin | configure cups printers | 
| lpstat | show cups printing status | 
| lp | submit files for printing | 
| lpr | subimt files for printing | 
| cancel | cancel printing job | 
ファイル / ディレクトリ操作
| コマンド | 説明 | 
|---|---|
| pwd | print working directory | 
| tree | show tee-style directory | 
| ls | list | 
| cd | change directory | 
| find | find files | 
| locate | location of files | 
| updatedb | update database for locate | 
| basename | base name of file | 
| dirname | name of directory | 
| file | show types of files | 
| stat | status of file | 
| lsattr | list file attributes on a Linux second extended file system | 
| chattr | change file attribution | 
| chmod | change mode | 
| chown | change owner of file | 
| chgrp | change owner group | 
| mkdir | make a directory | 
| rmdir | remove direcotory | 
| touch | touch a file | 
| cp | copy | 
| mv | move, change | 
| rm | remove | 
| shred | shred files | 
| ln | make links between files | 
| readlink | show symbolic link | 
| tmpwatch | ? | 
| umask | user mask | 
| split | split a file into pieces. 1,000 rows chunk as default | 
| truncate | shrink or expand file | 
| tar | type archive | 
| cpio | (= tar) copy files to and from archives | 
| gzip / gunzip | zip / unzip | 
| mktemp | make temporary file | 
| convmv | convert move | 
| dd | dump datas | 
| pv | pipe viewer | 
| base64 | base64 encode / decode | 
| od | dump files in octal and other formats | 
| md5sum / sha1sum | calculate md5 or sha1 | 
| iconv | change file encoding | 
| strings | show string parts in data file | 
| uuencode | ? | 
| uudecode | ? | 
| lhasa | ? | 
| unrar | ? | 
| pushd | ? | 
テキスト操作
| コマンド | 説明 | 
|---|---|
| echo | display a line of text | 
| tee | write std-output and life | 
| more | viewer | 
| less | viewer | 
| head | show head part of file | 
| tail / tailf | show tail part of file | 
| cat | concatinate | 
| tac | etanitacnoc | 
| nl | with number line | 
| grep | global reguler expression print | 
| uniq | show only uniq part | 
| wc | word count | 
| cut | cut | 
| rev | reverse | 
| seq | sequence | 
| sort | sort lines of text files | 
| tr | translate or delete characters | 
| ex | ex mode of vi | 
| ed | line editor (Ken Thompson) | 
| sed | stream editor | 
| vi | visual editor | 
| awk | patter scanning and processing language | 
| nkf | ? | 
| patch | patch a diff file | 
| diff | compare two files line by line | 
| comm | compare two files line by line | 
| cmp | compare two files byte by byte | 
| col | remove \n etc. | 
| column | columnate list | 
| colrm | column remove | 
| expand | expand tab to space | 
| unexpand | space to tab | 
| paste | marge files | 
| join | marge same parts of files | 
| bc | calculator | 
| let | calculate | 
| factor | show factor numbers | 
| expr | evaluate expression | 
| test | ? | 
| shuf | shuffle some value | 
| fold | wrap words in lines | 
| pr | for printer format | 
パッケージ管理
| コマンド | 説明 | 
|---|---|
| apt | advanced packaging tool | 
| dpkg | Debian package manager | 
| dpkg-reconfigure | reconfigure an already installed package | 
| yum | yellodog-linux update manager | 
| rpm | RedHat package manager | 
| rpm2cpio | rpm file to cpio | 
ネットワーク
| コマンド | 説明 | 
|---|---|
| netstat | network status | 
| ss | show sockets | 
| arp | ip neighbors | 
| ipcalc | ip calculator | 
| route | ip routing table manager | 
| ip | internet protocol mnager | 
| ifconfig | interface configure | 
| iwconfig | interface wireless configure | 
| iwlist | show Wi-Fi access-point | 
| wpa_supplicant | protected Wi-Fi cliant | 
| nmtui | NetworkManager text-user interface | 
| nmcli | NetworkManager command-line interface | 
| iptables | packet filtering tool | 
| ufw | uncomplicated firewall manager | 
| firewall-cmd | firewall manager | 
| ping | send ICMP ECHO_REQUEST | 
| traceroute | print the route packets trace to network host | 
| arping | send ARP REQUEST to neighber | 
| ntpq | NTP quary | 
| ntpdate | set the date via NTP | 
| clockdiff | time lag to remote host | 
| ssh | secure shell | 
| ssh-keygen | ssh-key generator | 
| ssh-copy-id | ssh copy id | 
| scp | secure copy | 
| rsync | remote file-copying tool | 
| telnet | ? | 
| ftp | file transfer program | 
| sftp | secure ftp | 
| wget | WWW downloader | 
| curl | Client URL Request Library | 
| tcpdump | dump traffic on a network | 
| tshark | ? | 
| brctl | ? | 
| host | DNS lookup | 
| nslookup | DNS lookup | 
| dig | DNS lookup | 
| whois | show IANA info | 
ネットワークセキュリティ
| コマンド | 説明 | 
|---|---|
| nmap | Network Mapper | 
| netcat / nc | network investigator | 
| gpg | OpenPGP encryption and signing tool | 
| openssl | SSL / TLS tool kit | 
| pwgen | password generator | 
ネットワークツール
| コマンド | 説明 | 
|---|---|
| mail | send and receive mail | 
| mailq | ? | 
| newaliases | mail alias | 
| w3m | WWW monitor | 
| showmount | show NFS server's exports status | 
| rdesktop | remote desktop | 
TIPS
画像を一括して圧縮
# find /var/www/html/wp-content/uploads/ -name *.jpg | xargs -t -I{} convert {} -sampling-factor 4:2:0 -strip -quality 90 -interlace JPEG -colorspace sRGB {}
- root が/etc/に nologinファイルを作成すると全ての一般ユーザがログイン不可になる。ファイルに内容を記載した場合は、それがログイン拒否時に表示される