Other Linux commands

find files

The find command is very powerful and is usually used to find  files that meet the conditions


If the path is omitted, it means to search in the current folder

soft link

Notice:

1. A hard link file is created without the -s option

Two files occupy the same amount of hard disk space, and hard links to files are hardly established during work

2. The source file should use an absolute path instead of a relative path, so that it can still be used normally after moving the linked file.

Schematic diagram of file soft and hard links


In Linux, file names and file data are stored separately

hint:

In Linux, only files with hardlink count == 0 will be deleted

Use ls -l to see the number of hard links to a file

In day-to-day work, hard links to files are rarely established

Pack and compress

Packing and compression is a way of backing up files in daily work

In different operating systems, the commonly used packaging and compression methods are different

Windows commonly used rar

Mac commonly used zip

Linux commonly used tar.gz

pack/unpack

tar is the most commonly used backup tool in Linux . This command can package a series of files into a large folder, and can also restore a packaged large file into a series of files

The command format of tar is as follows:


Description of tar options:


Note: the f option must be placed at the end, the order of other options can be arbitrary

compress/decompress

gzip

The combination of tar and gzip commands can be used to package and compress files

tar is only responsible for packaging files, but not compression

Use gzip to compress the tar-packed file, and its extension is generally xxx.tar.gz

In Linux, the most common compressed file format is xxx.tar.gz

There is an option -z in the tar command to call gzip, so that the functions of compression and decompression can be easily realized

The command format is as follows:



bzip2

tar can be used in combination with the bzip2 command to package and compress files (same usage as gzip)

tar is only responsible for packaging files, but not compression

Use bzip2 to compress the tar-packed file, and its extension is generally xxx.tar.bz2

There is an option -j in the tar command to call bzip2, which can facilitate the implementation of compression and decompression functions

The command format is as follows:


Software Installation

Install/uninstall software via apt

apt is Advanced Packaging Tool, an installation package management tool under Ubuntu

Most software installations/updates/uninstalls are done using the apt command

Enter apt directly in the terminal to view the help information of the command

Commonly used commands are as follows:

1. Install the software

$ sudo apt install software name

2. Uninstall the software

$ sudo apt remove softwarename

3. Update the list of available packages

$ sudo apt update

4. Update installed packages

$ sudo apt upgrade

5. Dependencies between associated software

$ sudo apt -f install

deb installation format

deb is the installation format of Debian Linux, which can also be used in ubuntu. To install the deb installation package, you need to use the terminal command dpkg. The command format is as follows:

$ sudo dpkg -i <package.deb>

Configure software sources

If you want to install software in ubuntu faster, you can provide software download/installation services by setting the mirror source and selecting a server with faster access to the Internet

The so-called mirror source means that the content of all servers is the same (mirror), but depending on the location, the domestic server is usually faster!


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325713135&siteId=291194637