1 ubuntu file directory
colour | White | blue | Light blue | green | red | yellow | gray |
---|---|---|---|---|---|---|---|
computer | Ordinary file | table of Contents | Link file | executable file | Compressed file | Device file | Other files |
- etc configuration files and directories
- / etc / crontab writes scripts or regularly runs some tasks, with timing settings
- / etc / fstab Disk ID mounted by the system
- / etc / passwd account passwords of all users
- proc (process) You can use the file name to view that
- lib Shared library files required by various programs
- opt (optional third-party software)
- boot (boot file, kernel)
- /boot/grub/grub.conf or menu.lst is used to configure the boot loader.
- / boot / vmlinuz, Linux kernel
- var is used to store many constantly changing files, logs, etc.
- The / var / log directory contains log files and records of various system activities.
- These documents are very important, and they should be monitored from time to time.
- tmp storage system and user temporary information
- usr files and directories directly related to system users local / cuda
- sbin: storage location of system commands
2 Explore ubuntu commonly used commands-short commands (can be connected)-full name can not be connected
1 commonly used
- Find files exactly / find / home / henry / -name 1.txt
- Find wildcards based on file name find / home / henry / -name python *
- sudo find ./ -size 2M
- sudo find ./ -size + 2M find greater than
- whereis pip
- pip: /home/henry/anaconda3/bin/pip
- locate pip find in the database, update once a week
- which pip search system command location
- /home/henry/anaconda3/bin/pip
- date time
- cal calendar
- file name (view file type) /home/henry/.bashrc: ASCII text
- pwd :Print name of current working directory
- ls: List directory contents
- mv ab move, rename
- rm -r is recursive deletion, -f is mandatory
- ln link soft link (symbol link) ln -s item link
2 text processing
- cat connects files and prints to standard output
- cat -A print non-printable characters in text documents
- cat -n increase line number in text
- cat -s merge multiple blank lines 3 blank lines into one
- Non-printing character name display effect
- enter Enter key $
- tab tab ^ I
- space
- sort sorts text lines and sends the results to standard output
- View the size sorting of folders du -s / usr / share / * | sort -nr | head
- uniq report or omit duplicate lines
- uniq -c outputs all repeated lines, and the number of repeats is displayed at the beginning of each line
- uniq -d output only duplicate lines
- cut slice
- cut -f 2,2 linux-by-date.txt> linux-vernums.txt cut, take the east from the file
- paste merge
- Merge file text lines, by reading multiple files, and then integrating the fields in each file into a single text stream, input to standard output.
- paste linux-dates.txt linux-names.txt>linux-key-names.txt
- join to put things in the file
- Compare text:
- comm compares two ordered files line by line
- diff Compare files or directories line by line diff -Naur old_file new_file> patchfile.txt
- patch applies the changes to the original document to patch <patchfile.txt
3 permissions
- ID
- chmod Change a fileʼs mode Change the existing file mode octal or symbolic representation
- umask: Set the default permissions for newly created files
- chown: Change a fileʼs owner
- su runs the shell as another user
- sudo executes a command with another identity
- passwd
4 Software installation management
The core of ubuntu's competing version is: package management, supporting community persistence,
most of which are updated every 6 months
and each individual program is updated daily
-
Early liuxn users install software source code + compile opencv caffe
- New build folder cmake ... (omit if there is a makefile directly) make -j8, make install
-
Download the pre-compiled software package now.
Having access to the software source code is the great thing about Linux. It gives everyone the right to customize and optimize the system.Value system Low-level tools Upper tools .deb Debian , Ubuntu dpkg apt-get, aptitude .rpm Fedora , CentOS , Red Hat , OpenSUSE rpm rpm -
Find the installation command subcommand package name apt install git The
apt command first analyzes the git dependency, which is the benefit of package management. If the program finds that a dependency is missing, it will report an error and exit. -
Uninstall apt remove git y
-
apt update update source
-
Update installed package command subcommand package name apt upgrade git
-
apt-cache show firefox Display detailed information of the package