Help order :        xxx
--help        man
List the directories and files in the current directory :        ls 
      ls -l     
  ls --help        ls -m
Directory jump :        cd /dev 
Print the current directory name :     
Build directory :     
  mkdir xxx
Delete directory :     
  rmdir xxx        rmdir -r
xxx Recursive delete         rmdir -rf xxx
Force recursive deletion
Create an empty file :     
  touch xxx    Linux It doesn't make sense from the technology corner .
Copy :     
  cp 1 2 hold 1 Copy file into 2        cp
-r d1 d2 Copy the directory to d2
Move :     
  mv  ditto
Read code : First run —〉 Understand business logic —〉 read jsp page —〉 Which database to get data from
debug: Remove part of —〉 Operational observation issues
vi Two modes : Command mode     Edit mode
command :
a add to
esc: Switch to command mode
w Save
q sign out
q! Exit Without Saving
wq Save and exit
dd Delete a line
dw Delete the whole word
o Insert a row
O Insert a line up
[ Google vi Common commands ]
[vi You don't have to use the keyboard ]
more 3.txt     
  The reverse
cat 3.txt     
  positive sequence
head -3 3.txt    Output countdown 3 That's ok
find Find out in what order the files are
= Don't be obsessed with cleanliness =
= Looking for good books , The top book selling websites must be good books =
= It's no use buying books , It's out of date when you buy it , Update too fast =
= It's better to look up English information =
find /etc -name *local Find the file in the specified directory
whereis ls     Find the directory where the command file is located
echo $PATH    View environment variables
=windows Separator ;   Linux、nuix :=
ln 3.txt 4     establish 3.txt link to 4 
  Hard links
ln -s 3.txt 5    Soft link
= Soft links are equivalent to Windows Next shortcut , Should link is equivalent to copying the file and creating a link between the two files =
= Designing your own experiment is also a key step in learning =
= Add users
useradd(adduser) testuser
cd /home    There will be one more home directory
password testuser    Specify user name and password
testuser    User password
cd /etc    Look at the extra files
more passwd    All users are stored here  
  User home directory     user Shell
Add user group information in more group
Add a new group by default
groupadd testg    Add a new group
useradd testuser2 -g testuser    Create a new user , Add to a group
usermod -g testg testuser    Add a user to a group
userdel    testuser 
  Delete user
The home directory is not deleted after the user is deleted , You need to manually delete the home directory
su testuser2    Switching users
When a new user logs in , The default path is the home directory .
= Important knowledge points —— File permissions
ls -l
first place
-    file
l    link
d    Catalog
The last nine are divided into three groups
r    Can be read
w    Can write
-    No authority
x    Can run
The first group , Owner of file
The second group , The owner of the file is the same as the rest of the group
The third group , The authority of the rest
chmod +x 3.txt 
  Add executable rights
chmod -x 3.txt    Remove executable permissions
chmod u+x 3.txt
chmod g+x 3.txt
chmod o+x 3.txt
chmod 777    Three octal numbers ,0 On behalf of no authority ,1 The representative has authority
chown testuser2 3.txt    Modify file owner
= File operations
wc    Counts the number of lines in the specified text file 、 Number of words 、 Number of characters
grep asdf 3.txt 
  Find which line of the file contains the string
stat    Display the information about the designated one
fdisk -l    Display disk information
locale    Displays the current language environment
uname    Display operating system information
dmesg    Display system startup information
= First time information is read from beginning to end
ls -Rl    By long file name list
ls -Rl /etc | more 
  Pagination display ....
The Conduit : Send the output of a command to a command , As input to another command     command 1| command 2| command 3
= Command substitution
wall character string     Inform everyone
wall myname
wall `date`    Command substitution  
  Output the result of the command
= Redirect
ls > 2.txt
more 2.txt    The content of the document is ls Output content
ls >> 2.txt
more 2.txt    Append content to file
lssss 2> 2.txt    Error redirection
vi aaa.txt
wall < aaa.txt    Redirect input

<h1>02_Linux Study _ command </h1> More articles about

  1. 02_Linux Study _ command

    Help order :        xxx --help        man xxx List the directories and files in the current directory :        ls        ls -l        ls --help        ...

  2. 『TensorFlow』SSD Source code learning _ firstly : Introduction to open source papers and projects

    One . Paper introduction Read the paper series :Object Detection ECCV2016 SSD One sentence summary :SSD It's about multi-scale categories RPN The Internet The basic idea : The basic network is followed by multiple layers feature map Multi-storey feat ...

  3. Study vim command :“:w !sudo tee %”

    Study vim command :“:w !sudo tee %” Original URL: Original from commandlinefu This is how the original text explains the fate ...

  4. python Study _ Data processing programming examples ( Two )

    In the last section python Study _ Data processing programming examples ( Two ) And the data has changed , In addition to the student's grades , Added student name and date of birth information , So it's going to become : Output each student's first three best grades and birth year without repetition according to their names ...

  5. Linux Operating system learning _ How the operating system works

    Experiment five :Linux How the operating system works ? Student number :SA1****369 The basis of operating system work : Stored program computer . Stack ( Function call stack ) Mechanism and interruption mechanism The first thing to understand is what stored program computers are ? In fact, stored programs ...

  6. everyday linux Command learning -head Command and tail command

    This section mainly studies linux File browsing related commands , Include etc. , Because I often use cat.less.more command , Already familiar with , So this section focuses on head Command and tail life ...

  7. Learn more Make Command and Makefile( On ) Learn more Make Command and Makefile( On ) make yes Linux The next program automatic maintenance tool , coordination make ...

  8. [ turn ]git Study ------&gt;git-rev-parse I'm new to command

    git Study ------>git-rev-parse I'm new to command 2017 year 06 month 13 Japan 10:04:13 Read the number :2172 One . preparation First step : stay d disc git test Under the table of contents , New workspace root dem ...

  9. jQuery Source code learning _ Tool function _type

    jquery Source code learning _ Tool function _type jquery There is a very important tool function ,$.type Function is used to determine the type , Write this article today , It's to review type The design idea of function , In depth understanding of . First, let's look at the end result : On ...

Random recommendation

  1. $Host.Runspace.ThreadOptions = “ReuseThread” It's a magic horse ?

    $Host.Runspace.ThreadOptions = “ReuseThread” In many PowerShell You'll see that this statement is used to start , So what's its function ? answer : This setting can improve the internal ...

  2. python3 Module calls between different directories

    #Author by Andy #_*_ coding:utf-8 _*_ #__file__ Get the relative path of the current program import os,sys #print(__file__) # os.path. ...

  3. 【Mongodb】3.X Configure Authentication

    Configuration authentication details : Open authentication : start-up MongoDB./mongodb --syslog --fork --port 20000  --auth 1. If you don't add parameters :auth, Indicate with default root Authority ...

  4. paip. Copy file File operations api The design of the uapi java python php Best practices

    paip. Copy file File operations api The design of the uapi java python php Best practices =====uapi   copy() =====java No , Write by yourself ... ====php   copy ...

  5. URAL 1932 The Secret of Identifier Answer key B - The Secret of Identifier Time Limit:1000MS ...

  6. html-----006

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...

  7. jquery Get the element of the parent window [ turn ]

    $("# Parent window element ID",window.parent.document);  Corresponding javascript Version is window.parent.document.getElementById ...

  8. poj 2166 structure

    A topic that can only be understood after reading the problem-solving report , The first point is easy to understand , That is, every time I put 1 After switching to the top of the heap, if you can switch to the back position, it must be the best , But I don't understand how to achieve this . The construction method of problem solving , And from 2 Start inserting , Yes, it can guarantee ...

  9. notepad++ Regular expression replacement string details

    A regular expression is a string of queries , It contains general characters and some special characters , Special characters extend the ability to find strings , The role of regular expressions in finding and replacing strings cannot be ignored , it It can improve work efficiency very well . EditPlus Lookup , Replace , writing ...

  10. Spring And Example (Java The negative foundation of the actual combat )

    Pick up Spring And To configure Code inside . Now it's time to Controller Development of . 1. Reference classes import org.springframework.web.servlet.mvc.Controller ...