Tag: files

Backup, Sync

Move your files from anywhere to anywhere

Limagito FileMover moves your files from anywhere to anywhere. This file mover automation tool can copy, move or delete files that are added to a specific folder. You can set file and directory filters based on the file name, date and size. Also rename, encrypt or decrypt files and rename directories (using regular expressions) when …

Backup, Microsoft Windows, Sync

Windows Synchronize files and folders

SyncToy is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders. System Requirements > Microsoft .NET Framework v2.0 > 1GHz Intel P3 processor or equivalent > 256MB RAM, 512MB RAM recommended > 20MB free disk …

PHP

List files in directory – PHP

$dir = ‘/path/to/dir/’; if(is_dir($dir)) { if($handle = opendir($dir)) { while(($file = readdir($handle)) !== false) { if($file != "." && $file != ".." && !is_dir($file)) { echo $file.'<br>’; } } closedir($handle); } }$dir = ‘/path/to/dir/’; if(is_dir($dir)) { if($handle = opendir($dir)) { while(($file = readdir($handle)) !== false) { if($file != "." && $file != ".." && !is_dir($file)) …

Microsoft Windows, Python

List files and folders in a directory – Python

Let’s see an easy way to list all files and folders in a directory: import os   for filename in os.listdir("x:\mydir1\mydir2\"): print(filename)import os for filename in os.listdir("x:\mydir1\mydir2\"): print(filename) Open command line, change to the directory of your python file and issue the following command: python myfile.pypython myfile.py

Linux

Compare directories using diff in Linux

To compare two directories, we are going to use diff. diff dir1/ dir2/diff dir1/ dir2/ If you are not interested in file differences, add the -q parameter. diff -q dir1/ dir2/diff -q dir1/ dir2/ To search and compare recursively, add -r parameter. diff -qr dir1/ dir2/diff -qr dir1/ dir2/ To sort results use sort command. …

Ubuntu

Synchronize files with rsync

Installing rsync sudo apt-get install rsyncsudo apt-get install rsync Manual Syncing rsync -az –progress –size-only /home/username/dir1/* /home/username/destination/rsync -az –progress –size-only /home/username/dir1/* /home/username/destination/ or rsync -az –progress –size-only /home/username/dir1/* my.server.com:/home/username/destination/rsync -az –progress –size-only /home/username/dir1/* my.server.com:/home/username/destination/ -a archive mode -z compress file data during the transfer –progress show progress during transfer –size-only skip files that match in …

Linux, Ubuntu

List files with absolute path recursive in linux

Let’s see how we can list all files of a directory recursive in linux. First of all install tree command tool. For Ubuntu users just issue the following command: sudo apt-get install treesudo apt-get install tree List all files recursive: tree -if /path/to/directory/tree -if /path/to/directory/ explaining: -i Don’t print indentation lines. -f Print the full …