350行目: 350行目:
==ユーザツール==
==ユーザツール==


* id --- show user's id
{| class="wikitable" summary="ユーザツール"
* whoami --- who am i ?
|-
* [[date]] --- show date
!コマンド
* cal --- show calendar
!説明
* [[set]] --- show shell environment
|-
* env --- show user's enviroment
|<code>id</code>
* printenv --- show environment
|show user's id
* export --- export environment from shell's env to user's env
|-
* [[history]] --- show command history
|<code>whoami</code>
* alias / unalias --- make alias
|who am i ?
* fc --- ?
|-
* su --- switch user
|<code>[[date]]</code>
* sudo --- switch user do
|show date
* sg --- switch group
|-
* chroot --- run command with special root directory
|<code>cal</code>
* nice --- set program priority
|show calendar
* renice --- alter program priority
|-
* crontab --- manage cron
|<code>[[set]]</code>
* expect --- expect response
|show shell environment
* at --- ?
|-
* script --- ?
|<code>env</code>
* stdbuf --- modify buffering
|show user's enviroment
* time --- show round trip time
|-
* watch --- run program periodically
|<code>printenv</code>
* sleep --- set a moment before run
|show environment
* exit --- exit terminal
|-
* make --- compile file
|<code>export</code>
* [[install]] --- copy files
|export environment from shell's env to user's env
* yes --- always say "yes"
|-
* which --- command path
|<code>[[history]]</code>
* xargs --- x-arguments
|show command history
* git --- git
|-
* cvs --- cvs
|<code>alias / unalias</code>
* svn --- svn
|make alias
* mysql --- mysql client / server
|-
* mysqldump --- mysql dump databases
|<code>fc</code>
* xl --- ?
|?
* VBoxManage --- ?
|-
* lpadmin --- configure cups printers
|<code>su</code>
* lpstat --- show cups printing status
|switch user
* lp --- submit files for printing
|-
* lpr --- subimt files for printing
|<code>sudo</code>
* cancel --- cancel printing job
|switch user do
|-
|<code>sg</code>
|switch group
|-
|<code>chroot</code>
|run command with special root directory
|-
|<code>nice</code>
|set program priority
|-
|<code>renice</code>
|alter program priority
|-
|<code>crontab</code>
|manage cron
|-
|<code>expect</code>
|expect response
|-
|<code>at</code>
|?
|-
|<code>script</code>
|?
|-
|<code>stdbuf</code>
|modify buffering
|-
|<code>time</code>
|show round trip time
|-
|<code>watch</code>
|run program periodically
|-
|<code>sleep</code>
|set a moment before run
|-
|<code>exit</code>
|exit terminal
|-
|<code>make</code>
|compile file
|-
|<code>[[install]]</code>
|copy files
|-
|<code>yes</code>
|always say "yes"
|-
|<code>which</code>
|command path
|-
|<code>xargs</code>
|x-arguments
|-
|<code>git</code>
|git
|-
|<code>cvs</code>
|cvs
|-
|<code>svn</code>
|svn
|-
|<code>mysql</code>
|mysql client / server
|-
|<code>mysqldump</code>
|mysql dump databases
|-
|<code>xl</code>
|?
|-
|<code>VBoxManage</code>
|?
|-
|<code>lpadmin</code>
|configure cups printers
|-
|<code>lpstat</code>
|show cups printing status
|-
|<code>lp</code>
|submit files for printing
|-
|<code>lpr</code>
|subimt files for printing
|-
|<code>cancel</code>
|cancel printing job
|-
|}


==ファイル / ディレクトリ操作==
==ファイル / ディレクトリ操作==

2019年2月10日 (日) 13:53時点における版

略語の意味を示すために説明は英語表記。ちなみに、これら全ては1つ1つがアプリだった。Unix哲学の象徴。

デバイス管理

コマンド 説明
lscpu list CPU info
lspci list PCI devices
lsusb lsit USB devices
lsscsi list SCSI devices
lsblk list block / storage devices
hwclock set hardware clock
hdparm show HDD/SATA/IDE parameters
sdparm access SCSI mode page
loadkeys loadkeybords
setterm terminal settings
screen terminal screen manager
tmux ?
chvt change vertual terminal
fdisk fixed disk, manipulate partitions
parted partition edit
partx show partitions
mkswap make swap area
swapon swap area on
swapoff swap area off
wodim write to CD/DVD
growisofs write iso image to DVD

カーネル管理

コマンド 説明
mkinitramfs initramfs image generator ( Debian )
dracut initramfs image generator ( RH )
dmsg display Kernel message ring
lsmod list Linux Kernel modules
insmod insert a Kernel module
rmmod remove a Kernel module
depmod generate modules.dep
modprobe add and remove modules from Kernel
modinfo show information about a Kernel modules

システム管理

コマンド 説明
hostname hostname
hostnamectl mamage hostname ( hostnamectl status )
uname show system information
arch show system hardware name ( = uname -m)
top show top processes
df disk free on filesystem
du disk used
free free memory
vmstat memory status
init system mamager
initctl ?
systemctl system mamager
chkconfig old way of systemctl
runlevel show runlevel
update-rc.d set System-V initial links
sysctl configure Kernel parameters
ldd list dynamic dependencies
ldconfig ldd configure
logger enter message to system log
journalctl system log manager
halt halt, power off, reboot machine
shutdown shutdown machine
busybox command tool box

プロセス管理

コマンド 説明
pwdx pwd for process
ps show processes
pstree show processes tree
pgrep process grep
pkill process kill
pidof process id open file
lsof list files opened by processes
fuser identify file opening process
kill kill process
nohup run command without hup
jobs show working jobs
bg doing job at background
fg doing job at forgraound

ファイルシステム管理

コマンド 説明
mkfs make file system
fsck file system check
mount mount file system
umount unmount file system
mknod create a special file

ユーザ管理

コマンド 説明
last show recent log-in users
lastlog show last users login
w / who show logged-in users
users show logged-in users
useradd add a user ( useradd -m -s /bin/bash -G sudo hoge )
userdel delete a user ( userdel -r hoge )
usermod modify a user
groups show user's groups
groupadd add a group
groupdel delete a group
groupmod modify a group
chage change / show user's age
chsh change login shell
finger user's fingerprint
chfn change user's fingerprint
passwd change user's password
gpasswd manage group password
chpasswd change password in batch mode
pwck check password file
grpck check group file
vipw / vigr edit password / group file
pwconv convert password file
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
cal show calendar
set show shell environment
env show user's enviroment
printenv show environment
export export environment from shell's env to user's env
history show command history
alias / unalias make alias
fc ?
su switch user
sudo switch user do
sg switch group
chroot run command with special root directory
nice set program priority
renice alter program priority
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"
which command path
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
  • find --- find files
  • locate --- location of files
  • ls --- list
  • file --- type of file
  • stat --- status of file
  • lsattr --- file system attribution
  • chattr --- change file system attribution
  • chmod --- change mode
  • chown --- change owner of file
  • chgrp --- change owner group
  • cd --- change directory
  • mkdir --- make a directory
  • rmdir --- remove direcotory
  • touch --- touch a file
  • cp --- copy
  • mv --- move, change
  • rm --- remove
  • shred --- shred files
  • ln --- make a link
  • readlink --- show symbolic link
  • basename --- base name of file
  • dirname --- name of directory
  • tmpwatch --- ?
  • umask --- user mask
  • split --- split a file
  • truncate --- shrink or expand file
  • tar --- type archive
  • gzip / gunzip --- zip / unzip
  • cpio --- extract rpm files
  • mktemp --- make temporary file
  • convmv --- convert move
  • dd --- dump datas
  • pv --- pipe viewer
  • base64 --- base64 encode / decode
  • od --- octal dump
  • 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
  • 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
  • tr --- translate
  • ex --- ex mode of vi
  • ed --- line editor
  • 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
  • yum --- yellodog-linux update manager
  • rpm --- RedHat package manager
  • rpm2cpio --- rpm file to cpio

ネットワーク

  • ss --- show sockets
  • netstat --- network status
  • arp --- ip neighbors
  • ipcalc --- ip calculator
  • ip --- internet protocol mnager
  • route --- ip routing table manager
  • 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
  • tracepath --- show a path to the 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 --- GNU Privacy Gard
  • 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 {}