/etc/shells
emacs test.user
hogeuser1:hogepass1:1101:1101:hogeu1:/home/hogeuser:/bin/bash hogeuser2:hogepass2:1102:1102:hogeu2:/home/hogeuser:/bin/bash2
newusers test.user
emacs test.pass
hoge1:hogepass hoge2:hogepass2
chpasswd < test.pass
printf "hogepass1\n"|passwd --stdin hoge1 printf "hogepass2\n"|passwd --stdin hoge2
ps auxw -H
su - hoge
yes | hoge
yes no | hoge
FreeBSD
http://www.jp.freebsd.org/man-jp/search.html
ls | xargs rm
ls *.* |xargs -i cp -a {} /hogepath
df -i
/etc/rc.d/init.d/network restart
ifdown eth0 ifup eth0
search hoge.domain nameserver 192.168.1.1
DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes TYPE=Ethernet
DEVICE=eth0 BOOTPROTO=static BROADCAST=192.168.1.255 IPADDR=192.168.1.2 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes TYPE=Ethernet
ifconfig eth0:0 192.168.100.190 netmask 255.255.255.0 broadcat 192.168.100.255
route add -host 192.168.1.1 dev eth0:0
ssh -i .ssh/ninsyou hogeuser@192.168.1.1
/lib/libc.so.6
http://www.gnu.org/software/wget/wget.html
./configure make make install
service --status-all
http://www.7key.jp/computer/top.html
http://www.math.kobe-u.ac.jp/~kodama/tips-free-memory.html
/etc/rc.d/init.d/network restart
hostname xxx.ffff.yyy
grep kensakusitaimoji hoge.txt
# System initialization. si::sysinit:/etc/rc.d/rc.sysinit
id:3:initdefault:
l3:3:wait:/etc/rc.d/rc 3
/etc/profile ~/.bash_profile ~/.bash_login ~/.profile
http://itpro.nikkeibp.co.jp/article/COLUMN/20070403/267311/
uname -a
# chkconfig: 345 80 15
chkconfig --level 345 httpd on
/sbin/service --status-all
hoge &
jobs
fg
#rpm -ivh hoge.rpm
#rpm -ivh hoge.rpm
#rpm -q hoge
#rpm -qi hoge
#rpm -qs hoge
#rpm -qa
#rpm -qf /root/.Xdefaults
#rpm --help
#rpm --version
#rpm -i hoge.rpm
#rpm -U hoge.rpm
#rpm -F hoge.rpm
#rpm -e mozilla
# tar -cvf access_log01.tar /usr/local/apache/logs/access_log.*
# tar -xvf /var/log/ /usr/local/apache/logs/access_log01.tar
# compress access_log01.tar
# uncompress access_log01.tar.Z
# gzip access_log01.tar
# gunzip access_log.tar.gz
# tar -zxvf access_log01.tar.gz
# tar -zxvfC access_log01.tar.gz /tmp
# zcat access_log01.tar.Z | tar xvf -
unzip hoge.zip
zip hoge.zip hogefile
zip -r hoge.zip hogedir
zip -P password -e test.zip *.*
# Option "XkbOptions" "ctrl:swapcaps"
boot: linux rescue
boot: linux single boot: linux emergency
http://www.redhat.co.jp/manual/Doc80/RH-DOCS/rhl-cg-ja-8.0/s1-rescuemode-booting-single.html
boot -s
http://ftp.gnu.org/gnu/parted/
./configure make; make install
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/461useparted.html
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/462partedsfd.html
http://nobumasa-web.hp.infoseek.co.jp/partition/parted/
rsync
rsync -avz --delete /home/test/ filesrv:/home/backup/
wget http://downloads.sourceforge.net/dar/dar-2.3.2.tar.gz?modtime=1162240068&big_mirror=0 tar xzvf dar-2.3.2.tar.gz cd dar-2.3.2 ./configure make
/lib/libattr.a: No such file or directory
http://dar.linux.free.fr/doc/FAQ.html
ln -s /usr/lib/libattr.a /lib/libattr.a
make install-strip
Commands are: -c creates an archive -x extracts files from the archive -d compares the archive with the existing filesystem -t tests the archive integrity -l lists the contents of the archive -C isolates the catalogue from an archive -+ merge two archives / create a sub archive
dar -c /backup/homeall -g home
Parse error on command line (or included files): Cannot add an absolute path
homeall.1.dar
dar -c /backup/homeall-1 -g home -A /backup/homeall
homeall-1.1.dar
dar -x /backup/homeall
dar -x /backup/homeall -g home/hoge.txt
cp -ar /var/lib/mysql/*** /home/backup cp -ar /home/httpd/html /home/backup
dump
find /backup -mtime +1 -maxdepth 1 -name '*.zip' -exec rm -f {} \; /sbin/dump -0f - /dev/hda1 2>> /backup/backup.log | gzip > /backup/hda1_`date +%m%d`.zip dump -0f /backup/backup /dev/hda1 zcat /backup/hda7_0307.zip | restore -tf - z
passwd group shadow
http://www-6.ibm.com/jp/developerworks/linux/040213/j_l-roadmap8.html
http://vision.featia.net/linux/rsync.jsp
http://www.double-h.com/linux/tipsmemo/others/general01.html
http://www.mediaweb.biz/database/cobalt_tips/cobalt_rsync.html
http://ito-web.dip.jp/server_conf/mondo_rescue.html
find . -type d
cp -a /hoge /backup/hoge`date +%w`
http://www.a-yu.com/opt/fdisk.html
http://www.deer-n-horse.jp/linux/tips/extension_hdd.html
01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly
0-59/5 * * * * /test
0,10,20,30,40,50 * * * *
* 5 * * *
run-parts /etc/cron.hourly
http://www.express.nec.co.jp/linux/distributions/knowledge/system/crond.html
LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2
fs_mntops
fs_freq
fs_passno
du -s dir
df -k
df -hT
mkdir -p hoge/hoge/hoge
free -s 1 -c 300
total used free shared buffers cached Mem: 1018348 1002200 16148 0 91376 709944 -/+ buffers/cache: 200880 817468 Swap: 2031608 160 2031448
watch -n 1 -d free
vmstat 1 300
http://itpro.nikkeibp.co.jp/article/COLUMN/20060228/230989/
bdc --all --arc --delete --log=/var/log/bitdefendef.log /home
wget http://www01.tcp-ip.or.jp/~furukawa/nkf_utf8/nkf204.tar.gz tar xzvf nkf204.tar.gz cd nkf204 make make test mv nkf /usr/bin/
find . -name '*.*' | xargs nkf -e -Lu --overwrite
mount -t tmpfs -o size=10m tmpfs /dev/shm mount -t tmpfs -o size=10m /dev/shm /hoge
ldconfig -p | grep hoge.so
/etc/sysconfig/i18n
LANG="ja_JP.UTF-8"
LANG="ja_JP.eucJP"
wget http://download.insecure.org/nmap/dist/nmap-4.20.tgz tar xzvf nmap-4.20.tgz cd nmap-4.20 ./configure make make install
netstat -lutp lsof -i:80,81
http://x68000.q-e-d.net/~68user/unix/pickup?netstat http://www.linux.or.jp/JM/html/net-tools/man8/netstat.8.html
netstat -ape
auth required pam_nologin.so
device (hd0) /dev/hdb root (hd0,0) install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.conf quit
device (hd0) /dev/sdb root (hd0,0) install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.conf quit
more /proc/mdstat
Personalities : [raid1] md0 : active raid1 hdb1[1] hda1[0] 104320 blocks [2/2] [UU]
Personalities : [raid0] [raid1] md0 : active raid0 hdb2[1] hda2[0] 131539968 blocks 256k chunks
mdadm --query /dev/md3 /dev/md3: 48.83GiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail. /dev/md3: No md super block found, not an md component.
mdadm --detail /dev/md3 Version : 00.90.01 Creation Time : Tue Jul 5 01:43:51 2005 Raid Level : raid1 Array Size : 40957568 (39.06 GiB 41.94 GB) Device Size : 40957568 (39.06 GiB 41.94 GB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 2 Persistence : Superblock is persistent Update Time : Wed Jul 25 11:53:11 2007 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 UUID : 804f4246:8ee45dfb:61f65e69:124a6043 Events : 0.163354 Number Major Minor RaidDevice State 0 0 0 - removed 1 3 69 1 active sync /dev/hdb5
fdisk -l /dev/hda
fdisk /dev/hdb
fdisk -l /dev/hdb
mdadm --manage /dev/md0 --add /dev/hdb1 mdadm --manage /dev/md1 --add /dev/hdb2
more /proc/mdstat
http://www.obenri.com/_raid_build/pre_install_raid.html
http://mizushima.ne.jp/Linux/CentOS/CentOS-install2-RAID.php
http://www.combu.org/gensui/machine/linux/raid.shtml
http://www.miraclelinux.com/faq/data/00080.html
http://justlikeakame.com/pc/softwareraid.html
http://www.linux.or.jp/JF/JFdocs/The-Software-RAID-HOWTO.html
http://www.atmarkit.co.jp/fpc/experiments/011raid4oldpc/raid4oldpc_04.html
mount.cifs //192.168.1.10/test /mnt/test -o username=hoge,passwrd=hogepass
mount -t smbfs -O username=hoge,password=hogepass //192.168.1.10/test /mnt/test
cat /proc/filesystems
nfs
mount -t nfs 192.168.1.2:/ /mnt/hoge
http://www.linux.or.jp/JM/html/util-linux/man8/mount.8.html
hdparm /dev/hda /dev/hda: multcount = 16 (on) IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 1 (on) keepsettings = 0 (off) readonly = 0 (off) readahead = 256 (on) geometry = 19929/255/63, sectors = 163928604672, start = 0
hdparm -Tt /dev/hda
Timing cached reads: 2200 MB in 2.00 seconds = 1099.07 MB/sec Timing buffered disk reads: 164 MB in 3.00 seconds = 54.64 MB/sec
hdparm -c3 /dev/hda
http://www.linux.or.jp/JM/html/hdparm/man8/hdparm.8.html
nohup hoge &
ldd
otool -L
http://perso.wanadoo.fr/sebastien.godard/
wget ftp://ibiblio.org/pub/linux/system/status/sysstat-6.0.1.tar.gz tar xzvf sysstat-6.0.1.tar.gz cd sysstat-6.0.1 make config
make make install
iostat
http://www.atmarkit.co.jp/flinux/rensai/root07/root07b.html
smartctl -t short /dev/hda
smartctl -l selftest /dev/hda
smartctl -a /dev/hda
194 Temperature_Celsius 0x0032 042 253 000 Old_age Always - 44
http://ja.wikipedia.org/wiki/Self-Monitoring,_Analysis_and_Reporting_Technology
Device: /dev/hda, 1 Currently unreadable (pending) sectors
SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed: read failure 60% 17878 234152622
fdisk -lu /dev/hda Disk /dev/hda: 163.9 GB, 163928604672 bytes 255 heads, 63 sectors/track, 19929 cylinders, total 320173056 sectors
Ctrl+r
(reverse-i-search)`':
stty -a
stop = ^S;
stty stop ^x
(i-search)`':
cat /proc/cpuinfo
http://www-06.ibm.com/jp/developerworks/linux/030314/j_l-htl.html
http://www-06.ibm.com/jp/developerworks/linux/040227/j_l-web26.html
echo 30 > /proc/sys/kernel/panic