Basic Shell Commands in Termux and System Info Tools
Let us begin with some commands and shortcuts, which help to move around the terminal. The commands are almost universal in most Linux or Unix flavors, by the way.
Bash Commands
whoami
prints current userpwd
prints working directorycd [nameofdirectory]
changes working directorymkdir [nameofdirectory]
creates directory in current working directoryuname -a
ls
top
shows running processesclear
clears screen!!
runs previous command, often used likesudo !!
q
usually quits the app- Ctrl+C terminates the running process, Ctrl+D exits shell
- Ctrl+Shift+C, Ctrl+Shift+V, Copy and Paste
Moving Through the Command Line
- Ctrl+A return to the beginning of the line, Ctrl+E to the end of the line
- move to beginning of the word Alt+B, to the end Alt+F
- delete previous word Alt+Backspace
- Alt Autocomplete
How to Create Batch Scripts?
You can easily create scripts to run multiple commands in a succession in Linux. The batch script can be of any file extension, we will use the standard .sh extension for clarity. Steps to create the batch:
- Create file in the target directory
touch bat.sh
- Edit the file with text editor, f.i.
vi bat.sh
- In the first line, add "SheBang" command, identifying the file as a script and executing it as Bash shell:
#!/bin/bash
- Add your consecutive commands, in separate lines.
- Make the file executable by changing its properties
chmod +x bat.sh
- Run the file:
./bat.sh
System Info Tools
You can install all tools with apt install [name] -y
. You may try some basic options or read the manual online or by the CLI command man [name]
.
htop
- Run
htop -h
to get help,htop -C
for monochromatic version
inxi
- Overall system info
inxi
orinxi -a
,inxi -b
for more detailed information - Info about graphics
inxi -G
, memoryinxi -m
- Info about soundsystem
inxi -A
- High level overview
inxi -F
Run the commands with sudo
to get the overview with serial numbers.
- what to install next