コマンドラインは、Linuxの最も強力な機能の1つです。 Linuxコマンドラインツールの海が存在し、LinuxPCで考えられるほとんどすべてのことを実行できます。ただし、これは通常、問題を引き起こします。使用できるコマンドが非常に多いため、特に初心者の場合は、どこでどのようにコマンドを学習し始めるかがわかりません。
この問題に直面していて、Linuxでコマンドラインの旅を始める簡単な方法を探しているなら、正しい場所に来ました。この記事のように、人気のある便利なLinuxのホストを紹介します。コマンド。この記事は、わかりやすい例を通じて、各コマンドの機能をすばやく学習できるように構成されています。コマンドの詳細については、説明の最後にある[詳細...]リンクをクリックしてください。
Adduser / Addgroup
adduser およびaddgroup コマンドを使用すると、新しいユーザーとグループをそれぞれシステムに追加できます。 adduserの例を次に示します。
$ sudo adduser testuser
ユーザー`testuser'を追加しています...
新しいグループ`testuser'(1003)を追加しています...
グループ`testuser'で新しいユーザー`testuser'(1003)を追加しています...
ホームディレクトリ`/home /testuser'を作成しています...
`/ etc / skel'からファイルをコピーしています...
新しいUNIXパスワードを入力してください:
続きを読む:
- 初心者向けのLinuxadduser/ addgroupコマンドチュートリアル(7つの例)
aproposコマンドは、使用可能なすべてのマニュアルページの名前と説明をすばやく検索するために使用されます。例:接尾辞プログラムのすべてのマニュアルページを検索します:
$適切な 後置
続きを読む:
- 初心者向けのLinuxaproposコマンドチュートリアル(5つの例)
aspell コマンドを使用すると、テキストファイルのスペルチェックを実行できます。テキストファイルtest.txtでスペルチェックを実行する例:
$ aspell -c test.txt
aspellコマンドの詳細については、このチュートリアルをご覧ください。
- 初心者向けのLinuxaspellコマンドチュートリアル(5つの例)
Ar
ar コマンドを使用すると、アーカイブを作成、変更、または抽出できます。 'test.a'アーカイブからファイルを一覧表示する方法の例:
$ ar t test.a
続きを読む:
- 初心者向けのLinuxarコマンドチュートリアル(5つの例)
アーチ コマンドは、マシンのアーキテクチャを印刷するために使用されます。例:
$ arch
i686
「i686」の意味がわかりませんか?ここに向かいます。
basenameコマンドを使用すると、不要なファイル名からコンポーネントを削除できます。例:
basename NAME [SUFFIX]
basename OPTION ... NAME ...
basenameコマンドのその他の例:
- 初心者向けのLinuxbasenameコマンドチュートリアル(例付き)
Bzip2
bzip2コマンドは、bzip2形式で圧縮ファイルアーカイブを作成するために使用されます。 Bzip2は、zipまたはgzip形式よりも優れた圧縮率を備えています。
$ bzip2 list.txt list1.txt list2.txt
その他の例:
- 初心者向けのLinuxbzip2コマンドチュートリアル(6つの例)
bzip2形式のアーカイブファイルを操作するその他のコマンドは、このチュートリアルで説明されているbzcmp、bzdiff、bzmore、bzless、bzgrepです。
- Linuxのbzcmp、bzdiff、bzmore、bzless、およびbzgrepコマンドを例で説明
Cal / Ncal
cal およびncal コマンドは出力にカレンダーを表示します。
$ cal
2017年3月
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
$ ncal
2017年3月
Su 5 12 19 26
Mo 6 13 20 27
Tu 7 14 21 28
We 1 8 15 22 29
Th 2 9 16 23 30
Fr 3 10 17 24 31
Sa 4 11 18 25
calおよびncalコマンドのその他の例:
- 初心者向けのLinuxCal/NCalコマンドの10の実用例
猫 コマンドを使用すると、ファイルまたは標準入力で提供されるデータを連結して、標準出力に出力できます。素人の言葉で言えば、コマンドは、stdinを介して、またはファイルの形式で、提供された情報を出力します。
$猫 test.txt
こんにちは...お元気ですか?
その他のCATコマンドの例:
- 初心者向けの10のLinuxCatコマンドの例
Cd
cd コマンドは、ユーザーの現在の作業ディレクトリを変更するために使用されます。
$ cd / home / himanshu /
その他のCDコマンドの例:
- 初心者向けのLinuxcdコマンドチュートリアル(8例)
chattr コマンドは、不変属性などのファイルおよびフォルダーの拡張ファイルシステム属性を一覧表示および編集するために使用されます。この例は、ファイルを不変にする方法を示しています。 Linuxユーザーは、rootユーザーでさえも、最初に不変属性を削除せずに編集または削除できないようにします。
$ chattr + i /path/somefile.txt
不変属性は次のように削除されます:
$ chattr -i /path/somefile.txt
chattrコマンドのその他の例は、このチュートリアルに示されています:
- 初心者向けのLinuxchattrコマンドチュートリアル(5つの例)
Chgrp
chgrp コマンドを使用すると、ファイルのグループ所有権を変更できます。このコマンドでは、最初の引数として新しいグループ名、2番目の引数としてファイル名(グループが変更されている)が必要です。
$ chgrp howtoforge test.txt
詳細:初心者向けのLinux Chgrpコマンド(5つの例)
Chmod
chmod コマンドを使用すると、ファイルのアクセス許可を変更できます。たとえば、バイナリファイル(たとえばhelloWorld)があり、それを実行可能にしたい場合は、次のコマンドを実行できます。
chmod + x helloWorld
詳細:初心者向けのLinuxchmodコマンドチュートリアル
chown コマンドを使用すると、ファイルの所有権とグループを変更できます。たとえば、ファイルtest.txtの所有者をrootに変更し、そのグループをrootに設定するには、次のコマンドを実行します。
チャウン root:root test.txt
詳細:初心者向けのLinux Chownコマンドチュートリアル(7つの例)
Cksum
cksum コマンドは、入力ファイルのCRCチェックサムとバイトカウントを出力します。
$ cksum test.txt
3741370333 20 test.txt
チェックサムとは何かわかりませんか?ここに向かいます。
Chksumコマンドの詳細: 初心者向けのLinuxcksumコマンドの説明(例付き)
クリア コマンドは、ターミナル画面をクリアするために使用されます。
$クリア
詳細:初心者向けのLinuxクリアコマンドチュートリアル(3つの例)
Cmp
cmp コマンドは、2つのファイルのバイトごとの比較を実行するために使用されます。
$ cmp file1 file2
file1 file2の違い:バイト1、1行目
その他のCMPコマンドの例:
- 初心者向けのLinuxcmpコマンドチュートリアル(7例)
comm コマンドは、2つのソートされたファイルを1行ずつ比較するために使用されます。たとえば、「file1」に1〜5の数字が含まれ、「file2」に4〜8の数字が含まれている場合、この場合、「comm」コマンドは次のように生成します。
$ comm file1 file2
1
2
3
4
5
7
7
- 初心者向けのLinux通信コマンドチュートリアル(5つの例)
Cp
cp コマンドはファイルとディレクトリのコピーに使用されます。
$ cp test.txt / home // himanshu / Desktop /
詳細:初心者向けのLinux cpコマンドチュートリアル(8例)
Cpulimit
Cpulimit プロセスのCPU使用率を制限するツールです(CPU時間ではなく、パーセンテージで表されます)。バッチジョブに多くのCPUサイクルを消費させたくない場合は、バッチジョブを制御すると便利です。 cpulimitの目的は、プロセスが指定された時間比率を超えて実行されないようにすることです。
$ cpulimit -l 30 dd if =/ dev / zero of =/ dev / null&
詳細:UbuntuLinuxでCPULimitを使用してCPU使用率を制限する方法
Csh
csh コマンドは、Linuxユーザーシェルを切り替えるために使用されます。デフォルトのシェル(おそらく/ bin / bash)から/ bin / shに切り替えるには、次のコマンドを使用します。
$ chsh -s / bin / sh
詳細:初心者向けのLinux chshコマンドチュートリアル(5つの例)
Csplit
csplit コマンドを使用すると、ファイルをコンテキスト行によって決定されるセクションに分割できます。たとえば、ファイルを2つに分割し、最初の部分に「n-1」行が含まれ、2番目の部分に残りの行が含まれるようにするには、次のコマンドを使用します。
$ csplit file1 [n]
2つの部分は、それぞれ「xx00」と「xx01」という名前のファイルとして保存されます。
詳細:初心者向けのLinux Csplitコマンドの説明(6つの例)
カール コマンドは、HTTPまたはHTTPSによってインターネットからファイルをダウンロードするために使用されます。 Ubuntuトレントファイルをフェッチして、現在のディレクトリにtest.torrentとして保存する例:
$カール http://releases.ubuntu.com/18.04/ubuntu-18.04-desktop-amd64.iso.torrent> test.torrent
便利なcurlコマンドラインオプションの例については、こちらをご覧ください:
- 初心者向けのLinuxcurlコマンドチュートリアル(5つの例)
日付 コマンドを使用して、システムの日付と時刻を印刷(または設定)することができます。
$日付
2017年2月28日火曜日17:14:57IST
詳細:初心者向けのLinux日付コマンドチュートリアル(8例)
Dd
dd コマンドはファイルをコピーし、オペランドに従って変換およびフォーマットします。たとえば、次のコマンドは/ dev/sdaパーティションのイメージを作成します。
dd if =/ dev / sda of =/tmp/dev-sda-part.img
詳細:初心者向けのLinux ddコマンドの説明(8例)
Df
df コマンドは、ファイルシステムのディスク容量の使用量を出力に表示します。
$ df / dev / sda1
Filesystem 1K-blocks Used Use%Mounted on
/ dev / sda1 74985616 48138832 23014620 68%/
詳細:初心者向けのLinux dfコマンドチュートリアル(8例)
相違
差分 コマンドを使用すると、2つのファイルを1行ずつ比較できます。
$ diff file1 file2
Diff3
diff3 コマンドは、その名前が示すように、3つのファイルを1行ずつ比較できます。
$ diff3 file1 file2 file3
掘る コマンドは、DNSサーバーのクエリとDNSレコードの解決に使用されます。ドメインexample.comのネームサーバーに関するIPアドレスと情報を取得する例:
$掘る example.com
digコマンドを使用してドメイン名とDNSレコードを解決する方法のその他の例:
- Linuxでdigコマンドを使用してドメイン名を解決する
dir コマンドはディレクトリの内容を一覧表示します。例:
$ dir
test1 test2 test.7z test.zip
詳細:初心者向けのLinux dirコマンド(10例)
dirname コマンドは、ファイル名/パスから最後のコンポーネントを削除します。素人の言葉で言えば、たとえば、ファイルの絶対パスからファイル名を削除するツールと考えることができます。
$ディレクトリ名 / home / himanshu / file1
/ home / himanshu
詳細:初心者向けに説明されているLinux dirnameコマンド(4つの例)
Dmesg
dmesgコマンドを使用すると、カーネルリングバッファを印刷または制御できます。その構文は次のとおりです。
dmesg[オプション]
詳細:初心者向けのLinux dmesgコマンドチュートリアル(5つの例)
Dmidecode
dmidecode コマンドは、システムのDMI(別名SMBIOS)テーブルの内容を人間が読める形式で出力します。
$ sudo dmidecode
#dmidecode 2.12
SMBIOS2.6が存在します。
2056バイトを占める50の構造体。
0x000FCCA0のテーブル。
0x0000、DMIタイプ0、24バイトを処理します。
BIOS情報
ベンダー:American Megatrends Inc.
バージョン:080015
リリース日:2011年8月22日
...
...
。 ..
Dpkg
dpkgツールは基本的にDebian/Debianベースのシステム用のパッケージマネージャーです。その構文は次のとおりです。
dpkgアクション
または
dpkg[オプション]ファイル名
詳細:初心者向けのLinux dpkgコマンドチュートリアル(8例)
du コマンドは、ディレクトリとそのサブディレクトリに存在するファイルのディスク使用量を表示します。
$ du / home / himanshu / Desktop /
92 / home / himanshu / Desktop / Downloads / meld / meld / ui
88 / home / himanshu / Desktop / Downloads / meld / meld / vc
56 / home / himanshu / Desktop / Downloads / meld / meld / matchers
12 / home / himanshu / Desktop / Downloads / meld / meld / __ pycache __
688 / home / himanshu / Desktop / Downloads / meld / meld
16 / home / himanshu / Desktop / Downloads / meld / bin
328 / home / himanshu / Desktop / Downloads / meld / data / ui
52 / home / himanshu / Desktop / Downloads / meld / data / icons / svg
詳細:初心者向けのLinux duコマンドチュートリアル(10例)
エコー コマンドは、与えられた入力テキストを表示します。
$エコー こんにちはこんにちは
こんにちは
詳細:初心者向けのLinux echoコマンドチュートリアル(5つの例)
Ed
ed は行指向のテキストエディタです。
$ ed
イジェクト コマンドを使用すると、リムーバブルメディア(通常はCD ROMまたはフロッピーディスク)を取り出すことができます
$イジェクト
env コマンドは、現在の環境を表示するだけでなく、編集することもできます。
$ env
詳細:初心者向けのLinux envコマンドチュートリアル(5つの例)
出口 コマンドを実行すると、シェルが終了します。
$終了
詳細:初心者向けのLinux exitコマンドの説明(例付き)
拡張 コマンドは、入力ファイルに存在するタブをスペースに変換し、ファイルの内容を標準出力に書き込みます。
$拡張 file1
詳細:Linuxは初心者向けのコマンドチュートリアルを展開します(例付き)
Expr
expr コマンドは式を評価します。例:
$ expr 1 + 2
3
詳細:初心者向けのLinux exprコマンドチュートリアル(例付き)
ファクター コマンドは、入力された数値の素因数を出力します。
$ファクター 135
135:3 3 3 5
詳細:初心者向けのLinuxファクターコマンドチュートリアル(例付き)
Fgrep
fgrep コマンドは、-Fコマンドラインオプションを指定して実行した場合のgrepコマンドと同等です。このツールは、正規表現のメタ文字を特別なものとして扱わず、代わりに情報を単純な文字列として処理するため、固定または高速grepとも呼ばれます。
たとえば、ファイル内のドット(。)を検索し、grepにワイルドカード文字として解釈させたくない場合は、次のようにfgrepを使用します。
$ fgrep 「。」 [ファイル名]
詳細:初心者向けのLinux fgrepコマンドチュートリアル(例付き)
検索 コマンドを使用すると、ディレクトリとそのサブディレクトリ内のファイルを検索できます。
$検索 test *
test
test1
test2
test.7z
test.c
test.txt
Linuxの検索コマンドのその他の例:
- 初心者向けのLinux検索コマンドの14の実用例
- 検索コマンドを使用してファイルとフォルダを検索する
- コマンドラインでファイルを検索する
Fmt
fmt シンプルで最適なテキストフォーマッタです。渡されたファイルの各段落を再フォーマットし、ファイルの内容を標準出力に書き込みます。
$ fmt file1
詳細:Linuxfmtコマンド-使用法と例
折り畳み コマンドは、指定された幅に収まるように各入力行を折り返します。
$折りたたむ -w10
こんにちは私の名前はひまんしゅアロラです
こんにちは私の名前は
ヒマンズです
huArora
詳細:初心者向けのLinux foldコマンドチュートリアル(例付き)
無料 コマンドは、システムの空きメモリと使用済みメモリの量を表示します。
$無料
合計使用済みの無料の共有バッファがキャッシュされました
Mem:1800032 1355288 444744 79440 9068 216236
-/ +バッファ/キャッシュ:1129984 670048
スワップ:1832956
Git git コマンドまたはgitバージョン管理システム LinuxTorvaldsによって開発されました。これは現在、古いSVNシステムに取って代わった最も人気のあるソフトウェアバージョン管理システムです。 GITは例です。 GitHubで使用されます。現在のディレクトリに「Mytest」という名前の新しいgitリポジトリを作成する方法の例:
$ git Mytestを初期化するgitコマンドとそれをGitHubに接続する方法の詳細については、こちらをご覧ください:
- Ubuntu LinuxへのGitとGitHubのインストールと使用:初心者向けガイド
Grep grep コマンドは、1つまたは複数のファイルで指定されたパターンを検索し、そのパターンを含む出力行に表示します。
$ grep こんにちはtest.txt
こんにちは...お元気ですか?Linux Grepコマンドのその他のチュートリアルと例:
- grepを使用してシェル上のファイル内の文字列を検索する方法
- Grepを使用してファイルでパターン検索を実行する方法
グループ グループ コマンドは、ユーザーが属しているグループの名前を表示します。
$グループ himanshu
himanshu:himanshu adm cdrom sudo dip plugindev lpadmin sambashare続きを読む:
- 初心者向けのLinuxグループコマンド(例付き)
Gzip
gzip コマンドは入力ファイルを圧縮し、ファイル自体を.gz拡張子を持つファイルに置き換えます。
$ gzip file1詳細:初心者向けのLinux Gzipコマンドチュートリアル(7つの例)
ガンジップ gzipで圧縮されたファイル gunzip を使用して、コマンドを元の形式に復元できます。 コマンド。
$ gunzip file1.gzGunzipコマンドの例の詳細。
頭 頭 コマンドは、ファイルの最初の10行を標準出力に表示します
$頭 CHANGELOG.txt
BEEBEEP(Secure Lan Messanger)
BeeBEEP
2.0.4
-いくつかのGUIの改善(新しいアイコン、ファイル共有ツリーのロードが高速化)
-常にビープ音到着した新しいメッセージについて(オプション)
-お気に入りのユーザー(ユーザーを右クリックしてスターボタンを有効にする)がリストの一番上にあります
-グループの使いやすさが向上しました
-オフラインユーザーをリストから削除できます(リスト内のオフラインユーザーを右クリックして削除します)
-共有されているすべてのファイルをクリアします(オプション)
-起動時に最小化された負荷(オプション)Linuxのheadコマンドのその他の例については、こちらをご覧ください。
ホスト名 ホスト名 コマンドは、システムのホスト名を表示するだけでなく、システムのホスト名も設定できるようにします。
$ホスト名
himanshu-desktop続きを読む:
- 初心者向けのLinuxホスト名コマンドチュートリアル(5つの例)
履歴 履歴 commandは、シェルで入力したコマンドの履歴を表示するために使用されます。コマンドの記録と再生にも使用できます。コマンド履歴を表示するには、次のコマンドを実行します:
$履歴履歴の使用方法とコマンドの記録と再生の方法の詳細については、こちらをご覧ください。
- 初心者向けのLinux履歴コマンドチュートリアル(8例)
Id
id コマンドは、現在のユーザーまたは指定されたユーザー名のユーザーとグループの情報を出力します。
$ id himanshu
uid =1000(himanshu)gid =1000(himanshu)groups =1000(himanshu)、4(adm)、24(cdrom)、27(sudo)、30(dip)、46(plugdev)、108 (lpadmin)、124(sambashare)続きを読む:
- 初心者向けのLinuxidコマンドチュートリアル(5つの例)
Ifconfig
ifconfigコマンドを使用すると、ネットワークインターフェイスを構成できます。もちろん、このツールを使用してネットワークインターフェイスに関連する情報を取得することもできます。その構文は次のとおりです。
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options |アドレス...詳細:初心者向けのLinux ifconfigコマンドチュートリアル(7つの例)
参加 参加 コマンドを使用すると、2つのファイルの行を共通のフィールドに結合できます(デフォルトは最初です)。
join [OPTION] ... FILE1 FILE2このコマンドについてもっと知りたいですか?ここに向かいます。
キル キル コマンドは、その名前が示すように、TERMシグナルをプロセスに送信することにより、ユーザーがプロセスを強制終了するのに役立ちます。
$ kill [process-id]Linuxのkillコマンドの使用方法を示す5つの例。
キラル killall コマンドを使用すると、名前でプロセスを強制終了できます。強制終了(プロセスのIDを強制終了する必要がある)とは異なり、killallにはプロセスの名前が必要です。
$ killall オウムガイLinuxのkillallコマンドの例。
最後 最後 コマンドは、最後にログインしたユーザーのリストを表示します。
$最後
himanshu pts / 11:0 Thu Mar209:46まだログインしています
himanshupts / 1:0 Thu Mar209:46まだログインしています
himanshu:0:0 Thu Mar 2 09:42まだログインしています
システムブート4.4.0-62を再起動します-一般的な木3月2日09:41-10:36(00:54)
himanshu pts / 14:0水3月1日15: 17-15:52(00:35)
himanshu pts / 13:0 Wed Mar 1 14:40-down(08:06)続きを読む:
- 初心者向けのLinux最後のコマンドチュートリアル(8例)
Ldd
ldd コマンドは、共有ライブラリの出力依存関係に表示されます。
$ ldd /lib/i386-linux-gnu/libcrypt-2.19.so
linux-gate.so.1 =>(0xb77df000)
libc.so.6 => / lib / i386-linux-gnu / libc.so.6(0xb75da000)
/lib/ld-linux.so.2(0x80088000)lddコマンドの使用例。
Ln
ln コマンドは、ファイル間のリンクを作成するために使用されます。たとえば、次のコマンドは、「lnk」という名前のリンクを「test.txt」という名前のファイルに作成します。
$ ln test.txt lnkLinuxlnコマンドのその他の例。
検索 検索 コマンドは、ユーザーが名前でファイルを見つけるのに役立ちます。
$検索 [ファイル名]続きを読む:
- 初心者向けのLinux検索コマンド(8つの例)
ログ名 lognameコマンドは、現在のユーザーのユーザー名を出力します。
$ログ名
ひまんしゅ続きを読む:
- 初心者向けのLinuxlognameコマンドチュートリアル(例付き)
見てください 外観 Linuxのコマンドは、指定された文字列で始まる行を表示します。その構文は次のとおりです。
$見る [-bdf][-ttermchar]文字列[ファイル...]詳細:
- 初心者向けのLinuxルックコマンドチュートリアル(例付き)
Ls
ls コマンドは、出力内のディレクトリの内容を一覧表示します。
$ ls progress
capture.png hlist.o progress progress.h size.c
hlist.c LICENSE progress.1 progress.o size.h
hlist.h Makefile progress.c README.md size .oLSコマンドのその他の例:
- 16初心者向けのLinuxLSコマンドの実用例
Lshw
lshw コマンドは、マシンのハードウェア構成に関する詳細情報を抽出して表示します。
$ sudo lshw
[sudo] himanshuのパスワード:
himanshu-desktop
description:Desktop Computer
product:To Be Filled By O.E.M. (O.E.M.で埋める)
ベンダー:O.E.M。で埋める
バージョン:O.E.M。で埋める
シリアル:O.E.M。で埋める
幅:32ビット
機能:smbios-2.6 dmi-2.6 smp-1.4 smp
...
...
..続きを読む:
- 初心者向けのLinuxlshwコマンドチュートリアル(6つの例)
Lscpu
lscpu コマンドは、出力システムのCPUアーキテクチャ情報(CPU、スレッド、コア、ソケットなどの数など)に表示されます。
$ lscpu
アーキテクチャ:i686
CPU op-mode(s):32ビット、64ビット
バイトオーダー:Little Endian
CPU(s):1
オン-ラインCPUリスト:0
コアあたりのスレッド:1
ソケットあたりのコア:1
ソケット:1
ベンダーID: AuthenticAMD
CPUファミリー:16
モデル:6
ステッピング:3
CPU MHz:2800.234
BogoMIPS:5600.46
仮想化:AMD-V
L1dキャッシュ:64K
L1iキャッシュ:64K
L2キャッシュ:1024K続きを読む:
- 初心者向けのLinuxlscpuコマンドチュートリアル(5つの例)
Lsof
lsof コマンドは、プロセスによって開かれたファイルに関連する情報を(stdoutに)表示します。ファイルには、通常のファイル、ディレクトリ、ブロック特殊ファイル、文字特殊ファイル、実行中のテキスト参照、ライブラリ、ストリーム/ネットワークファイルなど、あらゆる種類のファイルを使用できます。
lsof続きを読む:
- 初心者向けのLinuxlsofコマンドチュートリアル(10例)
男 男 コマンド、プログラム/ユーティリティ、および機能のリファレンスマニュアルにアクセスできます。
$男 ls続きを読む:
- 初心者向けのLinuxmanコマンドチュートリアル(8例)
Md5sum
md5sum コマンドを使用すると、MD5(128ビット)チェックサムを印刷またはチェックできます。
$ md5sum test.txt
ac34b1f34803a6691ff8b732bb97fbba test.txtLinux md5sumコマンドの使用方法の例と、初心者向けのLinux md5sumコマンドチュートリアルのチュートリアル(5つの例)
Mkdir
mkdir コマンドを使用すると、ディレクトリを作成できます。
$ mkdir [dir-name]mkdirコマンドのその他の例。
Mkfifo
mkfifo コマンドは名前付きパイプを作成するために使用されます。
$mkfifo[パイプ名]
その他 moreは基本的に、一度に1画面ずつテキストをページングするためのフィルターです。
$cat[ラージファイル]| もっと例:
- Linux初心者向けのその他のコマンドチュートリアル(5つの例)
Mv
mv コマンドを使用すると、ファイルをあるディレクトリから別のディレクトリに移動したり、名前を変更したりできます。
$ mv test.txt / home / himanshu / Desktop /その他のmvコマンドの例。
ナノ nano Linuxのコマンドは、「nano」エディターを起動します。このエディタは、UWPicoテキストエディタの機能と使いやすさをエミュレートするように設計されています。
$ nanoまたは
$ nano [ファイル名]Nano Editorの詳細:
- Nanoエディターの使用法と例。
- nimとnanoを使用したコマンドラインでのファイル編集。
Netstat netstatコマンドを使用すると、ネットワーク接続、ルーティングテーブル、インターフェイス統計、マスカレード接続、およびマルチキャストメンバーシップを印刷できます。例:
netstat[オプション]詳細:初心者向けのLinux netstatコマンドチュートリアル(8例)
いい 素敵な コマンドを使用すると、スケジュールの優先度を変更してプログラムを実行できます。
$いい -n [niceness-value] [program]$いい -n15 vim続きを読む:
- Linuxのniceandreniceコマンドチュートリアル(7つの例)
Nl
nl コマンドはファイルの内容を出力に書き込み、各行の前に行番号を付けます。
$ nl file1
1こんにちは
2お元気ですか
3さようなら続きを読む:
- 初心者向けのLinuxnlコマンドチュートリアル(7つの例)
Nm
nm コマンドは、オブジェクトファイルのシンボルを表示するために使用されます。
$ nm テスト
0804a020B __bss_start
0804841dT比較
0804a020b完了.6591
0804a018 D __data_start
0804a018 W data_start
08048360 t deregister_tm_clones
080483d0 t __do_global_dtors_aux
08049f0c t __do_global_dtors_aux_fini_array_entry
0804a01c D __dso_handle
08049f14 d _DYNAMIC
0804a020 D _edata
0804a024 B _ _fp_hw
080483f0 t frame_dummy
...
...
...続きを読む:
- 初心者向けのLinuxnmコマンドチュートリアル(10例)
Nproc
nproc コマンドは、現在のプロセスで使用可能な処理ユニットの数を表示します。
$ nproc
1その他の例:
- 初心者向けのLinuxnprocコマンドチュートリアル(例付き)
奇数 od コマンドを使用すると、8進数およびその他の形式でファイルをダンプできます。
$ od / bin / ls
0000000 042577 043114 000401 000001 000000 000000 000000 000000
0000020 000002 000003 000001 000000 140101 004004 000064 000000
0000040 122104 000001 000000 000000 000064 000040 000011 000050
0000060 000034 000033 000006 000000 000064 000000 100064 004004
0000100 100064 004004 000440 000000 000440 000000 000005 000000
0000120 000004 000000 000003 000000 000524 000000 100524 004004
...
...
...
パスワード passwd コマンドは、ユーザーアカウントのパスワードを変更するために使用されます。
$ passwd himanshu
himanshuのパスワードを変更します。
(現在の)UNIXパスワード:
貼り付け 貼り付け コマンドを使用すると、ファイルの行をマージできます。たとえば、「file1」に次の行が含まれている場合:
$ cat file1
Hi
私の名前は
Himanshu
Arora
I
Am
a
Linuxの研究者
およびチュートリアル
ライター次に、次の「貼り付け」コマンドがファイルのすべての行を結合します。
$貼り付け -sfile1
こんにちは私の名前はHimanshuAroraです。私はLinuxの研究者でありチュートリアルライターです貼り付けコマンドのその他の例。
Pidof pidof コマンドは、実行中のプログラム/プロセスのプロセスIDを提供します。
$ pidof オウムガイ
2714
ピン ping コマンドは、システムが稼働して応答しているかどうかを確認するために使用されます。 ICMPECHO_REQUESTをネットワークホストに送信します。
$ ping howtoforge.com
PING howtoforge.com(104.24.0.68)56(84)バイトのデータ。
104.24.0.68から64バイト:icmp_seq =1 ttl =58 time =47.3 ms
64 104.24.0.68からのバイト:icmp_seq =2 ttl =58 time =51.9 ms
104.24.0.68からの64バイト:icmp_seq =3 ttl =58 time =57.4 ms詳細:初心者向けのLinux pingコマンドチュートリアル(8例)
Ps
ps コマンドは、現在アクティブなプロセスに関する情報を(スナップショットの形式で)表示します。
$ ps
PID TTY TIME CMD
4537 pts / 1 00:00:00 bash
20592 pts / 1 00:00:00 ps
Pstree
pstree command produces information about running processes in the form of a tree.
$ pstree
init???ModemManager???2*[{ModemManager}]
??NetworkManager???dhclient
? ??dnsmasq
? ??3*[{NetworkManager}]
??accounts-daemon???2*[{accounts-daemon}]
??acpid
??atop
Pwd
The pwd command displays the name of current/working directory.
$ pwd
/home/himanshuMore Examples:
- Linux pwd Command Tutorial for Beginners (with Examples)
Rm
The rm command lets you remove files and/or directories.
$ rm [file-name]Detailed examples for the Linux rm command.
Rmdir
The rmdir command allows you delete empty directories.
$ rmdir [dir-name]Examples on Linux rmdir command.
Scp
The scp command lets you securely copy files between systems on a network.
$ scp [name-and-path-of-file-to-transfer] [user]@[host]:[dest-path]
Screen
The screen command helps you to keep a terminal session open even when your SSH connection is interrupted.
$ screenDetailed examples can be found here: Linux screen Command:Keep Processes Running Despite a Dropped Connection
Sdiff
The sdiff command lets you perform a side-by-side merge of differences between two files.
$ sdiff file1 file2例:
- Linux sdiff Command Tutorial for Beginners (6 Examples)
Sed
sed is basically a stream editor that allows users to perform basic text transformations on an input stream (a file or input from a pipeline).
$ echo "Welcome to Howtoforge" | sed -e 's/Howtoforge/HowtoForge/g'
Welcome to HowtoForge
Seq
The seq commands prints numbers from FIRST to LAST, in steps of INCREMENT. For example, if FIRST is 1, LAST is 10, and INCREMENT is 2, then here's the output this command produces:
$ seq 1 2 10
1
3
5
7
9Examples of how to use the Linux seq command.
Sha1sum
The sha1sum command is used to print or check SHA1 (160-bit) checksums.
$ sha1sum test.txt
955e48dfc9256866b3e5138fcea5ea0406105e68 test.txtRead more: Linux sha1sum Command Tutorial for Beginners (with Examples)
Shutdown
The shutdown command lets user shut the system in a safe way.
$ shutdownMore examples:
- Linux shutdown Command Explained with Examples
Size
The size command lists the section sizes as well as the total size for an object or archive file.
$ size test
text data bss dec hex filename
1204 280 4 1488 5d0 testExamples for Linux size command.
Sleep
The sleep command lets user specify delay for a specified amount of time. You can use it to delay an operation like:
$ sleep 10; shutdown
Sort
The sort command lets you sort lines of text files. For example, if 'file2' contains the following names:
$ cat file2
zeus
kyan
sam
adamThen running the sort command produces the following output:
$ sort file2
adam
kyan
sam
zeus
Split
The split command, as the name suggests, splits a file into fixed-size pieces. By default, files with name like xaa, xab, and xac are produced.
$ split [file-name]
Ssh
ssh is basically OpenSSH SSH client. It provides secure encrypted communication between two untrusted hosts over an insecure network.
$ ssh [user-name]@[remote-server]
Ssh-keygen
The ssh-keygen command is used to create a private/public key pair for SSH. Example on how to create an SSH key pair with 4096 bit:
$ ssh-keygen -o -b 4096 -t rsaAn in-depth explanation on how to use the ssh-keygen command can be found here:
- Linux Basics:How To Create and Install SSH Keys on the Shell
Stat
The stat command displays status related to a file or a file-system.
$ stat test.txt
File:‘test.txt’
Size:20 Blocks:8 IO Block:4096 regular file
Device:801h/2049d Inode:284762 Links:2
Access:(0664/-rw-rw-r--) Uid:( 0/ root) Gid:( 0/ root)
Access:2017-03-03 12:41:27.791206947 +0530
Modify:2017-02-28 16:05:15.952472926 +0530
Change:2017-03-02 11:10:00.028548636 +0530
Birth:-Read more:
- Linux stat Command Tutorial for Beginners (5 Examples)
Strings
The strings command displays in output printable character sequences that are at least 4 characters long. It is used to search for printable text (strings) in binary files. For example, when a binary executable 'test' was passed as an argument to this command, following output was produced:
$ strings test
/lib/ld-linux.so.2
libc.so.6
_IO_stdin_used
puts
__libc_start_main
__gmon_start__
GLIBC_2.0
PTRh
QVhI
[^_]
EQUAL
;*2$"
GCC:(Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
....
....
....Read more:
- Linux strings Command Tutorial for Beginners (5 Examples)
Su
The su command lets you change user-identity. Mostly, this command is used to become root or superuser.
$ su [user-name]
Sudo
The sudo command lets a permitted user run a command as another user (usually root or superuser).
$ sudo [command]
Sum
The sum command prints checksum and block counts for each input file.
$ sum readme.txt
45252 5Read more:
- Linux sum Command Tutorial for Beginners (with Examples)
Tac
The tac command prints input files in reverse. Functionality-wise, it does the reverse of what the cat command does.
$ cat file2
zeus
kyan
sam
adam$ tac file2
adam
sam
kyan
zeusRead more:
- Linux tac Command Tutorial for Beginners (with Examples)
Tail
The tail command displays in output the last 10 lines of a file.
$ tail [file-name]Read more:
- Linux tail Command Tutorial for Beginners (5 Examples)
Talk
The talk command lets users talk with each other.
$ talk [user-name]
Tar
tar is an archiving utility that lets you create as well as extract archive files. For example, to create archive.tar from files 'foo' and 'bar', use the following command:
$ tar -cf archive.tar foo barMore...
Tee
The tee command reads from standard input and write to standard output as well as files.
$ uname | tee file2
Linux$ cat file2
Linux
Test
The test command checks file types and compare values. For example, you can use it in the following way:
$ test 7 -gt 5 &&echo "true"
trueRead more:
- Linux test Command Tutorial for Beginners (with Examples)
Time
The time command is used to summarize system resource usage of a program.例:
$ time ping google.com
PING google.com (216.58.220.206) 56(84) bytes of data.
64 bytes from del01s08-in-f14.1e100.net (216.58.220.206):icmp_seq=1 ttl=52 time=44.2 ms
^C
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev =44.288/44.288/44.288/0.000 ms
real 0m0.676s
user 0m0.000s
sys 0m0.000s
Top
The top command gives a dynamic real-time view of a running system (in terms of its processes).例:
$ topMore: Linux top Command Tutorial for Beginners (8 Examples)
Touch
The touch command lets you change file timestamps (the access and modification times). When name of a non-existent file is passed as an argument, that file gets created.
$ touch [file-name]More examples of Linux touch command.
Tr
The tr command can be used to translate/squeeze/delete characters. For example, here's how you can use it to convert lowercase characters to uppercase:
$ echo 'howtoforge' | tr "[:lower:]" "[:upper:]"
HOWTOFORGE
Tty
The tty command prints the filename of the terminal connected to standard input.
$ tty
/dev/pts/10More: Linux tty Command Tutorial for Beginners (with Examples)
Uname
The uname command prints certain system information.
$ uname -a
Linux himanshu-desktop 4.4.0-62-generic #83~14.04.1-Ubuntu SMP Wed Jan 18 18:10:26 UTC 2017 i686 athlon i686 GNU/LinuxRead more:
- Linux uname Command Tutorial for Beginners (8 Examples)
Unexpand
The unexpand command lets you convert spaces into tabs.例:
unexpand [OPTION]... [FILE]...Read More: Linux unexpand Command Explained for Beginners (with Examples)
Uniq
The Uniq command is used to report or omit repeated lines. For example, if 'file2' contains the following data:
$ cat file2
Welcome to HowtoForge
Welcome to HowtoForge
A Linux tutorial website
ThanksThen you can use the uniq command to omit the repeated line.
$ uniq file2
Welcome to HowtoForge
A Linux tutorial website
ThanksRead more: Linux Uniq Command Tutorial for Beginners (10 examples)
Unexpand
The unexpand command converts spaces present in the input file(s) into tabs, and writes the file contents to standard output.
$ unexpand file1
Uptime
The uptime command tells how long the system has been running.
$ uptime
15:59:59 up 6:20, 4 users, load average:0.81, 0.92, 0.82Here are some examples of Linux uptime command usage.
Users
The users command displays in output the usernames of users currently logged in to the current host.
$ users
himanshu himanshu himanshu himanshuRead more:
- Linux 'users' Command Tutorial for Beginners (with Examples)
Vdir
The vdir command lists information about contents of a directory (current directory by default).
$ vdir
total 1088
-rw-rw-r-- 1 himanshu himanshu 4850 May 20 2015 test_backup.pdf
-rw-rw-r-- 1 himanshu himanshu 2082 May 28 2015 test-filled.pdf
-rw-rw-r-- 1 himanshu himanshu 7101 May 28 2015 test.pdf
Vim vim is basically a text/programming editor. The name 'vim' stands for Vi IMproved as the editor is upwards compatible to the Vi editor.
$ vim [file-name]Take a look here for a tutorial that shows editing files with vim on the command line explained in detail.
W
The w command displays information about the users currently on the machine, and their processes.
$ w
16:18:07 up 6:39, 4 users, load average:0.07, 0.32, 0.53
USER TTY FROM [email protected] IDLE JCPU PCPU WHAT
himanshu :0 :0 09:39 ?xdm? 1:08m 0.25s init --user
himanshu pts/0 :0 09:41 6:36m 0.84s 7.84s gnome-terminal
himanshu pts/10 :0 14:51 0.00s 0.16s 0.00s w
himanshu pts/11 :0 15:41 35:19 0.05s 0.05s bashRead more:
- Linux w Command Tutorial for Beginners (5 Examples)
Wall
The wall command lets you write and send a message to other users that are currently logged in.
$ wall [your-message]Read more:
- Linux wall Command Tutorial for Beginners (with Examples)
Watch
The watch command can be used to monitor a program's output. It runs the program repeatedly, displaying its output and errors.例:
$ watch dateRead more:
- Linux watch Command Tutorial for Beginners (5 Examples)
Wc
The wc command prints newline, word, and byte counts for a file.
$ wc test.txt
0 3 20 test.txtRead more about the Linux wc command.
Wget
The w get command line tool in Linux lets you perform a non-interactive download of files from the Web.
Here's how you can use it:
wget [URL]Read more about the wget command here.
Whatis
The whatis command displays single-line manual page descriptions.
$ whatis mkdir
mkdir (1) - make directories
mkdir (2) - create a directory
mkdir (1posix) - make directories
Which
The which command basically lets you locate a command - the file and the path of the file that gets executed.例:
$ which date
/bin/dateRead more:
- Linux which and whoami Command Tutorial for Beginners (with Examples)
Who
The who command shows who is logged on.
$ who
himanshu :0 2017-03-03 09:39 (:0)
himanshu pts/0 2017-03-03 09:41 (:0)
himanshu pts/10 2017-03-03 14:51 (:0)
himanshu pts/11 2017-03-03 15:41 (:0)Read more:
- Linux who Command Tutorial for Beginners (8 Examples)
Whereis
The whereis command shows in output locations of the binary, source, and manual page files for a command.
$ whereis ls
ls:/bin/ls /usr/share/man/man1/ls.1posix.gz /usr/share/man/man1/ls.1.gzSome Linux whereis command examples.
Whoami
The whoami command prints effective userid of the current user.
$ whoami
himanshuRead more:
- Linux which and whoami Command Tutorial for Beginners (with Examples)
Xargs
The xargs command builds and executes command lines from standard input. In layman's terms, it reads items from stdin and executes a command passed to it as an argument. For example, here's how you can use xargs to find the word "Linux" in the files whose names are passed to it as input.
$ xargs grep "Linux"
file1
file2
file3
file1:Linux researcher
file2:A Linux tutorial website
file3:Linux is opensourceMore...
Yes
The Yes command outputs a string repeatedly until killed.
$ yes [string]More examples for Linux Yes Command.
Zcat
The zcat command is used to display the content of gzip compressed files. Example on how to display the content of the gzip compressed text file test.txt.gz:
$ zcat test2.txt.gzMore useful zcat examples can be found here:
- Linux zcat Command Tutorial for Beginners (5 Examples)
Linux