Directory/File Management
Directory Management:
1.ls
2.cd
3.pwd
4.tree: Viewing the directory tree
5.mkdir: Create an empty directory
-P: Create parent Directory
-V: Show the process of creation
Command line expansion:
Mkdir-pv/mnt/test/{x/m,y} # creates two parallel files X and Y, and then creates subdirectories in the X directory m
~ expand:~username
6.rmdir: Remove empty directory (remove directory)
-p:rmdir-p/mnt/test/x/m
file Tube Manager:
7.touch: Used primarily to change the timestamp of the file (timestamps), when the file to be accessed does not exist, create a blank file
-a:access only change the access time
-m:mo Dify only change the modification time
Change time
-T: Specify the file modification time
Note: Either change the access time or Changing the time, change the time will be changed together, to achieve only change the modification time, and the access time and change time can be used with the parameter T: touch-m-T
-C: Do not create any files
8.stat: View file timestamp
9.RM: Delete File
-f: Forcibly delete
-r: Recursively delete directory
10.cp:copy copy
note: only Can copy a file to another file/directory, or copy multiple files to a directory
-r:
-I: Interaction
-F:
-P: Preserve the owner and the owner group
-L: Keep the link Own Properties
-A: Archive replication, commonly used for backup
11.mv:move mobile
12.install: equivalent to CP, copy a file, cannot copy directory
-d:directory ... Create a directory
note: Copying files using install or creating a directory by default adds execute permissions
datetime
1.date: Display system time
2.clock: Display hardware time
3. Hwclock:
-W: Writes the system time to hardware
-s: Writes hardware time to the system
Cal: Calendar
text view
1.cat: Connect and display
-N: Display line number (the line number is not a file content)
-E: Displays the line terminator for each line
Note: For Linux, the line terminator for a text file is $
2.tac: Display backwards from the end of the line (as opposed to cat display)
3.more: Split-screen display (forward, not back)
4.less: Split screen display,-- --With the flip screen in man, look for the same function
5.head: View the first n rows, default is 10, blank line is also counted as one line
-N:
6.tail: View after n rows, default to 10, blank line is also a row
-N:
-F: View the end of the file, and Do not exit, waiting to display new content for subsequent append speech files
Text processing
1.cut
-D: Specifies the field delimiter, which defaults to a space character
-F: Specifies the field to display br>-F 1,3 Display field 1 and Field 3 (discrete)
-F 1-3 Display field 1 to 3 (continuous)
2.join
3.sed
4.awk
text sort
1.sort: Use sort for display sorting without affecting the source file, by default by Ascall ascending
-N: Sort by numeric size
-r: Descending, must be used with-n br>-T: Specifies the field delimiter
-K: Which field to sort keywords for
-u: the same row after sorting displays only once
-F: The case of ignoring characters when sorting
uniq: If two adjacent lines are the same, only one row is displayed, and if the same rows are not adjacent, they are displayed (Uniq think there are contiguous rows repeating rows)
-D: Show only duplicate rows
-D: Show all duplicate rows
text statistics
1.WC: (World Conut) if not only, the number of rows, the word book, the number of bytes
-L: Show only the number of rows
-W: Show only the number of words
-c: only Display bytes
-L: Displays the maximum number of bytes contained in a row
Character processing commands
1.tr: Convert or delete characters
Usage: TR [OPTION] ... SET1 [SET2]
Example: TR ' ab ' AB ' #将对应的小写字母转换成大写字母
-D: Delete all characters that appear in the character set
Example: TR ' AB ' # removes all A and B in the character set
Job 1:
1. How do I get the latest version of current Linux?
www.kernel.org
2. List the Linux distributions that you know and explain their relationship to the Linux kernel
Linux,gnu:bun/linux
Release: Fedora,redhat (Centos), Suse,debian (Ubantu,mint), Gentoo,lfs (Linux from scratch)
Linux Base _ File directory Management