Linuxstart - L1 L2 Common commands

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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容