Ubuntu File System

Source: Internet
Author: User
Tags create directory

File system:
Rootfs: Root file system

Fhs:linux File System Level standards

LS/
/boot: System boot related files, such as kernel, INITRD, and Grub (bootloader)
/dev: Device files
Block devices: Random devices, random access, data blocks do not matter the order, such as disk,
Character device: Linear access by character, such as Monitor, mouse, keyboard
Device number: Main device number (major) and secondary device number (minor)
/etc: Configuration file
Home directory of the user, default to a user's home directory is usually/home/username
/root: Administrator's home directory
/lib: library file
Static Library. A
Dynamic library, Dll,.so share object
/lib/modules: Kernel module files

Lost+found and system-independent lost and recovered
/media: mount point directory, mobile device
/MNT: mount point directory, additional temporary file system
/OPT: Optional directory, third-party program installation directory Nessas
/proc: Pseudo file system, kernel mapping file This directory is actually empty, after the system starts, it is not empty
/sys: Pseudo file system, property mapping file related to hardware device
/tmp: Temp file,/var/tmp
/var: a variable file
/bin:binary executable file, user command
/sbin: Managing Commands

/usr:universal, Share, read-only, read-only files
/usr/bin
/usr/sbin
/usr/lib

/usr/local: third-party software
/usr/local/bin
/usr/local/sbin
/usr/local/lib

Command rule:
1, the length can not exceed 255 characters
2. Cannot use/when file name
3. Strictly case-sensitive

Operating system
File Management
Directory Management
Ls
Cd
Pwd
Mkdir
-P:
-v:verbose
/root/x/y/z
/mnt/test/x/m,y
mkdir-pv/mnt/test/x/m/mnt/test/y
Mkdir-pv/mnt/test/{x/m,y}

Command line expansion
/mnt/test2/
A_b, A_c, D_b, D_c
{A,b}_{b,c}

Tree view Directory Trees
Rmkdir only empty directories can be deleted

Creation and deletion of files
Touch--used primarily to modify timestamps (Acess Modify change)
-c-no-create do not create files
Change Time stamp
-A
-M
Touch-m-T 2012121212 FILENAME

Stat-Displays status information for a file or file system

You can also use a text editor to create a file

Ascii
128 Non-pass characters
Binary: 2^7=0,127
Standard: GB18030 GBK, GB2312, Unicode character set

Nano Text Editor
Nano Hello

Delete File: RM
-I.
-F
-R

1. Create a Directory
(1) Create boot and sysroot under/mnt:
(2) Create grub under/mnt/boot:
(3) Create proc, sys, bin, sbin, lib, usr, var, etc, Dev, home, Root, tmp under/mnt/sysroot
A) under/MNT/SYSROOT/USR, create Bin, Sbin, Lib
b) Create the modules under/mnt/sysroot/lib
c) Create run, log, lock under/mnt/sysroot/var
d) Create a init.d under/MNT/SYSROOT/ETC

Copying and moving files

Cp:copy
CP SRC DEST
-R Recursive replication
-F
-P
-A: Archive replication, often used for backup
-L--link link files instead of copying
-L--dereference always follow symbolic links
-P--no-dereference Keep link

CP file1 File2 File3
A file to a file
Multiple files to a directory can be multiple sources one target
Cp/etc/{passwd,inittab,rc.d/rc.sysinit}/tmp/

Mv:move
Moving files
MV SRC DEST
Mv-t DEST SRC
Move directory, File
Modify file directory Name

Install---Copy files and set attributes
-D DIRECTORY
-m-set Permission Mode
Install-t DIRECTORY SRC

Install-d/TMP/{INSTALL.1, INSTALL.A} Create directory
Install/etc/passwd/var/tmp/install.file1 copy files, have execute permission

Install cannot copy directory install file


Free software
Open Source Agreement: Copyright description

What is the current kernel version number for Linux?
www.kernel.org
List the Linux distributions you know and describe their relationship to the Linux kernel.
Linux, gnu/linux Kernel+gun software software is available in source code form

Add your own logo by linking the source code to the compiler
Release: Fedora, RedHat (CentOS), SUSE, Debian (Ubuntu, Mint), Gentoo,lfs (Linux from Scratch)

Tools for deep use of Linux LFS
Master general use of Debian
Compilation converts the source code into binary code that the current hardware system can execute

RedHat: 32-bit version of the universal format is mounted on 64-bit

Pentium: Core does not work well with new features of the latest CPUs, preferably compiled on this machine

File
Tree view Directory Trees
Directory Management:
LS, CD, mkdir, tree
File Management:
Touch, stat, file (view file content type), RM, CP, MV, Nano
Date Time:
Date, clock, Hwclock, Cal

To view text:
Cat, TAC, more, less, head, tail

cat:concatenate files and print on the screen link and display
Cat/etc/issue/etc/fstab
Cat
-N Display Line number
-e Displays the display of each line for Linux systems the text line end conforms to the $,windows text line terminator is $+enter
-A Show all characters

SHIFT + PageUp PageDown
Split-screen display command:
More, less

MORE: Support want to flip space B K
More/etc/rc.d/rc.sysint

Less
Space K/: b enert Q

Head: View Top N rows
Tail: View after n rows default 10 rows

Head/etc/inittab
Head-n 2/etc/inittab
Head-5/etc/inittab

Tail-f--follow Look at the end of the file, do not exit, wait to display the new content appended to this file.

Don't deny yourself any information at all times. Murphy's Law, have faith not blind

Text Processing:
Cut, join, SED, awk

Database

Relational database:
Table: two-dimensional table rows and columns
Text file:
Tome:23:male:2013/05/06
Show a section of a text file

Cut
-D: Specifies the field delimiter. The default is a space
-F: Specify the fields to display
-F 1,3
-F 1-3

Cut-d:-f1/etc/passwd

Text sort: Sort
Sort sorts the contents of the output display
-N: Numeric sorting
-r:reverse Descending
-T: Field delimiter
-K: Which field is the keyword to sort
-u:unique the same row after sorting is only displayed once
-F: Sorting is case insensitive

Sort/etc/fstab the order of the default ascending ASCII table
SORT-T:-k3-n/etc/passwd

Uniq--report or omit repeated lines (adjacent and repeating)
-d:repeated only duplicate rows are displayed
-D: Show all duplicate rows
-C: Displays the number of repetitions of a row

Text statistics: WC (word count) line Word number of bytes
-L
-W
-C
-L--max-line-length

Character Processing Command TR
TR:--translate or delete character

TR [OPTION] ... SET1 SET2
-D: Delete all characters that appear in the character set

TR ' AB ' AB '
Tr ' A-Z ' A-Z ' </etc/passwd
Tr-d ' AB '

Ubuntu File System

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.