≡ Menu

file names

Linux: Find Out What Partition a File Belongs To

How do I find out that /users/f/foo/file.txt file belongs to a specific partition? How do I find out on what partition a file exits?
[click to continue…]

Lighttpd Configure Subdomain

I've main domain configured at http://example.com and I'd like to use http://support.example.com with different files. How do I add subdomain support with Lighttpd web server under UNIX or Linux operating systems?
[click to continue…]

Linux / UNIX: scp / rsync File Name With a Colon (:) In It

How do I copy a file with a colon punctuation (:) name in it. When I type the following command to copy "file:name.txt" to a remote host called server1:

scp file:name.txt user@server1:/path

I get the following error:

ssh: Could not resolve hostname s: Name or service not known

How do I copy file with scp or rsync with a colon in it?
[click to continue…]

UNIX: Loop Through Files In A Directory

How do I loop through files in a directory under UNIX like operating systems?
[click to continue…]

xargs: How To Control and Use Command Line Arguments

I am trying to use xargs command using shell pipes and not able to understand how to control and use command line arguments. For example I'd like to find out all *.c file located in 100s of sub-directories and move them to another directory called ~/old.src. How do I use command line args with xargs to achieve the same?
[click to continue…]

Solaris UNIX Case-Insensitive Find File Search

I'd like to match all filename like foo.c, FOO.C, fOO.c, Foo.C and so on using find command under UNIX. How do I do a case-insensitive find search under Sun Solaris / OpenSolaris UNIX systems?
[click to continue…]

Bash Shell Loop Over Set of Files

How do I run shell loop over set of files stored in a current directory or specified directory?
[click to continue…]

Find and Delete File If It Is More Than One Hour Old in UNIX Shell

Q. How do I find out file last modification time using a shell script or command? How do I delete or take any other custom action for all files more than one hour old in /home/ftp/incoming/raw/ directory?
[click to continue…]

vi / vim Auto complete File Name While Editing Files

Q. I use vi / vim as IDE (Integrated development environment) a software development system using Ubuntu Linux. How do I auto complete file name under vim / vi text editor while editing text file or java / c / python program? I can auto complete file nameunder bash shell by hitting [TAB] key.
[click to continue…]

Restore Selected Files From Secondary Backup Hard Disk

Q. I've backup created using rsync command stored at /disk2/home/tom/ directory. Accidentally, I had deleted files from /home/tom directory. I'd like to restore all file names starting with alpha numeric characters from /disk2/home/tom/ to /home/tom. How do I restore selected files in a batch mode?
[click to continue…]