美文网首页
Linuxstart - L1 L2 Common comman

Linuxstart - L1 L2 Common comman

作者: 左心Chris | 来源:发表于2020-02-17 14:11 被阅读0次

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
  • find grep
search for files: find . -name 2020*
search for text: ls -l | grep -rn '^a'|grep -v x|grep -w
  • tar
tar –cvf jpg.tar *.jpg //The package directory for all jpg files into tar.jpg
tar –xvf file.tar //Extract the tar package
  • ssh sshd
#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
 cut -d : -f 1,7 /etc/passwd
who | cut -c 1-16,26-38

相关文章

网友评论

      本文标题:Linuxstart - L1 L2 Common comman

      本文链接:https://www.haomeiwen.com/subject/ldxbfhtx.html