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
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。