android:termux

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
android:termux [2020/07/06 10:30] ともやんandroid:termux [2022/10/02 02:46] (現在) – [bash の alias 設定] ともやん
行 1: 行 1:
-<html> 
-  <style> 
-    #result pre, #mincode pre { 
-      overflow: hidden; 
-      font-size: 10px; 
-    } 
-    #result_long pre, #mincode_long pre  { 
-      height: 250px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-    #mintbl table { 
-      font-size: 12px; 
-    } 
-    .dokuwiki .plugin_wrap table { 
-      width: auto; 
-    } 
-    #logo { 
-      background-color: white; 
-      padding: 10px; 
-      width: fit-content; 
-    } 
-    #logo p { 
-      margin: 0; 
-    } 
-  </style> 
-</html> 
 ====== Termux - Android用ターミナル & Linux環境 ====== ====== Termux - Android用ターミナル & Linux環境 ======
 本家: [[https://termux.com/|Termux]]\\ 本家: [[https://termux.com/|Termux]]\\
 ソースコード: [[https://github.com/termux/termux-app|termux/termux-app: Android terminal and Linux environment - app repository.]]\\ ソースコード: [[https://github.com/termux/termux-app|termux/termux-app: Android terminal and Linux environment - app repository.]]\\
 +Wiki: [[https://wiki.termux.com|Termux Wiki]]\\
  
 <WRAP prewrap 100% #result> <WRAP prewrap 100% #result>
行 58: 行 31:
 </WRAP> </WRAP>
  
 +===== デバイスストレージのアクセス許可設定 =====
 +ホームディレクトリ **~/** は **/data/data/com.termux/files/home** である。\\
 <WRAP prewrap 100%> <WRAP prewrap 100%>
 <code> <code>
行 85: 行 60:
 </WRAP> </WRAP>
  
 +===== Vim =====
 +
 +==== インストール ====
 +<WRAP prewrap 100%>
 +<code>
 +$ pkg install vim
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result_long>
 +<code>
 +Reading package lists... Done
 +Building dependency tree
 +Reading state information... Done
 +The following additional packages will be installed:
 +  vim-runtime
 +The following NEW packages will be installed:
 +  vim vim-runtime
 +0 upgraded, 2 newly installed, 0 to remove and 8 not upgraded.
 +Need to get 5094 kB of archives.
 +After this operation, 25.8 MB of additional disk space will be used.
 +Do you want to continue? [Y/n]
 +Get:1 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 vim-runtime all 8.2.1000 [4165 kB]
 +Get:2 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 vim aarch64 8.2.1000 [929 kB]
 +Fetched 5094 kB in 8s (622 kB/s)
 +Selecting previously unselected package vim-runtime.
 +(Reading database ... 4232 files and directories currently installed.)
 +Preparing to unpack .../vim-runtime_8.2.1000_all.deb ...
 +Unpacking vim-runtime (8.2.1000) ...
 +Selecting previously unselected package vim.
 +Preparing to unpack .../vim_8.2.1000_aarch64.deb ...
 +Unpacking vim (8.2.1000) ...
 +Setting up vim-runtime (8.2.1000) ...
 +Setting up vim (8.2.1000) ...
 +update-alternatives: using /data/data/com.termux/files/usr/bin/vim to provide /data/data/com.termux/files/usr/bin/editor (editor) in auto mode
 +</code>
 +</WRAP>
 +
 +===== OpenSSH =====
 +
 +==== インストール ====
 <WRAP prewrap 100%> <WRAP prewrap 100%>
 <code> <code>
行 214: 行 229:
 |  oo.     ..     | |  oo.     ..     |
 +----[SHA256]-----+ +----[SHA256]-----+
 +</code>
 +</WRAP>
 +
 +==== 現在のユーザーを調べる ====
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ id
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +uid=10205(u0_a205) gid=10205(u0_a205) groups=10205(u0_a205),3003(inet),9997(everybody),20205(u0_a205_cache),50205(all_a205)
 +</code>
 +</WRAP>
 +
 +==== パスワードの変更 ====
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ passwd
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +New password:
 +Retype new password:
 +New password was successfully set.
 +</code>
 +</WRAP>
 +
 +==== Android の IP アドレスを調べる ====
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ ifconfig wlan0
 +</code>
 +</WRAP>
 +以下の例では Android 側の IP アドレスは **192.168.43.235** である。\\
 +<WRAP prewrap 100% #result>
 +<code powershell>
 +wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
 +        inet 192.168.43.235  netmask 255.255.255.0  broadcast 192.168.43.255
 +        inet6 fe80::e9d:92ff:fed9:b336  prefixlen 64  scopeid 0x20<link>
 +        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 3000  (UNSPEC)
 +        RX packets 2  bytes 248 (248.0 B)
 +        RX errors 0  dropped 0  overruns 0  frame 0
 +        TX packets 15200979  bytes 2068367171 (1.9 GiB)
 +        TX errors 0  dropped 294 overruns 0  carrier 0  collisions 0
 +</code>
 +</WRAP>
 +
 +==== sshd の起動 ====
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ sshd
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code powershell>
 $ $
 </code> </code>
 </WRAP> </WRAP>
 +
 +==== PC 側から接続 ====
 +<WRAP prewrap 100%>
 +<code powershell>
 +$ ssh u0_a205@192.168.43.235 -p 8022
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code>
 +u0_a205@192.168.43.235's password: <- 設定したパスワードを入力
 +
 +Welcome to Termux!
 +
 +Wiki:            https://wiki.termux.com
 +Community forum: https://termux.com/community
 +Gitter chat:     https://gitter.im/termux/termux
 +IRC channel:     #termux on freenode
 +
 +Working with packages:
 +
 + * Search packages:   pkg search <query>
 + * Install a package: pkg install <package>
 + * Upgrade packages:  pkg upgrade
 +
 +Subscribing to additional repositories:
 +
 + * Root:     pkg install root-repo
 + * Unstable: pkg install unstable-repo
 + * X11:      pkg install x11-repo
 +
 +Report issues at https://termux.com/issues
 +
 +$
 +</code>
 +</WRAP>
 +
 +===== bash の alias 設定 =====
 +Fedora 風に bash の alias を設定する。
 +<WRAP prewrap 100%>
 +<code bash>
 +$ vi ~/.bashrc
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #mincode>
 +<code bash ~/.bashrc>
 +alias diff='diff --color=auto'
 +alias egrep='egrep --color=auto'
 +alias fgrep='fgrep --color=auto'
 +alias grep='grep --color=auto'
 +alias l.='ls -d .* --color=auto'
 +alias ll='ls -l --color=auto'
 +alias ls='ls --color=auto'
 +alias xzegrep='xzegrep --color=auto'
 +alias xzfgrep='xzfgrep --color=auto'
 +alias xzgrep='xzgrep --color=auto'
 +alias zegrep='zegrep --color=auto'
 +alias zfgrep='zfgrep --color=auto'
 +alias zgrep='zgrep --color=auto'
 +</code>
 +</WRAP>
 +
 +.bashrc を読み込んで設定を反映する。\\
 +<WRAP prewrap 100%>
 +<code>
 +$ . ~/.bashrc
 +$ alias
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code bash>
 +alias diff='diff --color=auto'
 +alias egrep='egrep --color=auto'
 +alias fgrep='fgrep --color=auto'
 +alias grep='grep --color=auto'
 +alias l.='ls -d .* --color=auto'
 +alias ll='ls -l --color=auto'
 +alias ls='ls --color=auto'
 +alias xzegrep='xzegrep --color=auto'
 +alias xzfgrep='xzfgrep --color=auto'
 +alias xzgrep='xzgrep --color=auto'
 +alias zegrep='zegrep --color=auto'
 +alias zfgrep='zfgrep --color=auto'
 +alias zgrep='zgrep --color=auto'
 +</code>
 +</WRAP>
 +
 +ll を実行する。\\
 +<WRAP prewrap 100%>
 +<code>
 +$ ll 
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code bash>
 +total 4
 +drwx------ 2 u0_a205 u0_a205 4096 Jul  6 10:06 storage
 +</code>
 +</WRAP>
 +
 +===== gatling =====
 +<code>
 +gatling/stable 0.15 aarch64
 +  A high performance http, ftp and smb server
 +
 +$ pkg install gatling
 +Reading package lists... Done
 +Building dependency tree
 +Reading state information... Done
 +The following NEW packages will be installed:
 +  gatling
 +0 upgraded, 1 newly installed, 0 to remove and 51 not upgraded.
 +Need to get 96.2 kB of archives.
 +After this operation, 418 kB of additional disk space will be used.
 +Get:1 https://dl.bintray.com/termux/termux-packages-24 stable/main aarch64 gatling aarch64 0.15 [96.2 kB]
 +Fetched 96.2 kB in 2s (35.7 kB/s)
 +Selecting previously unselected package gatling.
 +(Reading database ... 5637 files and directories currently installed.)
 +Preparing to unpack .../gatling_0.15_aarch64.deb ...
 +Unpacking gatling (0.15) ...
 +Setting up gatling (0.15) ...
 +</code>
 +
 +===== 参考文献 =====
 +[[https://wlog.flatlib.jp/item/1870|ホイール欲しい ハンドル欲しい » Android Termux で日本語入力を行う / UserLAnd との併用]]\\
 +[[https://www.fefe.de/gatling/|gatling - a high performance web server]]\\
 +[[https://github.com/termux/termux-packages/issues/334|Termux-api not working? · Issue #334 · termux/termux-packages · GitHub]]\\
  
  • android/termux.1593999020.txt.gz
  • 最終更新: 2020/07/06 10:30
  • by ともやん