- reboot
- linux osの再起動
# reboot
shutdown コマンドにオプションを付けることで再起動できます。
# shutdown -r
initコマンドでも再起動できます。
# init 6
# reboot
# shutdown -r
# init 6
[user@localhost tmp]$ w 09:57:16 up 1 day, 13:52, 1 user, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user pts/1 win7 09:22 0.00s 0.04s 0.01s w
$ man grub
$ info grub File: grub.info, Node: Top, Next: Introduction, Up: (dir) GRUB manual *********** This is the documentation of GNU GRUB, the GRand Unified Bootloader, a flexible and powerful boot loader program for PCs. This edition documents version 0.97. * Menu: * Introduction:: Capturing the spirit of GRUB * Naming convention:: Names of your drives in GRUB * Installation:: Installing GRUB on your drive * Booting:: How to boot different operating systems * Configuration:: Writing your own configuration file * Network:: Downloading OS images from a network * Serial terminal:: Using GRUB via a serial line * Preset Menu:: Embedding a configuration file into GRUB * Security:: Improving the security * Images:: GRUB image files --zz-Info: (grub.info.gz)Top, 38 行 --Top-------------------------------------- Info バージョン 4.8 にようこそ。? で使い方、m でメニュー鬆
top - 17:28:40 up 15:54, 1 user, load average: 0.00, 0.00, 0.00 Tasks: 115 total, 2 running, 113 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 1034708k total, 615628k used, 419080k free, 81856k buffers Swap: 2097144k total, 0k used, 2097144k free, 410856k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 15 0 2160 644 556 S 0.0 0.1 0:00.93 init 2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0 3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0 4 root 10 -5 0 0 0 S 0.0 0.0 0:00.04 events/0 (以下省略)
Help for Interactive Commands - procps version 3.2.7 Window 1:Def: Cumulative mode Off. System: Delay 3.0 secs; Secure mode Off. Z,B Global: 'Z' change color mappings; 'B' disable/enable bold l,t,m Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info 1,I Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode f,o . Fields/Columns: 'f' add or remove; 'o' change display order F or O . Select sort field <,> . Move sort field: '<' next col left; '>' next col right R,H . Toggle: 'R' normal/reverse sort; 'H' show threads c,i,S . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time x,y . Toggle highlights: 'x' sort field; 'y' running tasks z,b . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y') u . Show specific user only n or # . Set maximum tasks displayed k,r Manipulate tasks: 'k' kill; 'r' renice d or s Set update interval W Write configuration file q Quit ( commands shown with '.' require a visible task display window ) Press 'h' or '?' for help with Windows, any other key to continue
[user@localhost tmp]$ tac tmp.txt zxcv qwer ghijkl abcdef 123456
[root@localhost ~]# uname -r 2.6.18-238.19.1.el5
[user@centos12 ~]$ uname -r 2.6.32-71.29.1.el6.i686
[user@localhost ~]$ cat /etc/redhat-release CentOS release 5.5 (Final)
$ apropos directory Cwd (3pm) - get pathname of current working directory DirHandle (3pm) - supply object methods for directory handles FcConfigAppFontAddDir (3) - Add fonts from directory to font database FcConfigNormalizeFontDir (3) - normalize a font directory FcDirCacheValid (3) - check directory cache timestamp FcDirSave (3) - save a directory cache FcDirScan (3) - scan a font directory FcStrDirname (3) - directory part of filename File::Basename (3pm) - Parse file paths into directory, filename and suffix (以下省略)
[user@centos55 tmp]$ apropos 'ディレクトリ' acleandir (1) - netatalk の Apple Macintosh ファイルが含まれているディレクトリを掃除する。 alphasort [scandir] (3) - ディレクトリを走査する basename (1) - ファイル名からディレクトリと拡張子を取り去る chacl (1) - ファイルまたはディレクトリのアクセス制御リスト (Access Control List) を変更する chdir (2) - 作業ディレクトリの変更 chroot (1) - ルートディレクトリを変更してコマンドを実行する。 chroot (2) - ルート・ディレクトリを変更する closedir (3) - ディレクトリをクローズする copydir [mirrordir] (1) - 変更された最小の部分のみを用いて (ローカル、FTP 経由、安全な tcp 接続経由で) ディレクトリツリーをコピーまたはミラーする cp (1) - ファイルやディレクトリをコピーする (以下省略)
$ diff file1.txt file2.txt
$ diff dir1 dir2 dir1だけに発見: dir11 dir2だけに発見: file1 dir2だけに発見: file2
[root@localhost ~]# fuser /home/user/tmp /home/user/tmp: 7465c 7492c
[root@localhost ~]# ps -ef | grep 7465 user 7465 6873 0 16:58 pts/1 00:00:00 bash user 7492 7465 0 16:58 pts/1 00:00:00 vim tmp.txt root 7991 7770 0 17:10 pts/2 00:00:00 grep 7465
$ who user pts/1 2011-08-10 15:30 (192.168.226.1)
$ cat tmp.txt 123 abc def ghi abcdefg $ wc tmp.txt 4 5 25 tmp.txt
[root@localhost ~]# cat /etc/syslog.conf # Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console # Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none /var/log/messages (以下省略)
[root@localhost ~]# ls -l /var/log/messages -rw------- 1 root root 187507 8月 5 08:42 /var/log/messages [root@localhost ~]# wc /var/log/messages 2376 25204 187507 /var/log/messages [root@localhost ~]# tail -5 /var/log/messages Aug 5 08:29:37 localhost ntpd[3871]: synchronized to LOCAL(0), stratum 10 Aug 5 08:31:11 localhost ntpd[3871]: synchronized to 219.117.196.238, stratum 2 Aug 5 08:42:52 localhost dhclient: DHCPREQUEST on eth0 to 192.168.226.254 port 67 Aug 5 08:42:52 localhost dhclient: DHCPACK from 192.168.226.254 Aug 5 08:42:52 localhost dhclient: bound to 192.168.226.132 -- renewal in 816 seconds.
[root@localhost ~]# dmesg Linux version 2.6.18-238.19.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Fri Jul 15 07:32:29 EDT 2011 BIOS-provided physical RAM map: BIOS-e820: 0000000000010000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000ca000 - 00000000000cc000 (reserved) (以下省略)
$ passwd Changing password for user user. Changing password for user (current) UNIX password: # 現在のパスワード New UNIX password: # 新しいパスワード Retype new UNIX password: # 確認のため新しいパスワードを再入力 passwd: all authentication tokens updated successfully. $
# passwd user1
# cat /etc/syslog.conf (途中省略) # The authpriv file has restricted access. authpriv.* /var/log/secure (このあとも省略)
# cat /var/log/secure (途中省略) Aug 5 14:10:44 localhost su: pam_unix(su-l:session): session opened for user root by user(uid=500) Aug 5 14:11:05 localhost su: pam_unix(su-l:session): session closed for user root (このあとも省略)
[user@localhost tmp]$ cat tmp.txt 123456 abcdef ghijkl qwer zxcv [user@localhost tmp]$ vi tmp.txt 123456 abcdef # この行にカーソルを置き、削除「dd」 ghijkl qwer zxcv # vi 削除(ヤンク)後 123456 ghijkl # カーソルがこの行に移ります、「p」でペースト qwer zxcv # vi ペースト後 123456 ghijkl abcdef # ヤンクバッファの内容がペーストされました。 qwer zxcv
[user@localhost tmp]$ vi tmp.txt [user@localhost tmp]$ cat tmp.txt 123
[user@localhost tmp]$ vi tmp.txt [user@localhost tmp]$ cat !!^ cat tmp.txt # 最初にファイル名の置換機能が働いて展開されたものが表示されます 123
[user@localhost tmp]$ ls -la tmp.txt -rw-rw-r-- 1 user user 10 8月 21 23:25 2011 tmp.txt [user@localhost tmp]$ vi !$
[user@localhost tmp]$ vi tmp.txt [user@localhost tmp]$ vi tmp.txt
[user@localhost tmp]$ vi tmp.txt [user@localhost tmp]$ !! # 直前のコマンドを実行