Linux basic instructions
If you want to do well, you must first sharpen your tools
ffmepeg
ls (display files in the current directory)
ls-old
- a: All files
- l: list
- t: reverse order
.
- Current directory
…
- Up-level directory
-drwxr-xr-x
- File owner
- File array
- Other users
-: ordinary file, d: directory file, l: link file, b: device file, c: character device file, p: pipe file
cd
Enter a specified directory
cd -
- Only switch between the current two directories
mkdir
Create folder/directory
- Permission related can also be viewed, such as 775
mkdir -p a/b/c
- Specify the parameter p to create multiple directories at the same time
pwd
View the specific location of the current directory
cp
Copy a file or directory from where to
cp .file/anotherFile.
- Copy the file in the current directory to another file
cat
View
cat file.txt
- View the contents of the file
rm
Parameter Description
- Directory == Folder
rm command will not delete folders. To
delete empty folders, you can use the rmdir command
but rm -R can delete folders, regardless of whether there are files or subfolders under the folder.
Just delete this directory tree. It is the sub-files and sub-folders starting from it. - cp also has a corresponding -R option, which also copies the directory tree rooted at this.
rm xxx
rm -r xxx
- Delete circularly, but will prompt
rm -rf xxx
- Cycle deletion, f is mandatory
sudo
Switch the permissions of the current user, for example, visitors cut the administrator to install a certain software
pkg-config
C and C++ development application program, link library use
Basic use of Vim
:wq
-
Save and exit
-
:q
- drop out
-
:w
- Save
-
dd
- delete
yy
- copy
p
- Paste
i
- Enter edit mode
esc
- Exit edit mode
h
- Shift left
l
- Shift right
j
- Move down
k
- Move up
Environment variable
bash_profile
zshrc
env
- View current environment variables
grep path
- Search path
Path
-
working principle
- When a command is executed, a global search will be performed, if found, it will execute otherwise an error will be thrown
- Similar to a global environment variable area
pkg_config_path
-
working principle
- For example: using ffmpeg, you need to import a specific library
- The linux system is used to find the library file path. If you don't configure it, you need to write the library path and header file yourself when compiling the program. Will be troublesome
-
pkg-config --libs --cflags libavutil
- libs that library
- cflags header file
Installation tool
mac
-
brew
- brew search xxx
- brew install xxx
- brew remove xxx
ubuntu
- apt
centOS
- yum
XMind - Trial Version