Main Menu

friends

Latest articles

XEN DomU configuration files
12/05/2009 | mad mad mod

The Basics
XEN uses 2 different native configuration file formats. The "old" one is S-expressions (sexp) which is usualy used for configuration files in /var/lib/xend/. The default file ending is ".exp [ ... ]


Install mysql for Apache (Fedora 12)
01/04/2010 | mad mad mod

Prerequisites:Apache and php is already installed (see http://www.madmadmod.com/sysadmin/16-setting-up-a-very-simple-apache-webserver-on-linux-fedora.html and http://www.madmadmod.com/sysadmin/52-inst [ ... ]


Other Articles
Facebook MySpace Twitter Digg Delicious Stumbleupon Google Bookmarks 

Designed by:
SiteGround web hosting Joomla Templates
how to copy hidden files from one directory to another E-mail
sysadmin

Let's assume that you have a directory "test" containing the following files:

 

 

[root@blackmod test]# ls -la
total 8
drwxr-xr-x.  2 root root 4096 2010-03-10 06:11 .
dr-xr-x---. 11 root root 4096 2010-03-10 06:13 ..
-rw-r--r--.  1 root root    0 2010-03-10 06:11 file1
-rw-r--r--.  1 root root    0 2010-03-10 06:11 file2
-rw-r--r--.  1 root root    0 2010-03-10 06:11 .hidden

 

If you want to copy all 3 files to /tmp/ you have to use 2 commands:

 

1 to copy all visible files:

 

[root@blackmod test]# cp -v /root/test/* /tmp/
`/root/test/file1' -> `/tmp/file1'
`/root/test/file2' -> `/tmp/file2'

 

and a second command to copy all hidden files (files which start with a '.'):

 

 

[root@blackmod test]# cp -v /root/test/.* /tmp/
cp: omitting directory `/root/test/.'
cp: omitting directory `/root/test/..'
`/root/test/.hidden' -> `/tmp/.hidden'

 

 

A much easier way to do that is to set the "dotglob" shell option:

[root@blackmod test]# shopt -s dotglob

{chilicode}

 

--> If  set, bash includes filenames beginning with a ‘.’ in the results of pathname expansion.

{chilicode}

[root@blackmod test]# cp -v /root/test/* /tmp/
`/root/test/file1' -> `/tmp/file1'
`/root/test/file2' -> `/tmp/file2'
`/root/test/.hidden' -> `/tmp/.hidden'

 

 

 

 

 

Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

 
mad mad mod, Powered by Joomla! and designed by SiteGround web hosting