Main Menu

friends

Banner

Latest articles

NASA: 2012: Beginning of the End or Why the World Won't End?
18/11/2009 | mad mad mod

  NASA F.A.Q. about 2012: http://www.nasa.gov/topics/earth/features/2012.html     


find files not owned by any user or group
29/12/2009 | mad mad mod

  From time to time you should check your systems for files not owned by any user or group. Every file on a system should have a valid owner (user and group).  The command to search for [ ... ]


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