The rsync program is used for synchronizing files over a network or local disks. To view or display only hidden files with ls command:
ls -ld ~/.??*
OR
ls -ld ~/.[^.]*
Sample outputs:
In this example, you used the pattern .[^.]* or .??* to select and display only hidden files using ls command. You can use the same pattern with any Unix command including rsync command. The syntax is:
rsync -av /path/to/dir/.??* /path/to/dest rsync -avzP /path/to/dir/.??* /mnt/usb rsync -avzP $HOME/.??* user1@server1.cyberciti.biz:/path/to/backup/users/u/user1 rsync -avzP ~/.[^.]* user1@server1.cyberciti.biz:/path/to/backup/users/u/user1
In this example, copy all hidden files from my home directory to /mnt/test:
rsync -avzP ~/.[^.]* /mnt/test
Sample outputs:
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop







![Linux / Unix: Show Shares on NFS Server [ Shared Directories ]](http://s13.cyberciti.org/images/shared/rp/3/25.jpg)







{ 4 comments… read them below or add one }
Wouldn’t “.??*” leave out files like .a, .b, etc.?
Noop. Any details on ls version and Unix may help if you are not getting the same result.
root@node0 / # cd /tmp
root@node0 /tmp # ls -ld .??*
ls: cannot access .??*: No such file or directory
2 root@node0 /tmp # touch .a .b
root@node0 /tmp # ls -ld .??*
ls: cannot access .??*: No such file or directory
2 root@node0 /tmp # ls -ld .[^.]*
-rw-r–r–. 1 root root 0 Nov 11 23:07 .a
-rw-r–r–. 1 root root 0 Nov 11 23:07 .b
root@node0 /tmp # ls –version
ls (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Richard M. Stallman and David MacKenzie.
I love your website – Keep up the good work!