Questions tagged [files]

Organized data encoded in a pre-defined format and stored on a filesystem.

In the computational sense, one-dimensional array of bytes stored in a filesystem, typically encoded a pre-defined format, often indicated by a file-extension or "magic number". More "durable" than in-memory storage.

668 questions
328
votes
18 answers

Copying a large directory tree locally? cp or rsync?

I have to copy a large directory tree, about 1.8 TB. It's all local. Out of habit I'd use rsync, however I wonder if there's much point, and if I should rather use cp. I'm worried about permissions and uid/gid, since they have to be preserved in the…
Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
117
votes
8 answers

How do I create a symbolic link in Windows?

Windows Vista added the ability to create symbolic links to files and directories. How do I create a symbolic link and what are the current consumer and server versions of Windows that support it?
cowgod
  • 3,460
  • 6
  • 27
  • 20
99
votes
10 answers

How do I do Multihop SCP transfers between machines?

I want to copy a file from my machine A to server C, but only have access to server C through server B. Instead of first transferring to server B, log in and then transfer to server C, Is is possible to transfer the file directly with SCP or similar…
sverrejoh
  • 1,091
  • 1
  • 8
  • 4
94
votes
3 answers

Perform rsync while following sym links

I have a directory that contains symbolic links to other directories located on different media on my system: /opt/lun1/2011 /opt/lun1/2010 /opt/lun2/2009 /opt/lun2/2008 /opt/lun3/2007 But the symbolic links show up…
ensnare
  • 2,132
  • 6
  • 23
  • 39
91
votes
9 answers

Linux - Is there a way to prevent/protect a file from being deleted even by root?

I have a very important file which an application in my workplace uses, i need to make sure it is not delete whatsoever, how can I do that?
user256033
77
votes
9 answers

How to make scp copy hidden files?

I often use SCP to copy files around - particularly web-related files. The problem is that whenever I do this, I can't get my command to copy hidden files (eg, .htaccess). I typically invoke this: scp -rp src/ user@server:dest/ This doesn't copy…
rascher
  • 1,056
  • 3
  • 13
  • 14
73
votes
3 answers

In Bash, are wildcard expansions guaranteed to be in order?

Is the expansion of a wildcard in Bash guaranteed to be in alphabetical order? I am forced to split a large file into 10 Mb pieces so that they can be be accepted by my Mercurial repository. So I was thinking I could use: split -b 10485760 Big.file…
Sled
  • 877
  • 1
  • 7
  • 11
60
votes
18 answers

Favorite rsync tips and tricks

The more I use rsync the more I realise that it's a swiss army knife of file transfer. There are so many options. I recently found out that you can go --remove-source-files and it'll delete a file from the source when it's been copied, which makes…
Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
57
votes
6 answers

Extracting files from Clonezilla images

Is there a way to browse Clonezilla images and extract individual files from them without restoring the whole image?
Ferruccio
  • 2,583
  • 2
  • 19
  • 10
53
votes
6 answers

How to move files between two S3 buckets with minimum cost?

I have millions of files in a Amazon S3 bucket and I'd like to move these files to other buckets and folders with minimum cost or no cost if possible. All buckets are in the same zone. How could I do it?
Daniel Cukier
  • 823
  • 1
  • 10
  • 18
46
votes
10 answers

Linux (mv or cp) specific files from a text list of files?

I have a directory of many files, something like 50,000 pdf's and other files on a server. I need to move specific ones to another directory. I can generate a list of the files that need to be moved either in csv or any other text format. What I…
Jestep
  • 633
  • 1
  • 6
  • 11
42
votes
2 answers

nginx split large configuration file

My nginx default configuration file is becoming huge. I'd like to split it to smaller config files, each including only one, maximum 4 locations to each file, so that I can enable/disable them quickly. Actual file looks like this: server { …
oliverjkb
  • 554
  • 1
  • 4
  • 10
41
votes
2 answers

How to delete .fuse_hidden* files?

I have small Linux server (Debian Squeeze) which runs a Samba server which is configured to share some folders with some windows machines. While trying to delete one of the directories from windows I received the "Cannot delete folder" error. I…
Lando
  • 565
  • 2
  • 5
  • 9
39
votes
6 answers

How to rename multiple files by replacing word in file name?

Replace ACDC to AC-DC For example we have these files ACDC - Rock N' Roll Ain't Noise Pollution.xxx ACDC - Rocker.xxx ACDC - Shoot To Thrill.xxx I want them to become: AC-DC - Rock N' Roll Ain't Noise Pollution.xxx AC-DC - Rocker.xxx AC-DC -…
holms
  • 1,464
  • 7
  • 20
  • 37
38
votes
6 answers

Move files to another directory which are older than a date

I am looking for a solution to move files that are year older from today. My log partition is getting full, but I can not remove them. They are needed for a long long time. Anyway one solution I came up with is: find /sourcedirectory -mtime 365…
cr0c
  • 1,116
  • 3
  • 15
  • 32
1
2 3
44 45