≡ Menu

find command

How to copy a single file to multiple directories in Linux or Unix

If I want to copy a single file into three locations (directories), by using a single cp command (e.g. cp file /dir1/ /dir2/ /dir3/. Would that be possible? If yes, please provide the command for GNU/Linux or Unix operating systems.
[click to continue…]

How to check the file size in Linux/Unix bash shell scripting

I am a new bash shell scripting user. How do I find out the size of a file in my bash shell script and store this file size in a bash shell variable?
[click to continue…]

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…]