≡ Menu

find command

Linux: Bash Delete All Files In Directory Except Few

I'm a new Linux system user. I need to cleanup in a download directory i.e. delete all files from ~/Downloads/ folders except the following types:

*.iso - All iso images files.
*.zip - All zip files.

How do I delete all file except some in bash shell on a Linux, OS X or Unix-like systems?
[click to continue…]

Linux / Unix: Find And List All Hidden Files Recursively

I am a new Unix system shell user. I need to find and list all hidden files including directories on a Linux or Unix-like system. How can I recursively list all hidden files and directories? How do I save result in a text file?
[click to continue…]

Unix / Linux: Check New Files In File System /var/www/uploads/

Recently, I switched from MS-Windows based web-server to CentOS Linux based Apache web-server. All user uploaded files are stored in /var/www/uploads/ directory. Is there command that can give me a list of files that have been added to the filesystem at /var/www/uploads/ in last 7 days on Linux/Unix-like oses?
[click to continue…]

HowTo: Find a Directory On Linux Based System

I just switched from MS-Windows server admin to Debian Linux server admin role. I need to find a directory called project.images. I was also told that the locate command is the simplest and quickest way to find the locations of files and directories on Linux. But, the locate command is not working out for me. How do I find project.images directory using command line options only?
[click to continue…]

Bash: .* Considered Harmful To Match Dot Files. Why?

How do I match dot files under Unix / Linux using bash shell? Why .* considered as harmful when matching dot files under bash shell?
[click to continue…]

Linux / Unix Find Command: Avoid Permission Denied Messages

When I type find . -type d -name "foo" command I get Permission denied error messages. How do I exclude all "permission denied: messages from the find command under Linux or Unix like operating systems?
[click to continue…]

Linux / Unix: Find Files Modified On Specific Date

How do I find out all files that have been modified on 2013-02-07 (07/Feb/2013) using find command under Linux / Apple OS X / *BSD and Unix like operating systems?
[click to continue…]

I am login to a remote server using a ssh client. I am annoyed with the arrow key behavior during insert mode in Vim. As soon as I hit arrow keys, vim display A B C D on screen. How do I fix this problem under Linux, FreeBSD, OpenBSD, NetBSD, Apple OS X or Unix-like operating systems? How can I fix arrow keys that display A B C D on remote shell?
[click to continue…]

Linux / Unix: Find and Delete All Empty Directories & Files

How do I find out all empty files and directories on a Linux / Apple OS X / BSD / Unix-like operating systems and delete them in a single pass?
[click to continue…]

Linux / Unix: Find Hidden Directories, Files and Folders

I'm a new Unix user and trying to find the hidden directory called .movies but I do not know where it is on the file system. How do I find a hidden folder or directories under Unix like operating systems?
[click to continue…]