makes sure not to skip children nodemodules credit: https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
a quick function for searching changed files. just copy it in the bash Show Sample Output
Compare the content of the files in the current directory with files of the same name in the duplicate directory.
Pop Quiz: You have a duplicate of a directory with files of the same name that might differ. What do you do?
You could use diff to compare the directories, but that's boring and it isn't as clever as find -print0 with xargs.
Note: You must omit stderr redirect 2>/dev/null to see the list of missing files from DUPDIR, if any.
Hint: Redirect stderr to a new file to produce a more readable list of files that are missing from DUPDIR.
Warning: This doesn't tell you if DUPDIR contains files not found in the current directory so don't delete DUPDIR.
Show Sample Output
Find and Convert all libre office files to PDF without libreoffice GUI Show Sample Output
This will allow you to ensure you don't get nagged by updates and also protects you from watering hole attacks! Please be sure to make sure your plugins don't have any security issues! Backups are manifext.jason.bak credit @Jay https://chat.counterpoint.info
Prints the path/filename and sparseness of any sparse files (files that use less actual space than their total size because the filesystem treats large blocks of 00 bytes efficiently). Uses a Tasker-esque field separator of more than one character to ensure uniqueness. Show Sample Output
It tries to identify the file types in a directory and adds or replaces them with their appropriate extensions. Please, update the "file" tool before use it (last version: 5.37): https://github.com/file/file
New objects cannot be assigned by reference. The result of the new statement can no longer be assigned to a variable by reference. Check the "Sample Output" example ("sample.php"). The Output of the above example in PHP 5: "Deprecated: Assigning the return value of new by reference is deprecated in sample.php on line 3". Output of the above example in PHP 7: "Parse error: syntax error, unexpected 'new' (T_NEW) in sample.php on line 3. Show Sample Output
find all files that have 20 or more MB on every filesystem, change the size and filesystem to your liking
Useful command for MySQL Show Sample Output
remove all files in /home/ folder that starts with bk_all_dbProdSlave and not created in the last 2 days
I can think of using this command after compiling an downloaded source from anywhere as an easy way to find all executable products.
We usually issue the
find
command (without arguments) to list the full paths of all directories and sub-directories and files in the entire current tree.
Similar command is
tree -aicfnF
Will delete empty directories and sub-directories (hideen too = whose names are starting with dot .). Used 'rm' command instead of 'rmdir' to give the possibility of asking for confirmation before deleting i.e. it is not wise do delete all empty directories in /etc folder. Replace dot in 'find .' with any for other starting directory instead of current. in 'rm -i -R' 'i' stands for ask before delete and 'R' for delete folder recursively or folder itself if it is empty
If you have two sets of files that may share hard-linked files, it can be useful to identify which ones are hard links to same underlying inode (file). This command shows you all of those, sorted by inode#. In my example the two directory trees to compare share a common parent, so I run the command in that parent and just use
find .
to start from the current directory. If yours are in different locations, you can pass both paths to find:
find /directory1 /directory2 -type f -printf '%10i %p\n' | sort | uniq -w 11 -d -D | less
Show Sample Output
Recursively compares files in directories DIR and OLD_FILES using dwdiff Word-by-word comparison with dwdiff results in words unique to NEW file versions in the DIR directory tree shown enclosed in [- SQUARE BRACKETS -] and words unique to OLD file versions in the OLD_FILES directory tree shown enclosed in {+ CURLY BRACES +} Note: does not detect files unique to the OLD_FILES directory tree. Show Sample Output
https://www.howtogeek.com/771399/how-to-use-the-find-command-in-linux/
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: