LoginSignup
0
0

More than 3 years have passed since last update.

Windows の GUI 操作を Linux の CLI で操作したい

Posted at

Windows だとあーやったけど, Linux だとどーやるの? の簡易まとめ。

フォルダー (ディレクトリー) を作りたい。

mkdir.png
mkdir <ディレクトリー名> で作れます。
Make Directories の略ですね。

$ mkdir test10
$ ls -l
total 0
drwxrwxr-x. 2 vagrant vagrant 6 Apr 16 00:07 test10

フォルダー (ディレクトリー) を移動したい。

cd.png
cd <ディレクトリー名> で移動できます。
Change the current Directory の略ですね。

$ cd test10
$ pwd
/home/vagrant/hoge/test10

空のファイルを作りたい。

touch.png
touch <ファイル名> で作れます。

$ touch test1.txt
$ ls -l test1.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:07 test1.txt

ファイルを切り取って貼り付けたい。(ファイルの移動)

mv1.png
mv <ファイル名> <ディレクトリー名> で移動できます。
MoVe の略ですね。

$ mv test1.txt test10
$ ls -l test10/test1.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:07 test10/test1.txt

ファイルをコピーしたい。

cp.png
cp <コピー元> <コピー先> でコピーできます。
CoPy の略ですね。

$ cp test1.txt test2.txt
$ ls -l test*.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:07 test1.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:09 test2.txt

ショートカット (シンボリックリンク) を作りたい。

ln.png
ln -s <リンク元> <リンク先> でリンクを作れます。
LiNk の略ですね。
-s はおまじない。

$ ln -s test2.txt test3.txt
$ ls -l test*.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:07 test1.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:09 test2.txt
lrwxrwxrwx. 1 vagrant vagrant 9 Apr 16 00:10 test3.txt -> test2.txt

ファイルを削除したい。

rm.png
rm <ファイル名> で削除できます。
ReMove の略ですね。
ただし, ゴミ箱に入るわけではなく, 完全に削除されます。

$ rm test4.txt

ファイル名を変更したい。

mv2.png
mv <変更前ファイル名> <変更後ファイル名> で変更できます。

$ mv test2.txt test4.txt
$ ls -l test*.txt
lrwxrwxrwx. 1 vagrant vagrant 9 Apr 16 00:10 test3.txt -> test2.txt
-rw-rw-r--. 1 vagrant vagrant 0 Apr 16 00:09 test4.txt

ファイルのプロパティ (詳細) を見たい。

stat.png
stat <ファイル名> で見れます。

$ stat test1.txt
  File: test1.txt
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d      Inode: 16802907    Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/ vagrant)   Gid: ( 1000/ vagrant)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2021-04-16 00:09:49.374640772 +0900
Modify: 2021-04-16 00:07:31.435894824 +0900
Change: 2021-04-16 00:07:31.435894824 +0900
 Birth: -

どっとはらい。

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