Category:Linux Commands
Commands
use Ctrl + O to save file use Ctrol + X to quit
More info can see on this page.
Common
- Vi: type i to edit, type esc to exit edit mode, type :x to save editing
- screen
Name | Type | available in | description |
---|---|---|---|
neo4j | Example | Example | |
Napkin | Example | Example | |
JRuby | Example | Example | |
Java | coding | Example | |
ssh | network | Example | |
git | coding | Example | |
lsof | Example | Example | |
libc6-armel | Example | Example | |
Bash | common | Example | |
Busybox | Example | Example | |
cpulimit | system | Example | |
Transmission | network | openwrt | |
Shadowsocks | network | openwrt | |
mjpeg streamer | video | Example | |
Linux Motion | video | Example | |
Nano | editor | Example | |
opkg | system | Example | |
perl | coding | Example | |
vsftpd | network | Example | |
wget | network | Example | |
yaaw | network | Example | |
Htop | system | Example | monitor system status |
Psensor | system | Example | monitor CPU status |
apache2 | internet | Example | apache internet server |
nginx | internet | Example | widely used internet server, maybe better than apache2 |
Php5 | internet | Example | lanuage |
mysql | internet | Example | database |
- matchbox-keyboard florence sudo
- apt-get install gdebi
- sudo apt-get install synaptic
rSync file
Basic syntax of rsync command - rsync options source destination Sufffix
Header text | Header text | Header text |
---|---|---|
Example | -v | verbose |
Example | -r | copies data recursively (but don’t preserve timestamps and permission while transferring data |
Example | -a | archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps |
Example | -z | compress file data |
Example | -h | human-readable, output numbers in a human-readable format |
Example | -z | compress during transfer |
Example | -H, --hard-links | keep the hard links |
Example | -S, --sparse | sparse file special treatment to save DST space |
Examples
Type | Header text | Header text |
---|---|---|
Basic |
|
copy local file from /home/coremail to /cmbak |
Example | Example | Example |
Example | Example | Example |
- reference: http://coolnull.com/1899.html
Open windows software
- install app win: apt-get install wine
Proxy
SS client
- apt-get install shadowsocks
- sslocal -c ss.json
Proxy - ProxyChains
- proxychains > tsocks
Proxy - Polipo
- Install polipo: apt-get install polipo
- config /etc/polipo/config
proxyAddress = "0.0.0.0"
socksParentProxy = "127.0.0.1:1080" socksProxyType = socks5
chunkHighMark = 50331648 objectHighMark = 16384
serverMaxSlots = 64 serverSlots = 16 serverSlots1 = 32
- restart it: /etc/init.d/polipo restart
- restart and try:
export http_proxy="http://127.0.0.1:8123/" curl www.google.com
- proxychains: /etc/proxychains.conf
- tsocks: sudo nano /etc/tsocks.conf
Find IP in LAN:
- install nmap: sudo apt-get install nmap
- nmap -sn 192.168.1.0/24
or use netdiscover
- sudo apt-get install netdiscover
- sudo netdiscover -r 192.168.1.0/24 -i wlan0
- change wlan0 to eth0
Send udp data to a IP
- sendip -p ipv4 -is 192.168.1.81 -p udp -us 5070 -ud 5060 -d "Hello" -v 192.168.1.81
- Refer to ESP Light
Media
- media play with omxplayer, command: omxplayer example.mp3
- to force output : omxplayer -o hdmi example.mp3
- or: omxplayer -o local example.mp3
- Use lxmuisc or VLC: apt-get install lxmusic
- Omx GUI player TBOplayer
Use Minidlna
sudo apt-get install minidlna
- edit connf for minidlna /etc/minidlna.conf
port=8200 media_dir=/media/ friendly_name=dlna
restart it
sudo /etc/init.d/minidlna force-reload
- webpage data can be found at: http://192.168.0.103:8200/
- local view at "my computer" - "network"
opkg package management
- list-installed
- remove
- update
- Check the opkg source address, my correct address is barrier_breaker http://downloads.openwrt.org/barrier_breaker/14.07/ramips/rt305x/packages/packages, replacing it in the follow text
Commands
Category | Command | Description | example | example description
|
---|---|---|---|---|
File/Folder | cd | change directory |
|
- |
File/Folder | cat | print file content to screen | - | - |
File/Folder | touch | change file to current system time, or create new file | - | - |
File/Folder | mkdir | make directory | mkdir -m 700 electrodragon | -m for mode 700 |
File/Folder | tailf | diplay the last 10 lines of the file | tailf /srv/www/logs/www*access.log | - |
File/Folder | pwd | list current folder | pwd | - |
File/Folder | cp | copy file | cp -r folder /home/ | |
File/Folder | rm -rf | remove the file or folder, r=? f=force | - | |
File/Folder |
|
list the user and group -a include all files | ls -l |
|
File/Folder | mv | move or rename files and folders | mv /usr/lib/* /zone |
File/Folder Right
Basic
root@www:~/sh# ls -al total 32 drwxr-xr-x 4 root root 4096 Dec 13 06:26 . drwx------ 10 root root 4096 Dec 13 05:56 .. -rwxr-xr-x 1 root root 1226 Dec 13 05:48 backup.sh drwxr-xr-x 3 root root 4096 Dec 13 05:42 bk drwxr-xr-x 8 root root 4096 Dec 13 06:04 .git -rwxr-xr-x 1 root root 561 Dec 13 06:03 loadmonitor.sh -rwxr-xr-x 1 root root 0 Dec 13 06:26 mem.sh -rwxr-xr-x 1 root root 778 Dec 13 06:00 nginx_log.sh -rwxr-xr-x 1 root root 280 Dec 13 05:48 uptime.sh
For line drwxr-xr-x 3 root root 4096 Dec 13 05:42 bk
- d is directory, rwx is write/read/run right, 1st group for owner, 2 for group, 3 other users
Category | Command | Description | example | example description
|
---|---|---|---|---|
File/Folder Right | chown | change folder owner and group |
|
|
File/Folder Right | chmod | change folder/file permission | chmod -R 700 /opt/oracle | 700 is the permission, R means folder and files, recursive |
File/Folder Right | usermod -a -G | Add the user to the supplementary group(s). Use only with the -G option. | usermod -a -G pi debian-transmission | add debian* to pi group |
File/Folder Right | Usermod -G | add user to a group | usermod -G root pi | add user pi to root group |
File/Folder Right |
|
|
|
|
File/Folder Right | chgrp | change group |
|
change folder group |
User and Group
- userdel username
Net
Category | Command | Description | example | example description |
---|---|---|---|---|
User right | groupadd or groupdel | add/del new group | groupadd group1 | - |
User right | alias |
|
alias p="pwd" or p='pwd' | |
Net | ping | ping ip address | ping 192.168.0.1 | |
Net | ifconfig | show network info | ifconfig | |
Net | wget | download a file from internet |
System
Category | Command | Description | example | example description |
---|---|---|---|---|
System-package | apt-get | install, remove, update, remove --purage package | apt-get install | install package |
System-package | sudo dpkg -i debfile | install *.deb package |
| |
System | su | switch user | su | |
System | lsusb, lsmod | list usb, modules | - | - |
System | dmesg | Boot info | - | - |
System | crontab -e | run programme periodically |
|
- |
System | help | help command | - | - |
System | man | show manual | man update-rc.d | - |
System | ps -x | show current process | - | - |
System | top | system status | - | - |
System | hostname | show/edit hostname | hostname moon | change hostname to "moon", also need to change /etc/hosts |
System | ps | show process |
|
check if service ssh on or off |
System | free -m |
|
- | - |
Screen
- Screen, sync SSH to Serial of RPI -> Install first sudo apt-get install screen -> screen /dev/ttyAMA0/ 115200
Tools
- FileZilla
- WinScp
- SecureCRT
- Xshell
Packages
Nano
Install
ubuntu@ubuntu:~/c_enviroment/sample$ sudo apt-get install nano
A simple tutorial on how to use nano is: http://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/
One thing you may notice with this sketch, it compiles to the command line. This example shows how you can pass parameters to the sketch when calling it from the command line. This is optional as you will see in some of the other sketches, but does add some benefit to writing sketches to run on the pcDuino.
Pages in category "Linux Commands"
The following 3 pages are in this category, out of 3 total.