linux common commands --- for example with Ubuntu

Common commands

  • pwd view the current directory
  • which view the command position
  • tree displays a tree view

    -d display only directory

  • Create a directory mkdir

    -p create recursive

  • cat file 1, file 2 to view the file contents

    -n Display line numbers

  • rm delete files

    -r delete a directory
    -f Do not prompt

  • cp Copy

    -r copy, directory
    -a save the file attributes, and recursively copy
    -v show progress

  • mv move and rename

    -i prompt
    -v displays the progress of mobile
    -f Do not prompt

  • grep 'to retrieve the contents of' file name

    -n displays the number of rows
    -v Invert
    -i to ignore case

  • find Find

    -name Specifies the name lookup, the available regular expression
    -size specify the size for example find ./ -size + 5k -size -6k locate files between 5k to 6k of
    -perm 777 specified search the current directory permissions to 777 file

  • ln

    -s soft connection

  • tar creates compression and decompression

    -zcvf -z unzip .gz -j decompress .bz2 -c -v to create a package file lists in detail the process then file -f specify the file name
    -zxvf

    system

  • ps check process

    -a display terminal all processes of other users or processes -u -x Display detailed display process without the controlling terminal displays only -r process currently performed

  • top Dynamic Display

    Senior htop

  • shutdown shutdown

    -h now right now off time or may specify a specific time -h Example: 12: 00 -h +10 10 minutes after shutdown

  • View space df system
  • du view the current directory space
  • View or modify the network card ifconfig website

    ifconfig ip address of the network card name

  • date view time
  • cal -y View Calendar

    Users and Permissions

  • who view the login account
  • whoami view the current login account
  • / Etc / passwd accounts, home directory ...
  • / Etc / group group information

    Groupmod or twice tab to view group

  • useradd -m Add Account user name, no password by default
  • passwd user name user password
  • userdel -r delete the account, delete the home directory colleagues
  • usermod

    -g is used to specify the default group the user belongs
    to the user to add a sudo permissions usermod -a (add) -G (a specified group) sudo adm user name

  • groupadd group name to create groups
  • groupdel group name Delete group
  • modify the file owner chown
  • chgrp group file name modify file group

    Remote Connection

  • ssh username @ip address

Guess you like

Origin www.cnblogs.com/dabenniao/p/11562496.html