디렉토리 내용보기 (Dos의 Dir과 동일)
ls
ls -l
ls -lf
Path 에 포함된 파일이름 찾기
which python
which reboot
화면지움 (Dos의 cls 와 같음)
Clear
리눅스의 32, 64비트 확인
getconf LONG_BIT
CPU 온도 체크
vcgencmd measure_temp
CHOWN Pi:Pi text.txt
시간확인
date
시간대 변경
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
로그 위치
/var/log/syslog
가동시간 확인
uptime
현재 폴더 위치
pwd
파일의 위치
whereis
Expect 사용해서 sftp를 통해 파일 전송
sudo apt-get install expect
Script
#!/usr/bin/expect
spawn sftp username@hostname.com
expect "password:"
send "yourpasswordhere\n"
expect "sftp>"
send "cd /var/www\n"
expect "sftp>"
send "put /var/www/house.log\n"
expect "sftp>"
send "exit\n"
interact
프로그램 삭제(예:아파치2)
sudo apt-get purge apache2*
sudo apt-get autoremov
모든 py 파일 맨 첫줄에 아래 문구를 삽입해야 다른 파일(php)에서 py실행을 할 수 있음
#!/usr/bin/env python
SSH 접속
예를들어 ID 가 test 를 example.com 에 접속시
ssh test@example.com
#SSH to Chorok-farm server
ssh id@domain.com
CPU Temperature check
/opt/vc/bin/vcgencmd measure_temp
Update command
sudo apt-get update
sudo apt-get upgrade
Unistall programs
udo apt-get --purge remove programname
--purge option is to remove all data
Show strage size
df command - Shows the amount of disk space used and available on Linux file systems.
du command - Display the amount of disk space used by the specified files and for each subdirectory.
apache server setting #Location of APACHE Config file
sudo nano /etc/apache2/apache2.conf
sudo service apache2 restart
gunzip backup.sql.gz
mysql -uroot -p[password] < backup.sql
압축 해제
sudo tar -xvf file.name
Raspberrypi Camera
Webstreaming to http://domain.com:8081
raspivid -o - -t 0 -w 640 -h 480 -fps 24 |cvlc -vvv stream:///dev/stdin --sout #standard{access=http,mux=ts,dst=:8081}' :demux=h264
Still cut (resolution 640x480 )
raspistill -t 2000 -o image.jpg -w 640 -h 480
#Update & Upgrade
apt-get update
apt-get upgrade
#Check CPU temerature = figures/1000
cat /sys/devices/virtual/thermal/thermal_zone0/temp
#change root's password
sudo passwd root
# Install python3 or upgrade
sudo apt-get install python3
sudo apt-get upgrade python3
#check installed program
apt list --installed | grep PROGRAMNAME
# IP address check
ip add show
# Show program list
dpkg --list
# Uninstall program # Including configure file
sudo apt-get --purge remove PROGRAMNAME
# Uninstall program # without configure file
sudo apt-get remove gimp PROGRAMNAME
'Computer > Linux' 카테고리의 다른 글
crontab (1) | 2019.02.07 |
---|---|
VirtualHost 서브도메인 특정폴더로 연결 (0) | 2019.02.07 |
라즈베리파이 온도 습도 센서 DHT22 AM2302 연결 (0) | 2019.02.07 |
라즈베리 파이 웹서버 구성 APM 설치 + PhpMyAdmin + FTP (0) | 2019.02.07 |
라즈베리 파이 OS 설치 (NOOBS 기준으로 라즈비안 설치) (0) | 2019.02.07 |
Create number sequence text file (0) | 2019.01.20 |
RaspberryPi (0) | 2016.08.12 |
Odroid (0) | 2016.07.19 |