https://github.com/mengning/linuxstart
L2 Usage
Common Commands
- PATH environment variables and hot keys
echo $PATH
export PATH=$PATH:/home/ubuntu/
~/.bashrc
whereis check command position
- User and user group:useradd groupadd
Root User
General User
Virtual User
- file attribute and permission to operate:chmod, chown
-rwxr-xr-x 1 ubuntu ubuntu 430540 Dec 23 18:27 example.file
file user->group user->other user
chmod 777 filename
search for files: find . -name 2020*
search for text: ls -l | grep -rn '^a'|grep -v x|grep -w
tar –cvf jpg.tar *.jpg //The package directory for all jpg files into tar.jpg
tar –xvf file.tar //Extract the tar package
#ssh to log in to your Linux system, through the find command to find the / etc directory destination time and by all * .conf
#tar package; * .conf by grep the files contained in the file "ubuntu" , then redirect it into a new file
tar -cvf conf.tar /etc/*.conf |grep "ubuntu" > ./unbuntu_conf
cut -d : -f 1,7 /etc/passwd
who | cut -c 1-16,26-38