|
|
目次
よく使うLinuxコマンドパッケージ管理関連パッケージ インストール/アップデート/アンインストール [yum]インストール済パッケージの一覧表示# yum list installed 読み込んだプラグイン:fastestmirror, refresh-packagekit Loading mirror speeds from cached hostfile * fedora: ftp.iij.ad.jp * livna: rpm.livna.org * rpmfusion-free: mirror.yandex.ru * rpmfusion-free-updates: mirror.yandex.ru * rpmfusion-nonfree: mirror.yandex.ru * rpmfusion-nonfree-updates: mirror.yandex.ru * updates: ftp.iij.ad.jp インストール済みパッケージ 389-admin.x86_64 1.1.8-4.fc11 @updates 389-admin-console.noarch 1.1.4-1.fc11 @updates 389-admin-console-doc.noarch 1.1.4-1.fc11 @updates ~省略~ インストール# yum install package_name アップデート# yum update package_name アンインストール# yum remove package_name 一時的にリポジトリを有効化# yum --enablerepo=remi install package_name パッケージ インストール/アップデート/アンインストール [rpm]インストール済パッケージの一覧表示$ rpm -qa grep との組み合わせ $ rpm -qa | grep kernel kernel-headers-2.6.19-1.2911.fc6 kernel-2.6.19-1.2911.fc6 kernel-devel-2.6.19-1.2911.fc6 インストール$ rpm -ivh filename.rpm vhオプションは処理状況を表示する。 アップデート$ rpm -Uvh filename.rpm アンインストール$rpm -e filename.rpm パッケージに含まれるファイルの一覧表示$ rpm -ql phpMyAdmin /etc/httpd/conf.d/phpMyAdmin.conf /etc/phpMyAdmin /etc/phpMyAdmin/config.inc.php /usr/share/doc/phpMyAdmin-2.11.11.1 /usr/share/doc/phpMyAdmin-2.11.11.1/CREDITS /usr/share/doc/phpMyAdmin-2.11.11.1/Documentation.txt 〜省略〜 パッケージの詳細情報を表示$ rpm -qi python Name : python Relocations: (not relocatable) Version : 2.4.3 Vendor: CentOS Release : 27.el5_5.3 Build Date: 2010年11月12日 03時36分24秒 Install Date: 2010年12月17日 17時52分09秒 Build Host: builder10.centos.org Group : Development/Languages Source RPM: python-2.4.3-27.el5_5.3.src.rpm Size : 22130370 License: PSF - see LICENSE Signature : DSA/SHA1, 2010年11月12日 09時22分06秒, Key ID a8a447dce8562897 URL : http://www.python.org/ Summary : 対話式、オブジェクト指向のインタープリタ言語 Description : Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme or Java. Python includes modules, classes, exceptions, very high level dynamic data types and dynamic typing. Python supports interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac and MFC). Programmers can write new built-in modules for Python in C or C++. Python can be used as an extension language for applications that need a programmable interface. This package contains most of the standard Python modules, as well as modules for interfacing to the Tix widget set for Tk and RPM. Note that documentation for Python is provided in the python-docs package. 強制インストール
$rpm -ivh --force --nodeps {ファイル名}:強制インストール(新規インストール & 依存関係無視)
ログイン関連一時的にユーザを切り替える[su -]
suコマンドはユーザを切り替えて新たなシェルを起動する。 su [-flmp] [-c command] [-s shell] [-] [--help] [--version] [user [arg...]]
実行例: $ su - <- userが未指定なのでrootになる。 パスワード: ********** <- パスワードは表示されない。 # exit <- 終了するには exit または logout を入力する。 logout 圧縮ファイルの圧縮/解凍[tar]tar.gz(圧縮)$ tar zcvf filename.tar.gz targetdir/ tar.gz(解凍)$ tar zxvf filename.tar.gz tar.bz2(圧縮)$ tar jcvf filename.tar.bz2 targetdir/ tar.bz2(解凍)$ tar jxvf filename.tar.bz2 ファイル&ディレクトリ関連ディレクトリの作成[mkdir]書式: $ mkdir [-pv] [-m mode] [--help] [--version] [--] directory...
実行例: $ mkdir tmp $ mkdir -m 755 cgi-bin $ mkdir -pv usr/bin mkdir: created directory `usr' mkdir: created directory `usr/bin' ファイルの削除[rm]$ rm fileName.ext rm: remove 通常ファイル 'fileName.ext'? y[Enter] ファイルの削除(確認なし) [rm -f]$ rm -f fileName.ext ディレクトリをサブディレクトリを含めて削除[rm -r]$ rm -r directoryName rm: descend into directory 'directoryName'? y[Enter] rm: descend into directory 'directoryName/subDirectory'? y[Enter] ... ディレクトリをサブディレクトリを含めて削除(確認なし)[rm -rf]$ rm -rf directoryName 前方/後方移動が可能なファイル表示[less]
lessコマンドはmoreコマンドに似ているが、とても高機能なページャである。
less -?
less --help
less -V
less --version
less [-[+]aBcCdeEfgGiImMnNqQrsSuUVWwXZ]
[-b bufs] [-h lines] [-j line] [-k keyfile]
[-K character set] [-{oO} logfile]
[-p pattern] [-P prompt] [-t tag]
[-T tagsfile] [-x tab] [-y lines] [-[z] lines]
[+[+]cmd] [--] [filename]...
オプションの詳細は、man lessを参照。 $ less filename.txt <- ファイルの内容が表示されて、↑↓キーで前方/後方移動ができる。 〜省略〜 (END) q <- 表示を終了するにはqキーを入力する。 $ ls -al | less <- コマンドの出力結果を、↑↓キーで移動表示ができる。 〜省略〜 (END) q <- 表示を終了するにはqキーを入力する。 $ less /usr <- ls -al | less と同じ。 合計 408 drwxr-xr-x 16 root root 4096 2008-12-08 14:47 ./ drwxr-xr-x 25 root root 4096 2009-01-22 21:10 ../ drwxr-xr-x 2 root root 4096 2007-06-08 17:07 X11R6/ drwxr-xr-x 2 root root 94208 2009-01-19 21:53 bin/ 〜省略〜 /usr (END) q <- 表示を終了するにはqキーを入力する。 メールメールを読む
# mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 13 messages
> 1 Cron Daemon Tue Jun 23 12:10 27/1028 "Cron <root@monster> run-part"
2 logwatch@monster Tue Jun 23 13:27 44/1622 "Logwatch for monster (Linux)"
3 logwatch@monster Thu Jun 25 11:04 59/1953 "Logwatch for monster (Linux)"
4 logwatch@monster Thu Jun 25 12:37 59/1953 "Logwatch for monster (Linux)"
5 Mail Delivery Su Fri Jun 26 00:52 77/2443 "Returned mail: see transcrip"
6 logwatch@monster Fri Jun 26 03:10 148/4540 "Logwatch for monster (Linux)"
7 logwatch@monster Sat Jun 27 11:06 115/3263 "Logwatch for monster (Linux)"
8 logwatch@monster Sun Jun 28 03:45 142/4391 "Logwatch for monster (Linux)"
9 logwatch@monster Tue Jul 7 03:17 88/2575 "Logwatch for monster (Linux)"
10 logwatch@monster Wed Jul 8 03:13 105/3058 "Logwatch for monster (Linux)"
11 logwatch@monster Thu Jul 9 03:26 97/2783 "Logwatch for monster (Linux)"
12 logwatch@monster Fri Jul 10 03:13 78/2304 "Logwatch for monster (Linux)"
13 logwatch@monster Sat Jul 11 06:49 102/2945 "Logwatch for monster (Linux)"
& t <- メッセージの表示は t コマンドを入力
Message 1:
From root@monster.fireball.local Tue Jun 23 12:10:53 2009
Return-Path: <root@monster.fireball.local>
Date: Tue, 23 Jun 2009 01:01:36 +0900
From: root@monster.fireball.local (Cron Daemon)
To: root@monster.fireball.local
Subject: Cron <root@monster> run-parts /etc/cron.hourly
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Status: RO
/etc/cron.hourly/0anacron:
cat: /var/spool/anacron/cron.daily: No such file or directory
& q <- mailコマンドを終了するには q コマンドを入力
参考文献特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Noncommercial-Share Alike 3.0 Unported
|
|
Copyright © 2007-2011 tomoyan.net 本ページのすべての商標と著作権はそれぞれの所有者に帰属します。 |
Powered by Geeklog ページ作成時間 0.14 秒 |