![]() ![]() The du command was designed specifically for this task: sudo du / -ha -threshold=50M For this task, we can add the du command to our list of likely suspects: du Let's say we would like to find all files larger than 50 MiB. Without the wildcard character ( *), the GNOME desktop Files application provides essentially the same information as the find command: Interestingly, even with the -e option, the locate command does not find the /run/blkid/blkid/tab.old file (whereas find does). In the following, the -i option ignores case: sudo locate -i *.old Note that the -iname option ignore case whereas -name does not. findīecause we're searching for all files, we use the sudo command to avoid permission errors and start the search from the root directory ( /): sudo find / -iname *.old In the following examples, we'll search for all files with the. You can produce analogous results using the GNOME desktop environment: Using the recursive -R option allows the standard ls command to produce similar results: ls -Rlha To resolve this issue, you can update the database with sudo updatedb (which might take some time) or use the -e option that only lists files existing at the time the locate command is run (essentially equivalent to find): locate -e * ls Recently modified files may not be reflected in the database. ![]() The speed of locate comes at a price, however. The locate command is similar to find but requires a pattern (the wildcard character in this case): locate * The unadorned find command recursively list all files from the current directory: find To list all files from the current directory down, the following commands may be used: find To learn how to access your remote Ubuntu computer using GNOME, see Using Windows Remote Desktop with Ubuntu 20.04 TLS. Additionally, the desktop environment examples are based on GNOME. The locate command can be installed as follows: sudo apt install mlocateīecause everything in Unix-like operating systems, including Ubuntu, is considered a file, the term "file" will also indicate "directory" unless otherwise called out. The locate command is often faster than find because it maintains a database of all files which is updated every 24 hours. Note that one of the command we'll use is locate, which does not natively come with Ubuntu. We'll also go over how to run one or more commands on each file found. old extension or finding all files and directories larger than 2 GB. ![]() In this tutorial, we'll go over a number of methods for finding files and directories (i.e., folders) in Ubuntu 20.04 LTS, such as finding all files with a. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |