notes for Linux

Uptime: show the machine’s latest boot up time and running time. Can use to track when it restarted

difference between && and ; when executing shell commands:
using ; when the first command fails, the second command will still be executed
using && when the first command fails, the second command will not be executed

Change user accessibility of a file or directory: sudo chmod 777 /home/pi/schedule/sampleFile

When cannot press tab to auto-fill filenames:
Possible reason 1: root disk full, df –h will show this
Possible reason 2: lost writing access to /tmp. Check  /tmp access permissions, which should like this:
ls -l / |grep tmp
drwxrwxrwt   7 root root  4096 Nov  7 17:17 tmp
if current user does not have write access, then
sudo chmod a+rwxt /tmp


get system and hardware specs:
for command line solutions, you can use the command lshw.
Install it if needed:
sudo apt-get install lshw
then run something like
sudo lshw -html > mySpecs.html
then check the html file.


grep /  find something in many files:
grep  “variable1”  *.sh

xxx.sh   shell script
echo
ps aux | grep sensing
unsuccessfully make while son
then soff
then make install



~/.bashrc     shell shortcuts definition eg. Clrlog
After updating bashrc, need to use command: source .bashrc



check  all service status:
sudo service –status-all

Comments

Popular posts from this blog

most commonly used Emacs commands