Important Debian commands

echo "test" | mail -s "test" your@email.com : to check sendmail working

# sudo service --status-all

# find /etc -name "NAME_OF_FILE"

# sudo passwd : to change root password

# sudo apt-get autoremove

# sudo adduser USER
# sudo userdel USER

# sudo df -h : to get hard disk usage info

# tree : to list down the folder structure. apt-get install tree for installation

# sudo netstat -tulpn : to see what services are runing

# sudo netstat -tapen | grep ":8000 ": check what port 8000 running

# log file reading

tail, less, last, lastlog

# sudo apt-cache : to get more information about repositories

# sudo add-apt-repository : to update your system with unsupported packages.
Ex. add-apt-repository ppa:nginx/stable

=============== File permission =========================================

permission groups

Owner | group | all users

Permission types

read | write | execute

ls -l or ll - to see the file permission granted

How read the pattern

drwxr-xr-x 3 root root: {d}{rwx for owner}{r-x for grup}{r-x for all users} {3 for number of hardlinks to the file} {root root for owner:group}

Modify permissions

where, u - owner, g - group and o or a - all users

assignment operators + and - for add and remove

chomod a-rw file1 : remove read|write permission to file1 for all users
chomod a+rw file1 : add read|write permission to file1 for all users

Using Binary References to Set permissions

where, r = 4, w = 2, x = 1

chmod 640 file1 : {6 = rw- for owner}{4 = r-- for group}{0 = --- for all users}

File ownership

sudo chown -R USER /DATA/SHARE

More info: http://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions

http://www.linux.com/learn/tutorials/760276-how-to-manage-file-and-folder-permissions-in-linux

====================Machine Info========================================

# lsb_release -a : to get OS info

# cat /proc/cpuinfo | grep processor | wc -l : Check how many CPU cores

Popular posts from this blog

Kubernetes for Micro Services

Laravel 5.3

Node-RED