Linux コマンドリファレンス
ファイル管理、テキスト処理、プロセス、ネットワークなど必須の Linux/Unix コマンドをすばやく検索できます。
ファイル & ディレクトリ
ls -laList files with details and hidden filescd <dir>Change directorypwdPrint working directorymkdir -p <dir>Create directory (and parents)rm -rf <dir>Remove directory recursively (careful!)cp -r <src> <dest>Copy files/directories recursivelymv <src> <dest>Move or rename file/directorytouch <file>Create empty file or update timestampfind . -name "*.txt"Find files by name patternfind . -type f -size +10MFind files larger than 10MBdu -sh *Show disk usage of each itemdf -hShow disk space usageテキスト処理
cat <file>Print file contentsless <file>Page through file (q to quit)head -n 20 <file>Show first 20 linestail -n 20 <file>Show last 20 linestail -f <file>Follow file (live log viewing)grep -r "pattern" .Search for pattern recursivelygrep -i "pattern" <file>Case-insensitive searchgrep -n "pattern" <file>Show line numbers in resultssed -i "s/old/new/g" <file>Replace text in file in-placeawk '{print $1}' <file>Print first columnsort <file>Sort lines alphabeticallysort -n -k2 <file>Sort numerically by 2nd columnuniq -cCount and deduplicate adjacent lineswc -l <file>Count lines in filecut -d"," -f1,3 <file>Cut specific columns (CSV)プロセス
ps auxList all running processestopInteractive process viewerhtopEnhanced process viewer (if installed)kill <pid>Terminate process by PIDkill -9 <pid>Force kill processpkill <name>Kill processes by namepgrep <name>Find PIDs by process namenohup <cmd> &Run command immune to hangups, in backgroundjobsList background jobsbg %1Resume job 1 in backgroundfg %1Bring job 1 to foregroundパーミッション & 所有権
chmod 755 <file>Set rwxr-xr-x permissionschmod +x <file>Make file executablechown user:group <file>Change file owner and groupsudo <cmd>Run command as superusersudo -iSwitch to root shellsu - <user>Switch to another userumask 022Set default permission maskネットワーク
curl -I <url>Show response headers onlycurl -L -o file <url>Download file following redirectswget <url>Download fileping <host>Test network connectivitytraceroute <host>Trace network path to hostnslookup <domain>DNS lookupdig <domain>Detailed DNS lookupnetstat -tulnShow listening portsss -tulnShow listening ports (modern)ssh user@hostConnect via SSHscp <file> user@host:/pathCopy file via SSHrsync -avz src/ user@host:dest/Sync files efficientlyアーカイブ & 圧縮
tar -czf archive.tar.gz <dir>Create gzip compressed archivetar -xzf archive.tar.gzExtract gzip archivetar -cjf archive.tar.bz2 <dir>Create bzip2 compressed archivezip -r archive.zip <dir>Create zip archiveunzip archive.zipExtract zip archivegzip <file>Compress file with gzipgunzip <file>.gzDecompress gzip fileシステム情報
uname -aSystem and kernel informationcat /etc/os-releaseOS version informationfree -hMemory usageuptimeSystem uptime and loadwhoWho is logged inidCurrent user and group IDsenvShow environment variablesexport VAR=valueSet environment variablewhich <cmd>Find command pathhistoryCommand historyman <cmd>Manual page for a commandこのツールについて
Linux コマンドリファレンスは、ファイル・ディレクトリ管理、テキスト処理、プロセス制御、パーミッション・所有権、ネットワーク、アーカイブ・圧縮、システム情報の7カテゴリに整理された必須 Linux/Unix コマンド集です。
各コマンドには実際の使用例と簡潔な説明が付いています。検索ボックスを使って、コマンド名や説明のキーワードで素早くフィルタリングできます。
使い方
- 検索ボックスにコマンド名またはキーワードを入力します。
- カテゴリをスクロールしてコマンドを参照します。
- コマンドと説明を確認し、ターミナルで使用します。
- 山括弧(<>)で囲まれたプレースホルダーを実際の値に置き換えてください。
活用事例
デプロイスクリプトを書く DevOps エンジニア、サーバー問題をデバッグするシステム管理者、ファイルパーミッションやプロセスを確認する開発者、Linux コマンドラインの基礎を学ぶ初学者に役立ちます。
よくある質問
- 山括弧(<>)の意味は何ですか? 山括弧はプレースホルダーです。<dir> は実際のディレクトリパスに、<file> はファイル名に、<pid> はプロセス ID に置き換えて使用してください。
- コマンドが見つからない場合はどうすればよいですか? htop などの一部のコマンドはデフォルトでインストールされていない場合があります。パッケージマネージャー(例: sudo apt install htop)でインストールするか、man コマンドで確認してください。
- sudo を使うときの注意点は何ですか? sudo はスーパーユーザー権限でコマンドを実行します。rm -rf などの破壊的なコマンドを sudo と組み合わせると取り返しのつかないデータ損失が発生する可能性があります。実行前に必ず確認してください。