0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linuxコマンド

Posted at

ファイル操作

コマンド 説明 使用例          
ls ファイルやディレクトリの一覧を表示 ls -l (詳細表示)
cd ディレクトリを移動 cd /home/user
pwd 現在のディレクトリを表示 pwd
mkdir ディレクトリを作成 mkdir new_directory
rmdir ディレクトリを削除 rmdir empty_directory
touch 空のファイルを作成 touch new_file.txt
cp ファイルやディレクトリをコピー cp file1.txt file2.txt
rm ファイルやディレクトリを削除 rm file.txt
cat ファイルの内容を表示 cat file.txt /tmp
mv ファイルやディレクトリを移動 mv file.txt /tmp
less ファイルの内容をページ単位で表示 less long_file.txt
head ファイルの先頭部分を表示 head -n 10 file.txt (先頭10行を表示)
tail ファイルの末尾部分を表示 tail -f log_file.txt (ログファイルをリアルタイムに監視)
find ファイルを検索 find / -name "*.txt" (ルートディレクトリ以下で .txt ファイルを検索)
locate ファイルを高速に検索 locate file.txt
grep ファイルから特定の文字列を検索 grep "keyword" file.txt
chmod ファイルのアクセス権を変更 chmod 755 file.txt
chown ファイルの所有者を変更 chown user:group file.txt

ディスク管理

コマンド 説明 使用例          
df ディスクの空き容量を表示 df -h (人間が読みやすい形式で表示)
du ディレクトリやファイルのディスク使用量を表示 du -sh * (カレントディレクトリ以下のディスク使用量を表示)
mount ファイルシステムをマウント mount /dev/sda1 /mnt
umount ファイルシステムをアンマウント umount /mnt
fdisk ディスクパーティションを操作 fdisk /dev/sda
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?