Use this tag for questions about file management and operations on files.

learn more… | top users | synonyms (1)

5
votes
1answer
124 views

How to list sample of files from a directory

I have a directory that contains hundred thousands of files. I need to list sample of these files (example 10 files), without processing all the files found in the directory which will take too much ...
18
votes
1answer
20k views

How to skip “permission denied” errors when running find in Linux? [duplicate]

Possible Duplicate: How do I remove “permission denied” printout statements from the find program? When I run this command in Linux (SuSE): find / -name ant I get many error ...
8
votes
1answer
1k views

Does inotify fire a notification when a write is started or when it is completed?

Imagine two processes, a reader and a writer, communicating via a regular file on an ext3 fs. Reader has an inotify IN_MODIFY watch on the file. Writer writes 1000 bytes to the file, in a single ...
8
votes
2answers
952 views

How do I append text to a write protected file [duplicate]

Possible Duplicate: Redirecting stdout to a file you don't have write permission on I am trying to append a line of text to a write protected file. I tried to accomplish this with sudo ...
3
votes
3answers
1k views

How to delete a file with multiple colon signs in its name?

I have a folder with so many files whose name has multiple colon signs. For example: Mail::Message::Field::Full.3pm.gz. I wonder how to delete them. I have tried rm ...
3
votes
2answers
13k views

Display a file's history (list of users that have modified a file)

Is there a command to display a list of users who modified a file providing a file history? I know that possible with svn/git etc.. but we have a config file that is not in SVN and someone modified ...
1
vote
1answer
418 views

wdfs mount problem

I'm running Fedora/Gnome 3.4.2 64bit and I'm trying to mount a webdav file system to work with. As root, I run the command #mkdir /mnt/webdav #wdfs https://www.webiste.com:port/directory ...
14
votes
2answers
2k views

What happens when you read a file while it is overwritten?

Suppose I read (cat) a file while another process is rewriting its contents. Is the output predictable? What would happen?
11
votes
5answers
16k views

Find the total size of certain files within a directory branch

Assume there's an image storage directory, say, ./photos/john_doe, within which there are multiple subdirectories, where many certain files reside (say, *.jpg). How can I calculate a summary size of ...
1
vote
3answers
5k views

Changing file associations in GNOME?

This blog post talks about how to change the default application to handle a file type in Nautilus for individual file types (right-click on the file, "open with", and select the new default ...
2
votes
3answers
2k views

How do I mass-convert the “last modified” dates in a particular directory?

For example, say, I know that my time-offsets are off by several hours (perhaps because my system clock was a few hours ahead at a certain time). In that case, how would I mass-change the "last ...
7
votes
1answer
6k views

How to change the default program for a specific file extension system-wise in kde or xfce?

I'd like to have certain file extensions to be opened with some specific programs. What are the files the edit ? I have found in /usr/share/appplications/default.list but it doesn't work.
-8
votes
3answers
206 views

File name in file system [closed]

I have a strange question about file system in Unix. Why isn't it possible to give the same name to two files under same directory ? Wouldn't it be possible to use IDs to differentiate between ...
5
votes
6answers
3k views

Strange case: Text file that exist and doesn't exist

I'm completely puzzled about a problem with a single plain text file in my system fedora 12. I used a known software in bioinformatics, maker, to produce lots of plain text files and one of them it ...
0
votes
3answers
493 views

Open file from particular position?

I was wondering, if you had a particularly large file, saying 64 MB, is it possible to figure out the physical hard drive location of the file, and then read bytes from a particular offset into the ...
0
votes
0answers
107 views

Real copy to Android device

When i copy files to the Android phone, they are copied to some cache, but they aren't written. I don't like it, because i don't know what is done. I've tried these methods: copying via thunar file ...
3
votes
3answers
109 views

How to include program which only works with in/out files into a pipeline?

I need to process image with several tools in a pipeline tool1 | tool2 | tool3 | .... It appeared though that one of the tools isn't designed to work in a pipeline and only works in format of ...
2
votes
1answer
207 views

No KDE: how to use strigi to index my files?

I'm not running KDE4 , but how can I use strigi to index my documents manually ? I already have strigi installed , but don't know how to utilize it.
3
votes
3answers
6k views

How to find executable filetypes?

I want to find file types that are executable from the kernel's point of view. As far as I know all the executable files on Linux are ELF files. Thus I tried the following: find * | file | grep ELF ...
7
votes
4answers
13k views

Is it possible to compress a very large file (~30 GB) using gzip?

Is it possible to compress a very large file (~30 GB) using gzip? If so, what commands, switches, and options should I use? Or is there another program (preferably one commonly available on Ubuntu ...
2
votes
2answers
376 views

find command for the newest 500 files in a directory tree and also be POSIX compliant

I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.
5
votes
1answer
145 views

Can non-canonicalized forms of filesystem paths be significant? (eg. “foo//bar”, “foo/./bar”, and “foo/../bar”)

I have a script for building a particular flavor of GCC cross-compiler. Throughout the script there are many paths that are not in canonical form, such as duplicate path separators (/xxx/foo//bar/yyy) ...
3
votes
2answers
2k views

how to find offset of one binary file inside another?

I have two binary files. One of few hundreds kilos and other of few gigabytes. I want to know whether the whole, smaller, file is contained within the larger one and if so then what is the offset from ...
4
votes
3answers
2k views

Recursively list files with file names, folder names and permission in CentOS

Is there anyway I can list files by typing a command in the shell which lists all the file names, folder names and their permissions in CentOS?
1
vote
1answer
246 views

Reclaiming space from one filesystem to give it to another without LVM

I want to add one file system space to another file system. /dev/cciss/c0d0p2 152358920 143606116 888588 100% /db2 /dev/cciss/c0d0p15 203899764 50767420 142607764 27% /db2/ade/sapdata1 ...
1
vote
1answer
200 views

Magic file that redirects to standard output

Is there a magic file name that gives the following effect? $ mkfifo /tmp/fifo1 && cat /tmp/fifo1 & $ foo --log-file /tmp/fifo # now I can see the log as the program runs I want ...
3
votes
1answer
426 views

How do I transfer files to a SunOS server via sftp with FileZilla?

According to the admin of the webserver, I should be able to use Filezilla to transfer files to the server but I am getting an error. I set up Filezilla for transferring files sftp - using these ...
9
votes
3answers
384 views

Stacked filesystems with write-back

I need to setup a system where a laptop and a desktop computers coexist. The idea is, I bring the laptop into the network and the laptop syncs the /home directory( with some exceptions) with the ...
1
vote
2answers
580 views

Remove first instance of lines with duplicate field value

I have sha1 summed all the image files on my storage server and put the results in a text file in the form of: sha1sum filename I've sorted the file and removed all all unique sha1sum entries. So ...
0
votes
1answer
2k views

last modified with grep

I'd like to make a list to stdout of the files modified in the last two hours in the . directory using grep. It has to be automatic (can't ask user what time is it or similar stuff) and I have to use ...
23
votes
2answers
89k views

Where are Apache file access logs stored?

Does anyone know where file access logs are stored, so I can run a tail -f command in order to see who is accessing a particular file. I have XAMPP, which is an Apache server installed on my machine, ...
4
votes
1answer
2k views

Adding bindings for ed2k:// links with xdg-open?

I want to use a customized program to handle "ed2k://" links , it already got a "*.desktop" file , but how can I bind it with xdg-open as the default handler ? Since I don't know the exact mimetype ...
3
votes
1answer
2k views

See if file has been copied to USB

Is there a way to see if a file has been copied to an USB drive? (Ex: I have the file secret.db and I suppose that my friend has copied it into his USB drive. With stat $filename I cannot see the ...
1
vote
1answer
2k views

Get list of Linux files recursively and direct output to file

I'm configuring software on Ubuntu for i2b2, and trying to find all of the relevant files on a CentOS image that I downloaded (path below) and am now running on Windows VMWare Player (free for ...
4
votes
2answers
318 views

Job to keep a count of XML files

My friend works in a IT company where he is required to keep a count of XML files inside a directory (including subdirectories). However the count using ls -LR | grep .xml or similar takes a lot of ...
1
vote
1answer
952 views

How to install/setup psftp in open suse linux?

I'm a newbie in linux. we need to do a file transfer from an open SUSE Linux server to a Windows server and vice versa. We are required to use psftp for the file transfer. Can anyone tell me how to ...
12
votes
4answers
4k views

Creating an arbitrarily large “fake” file

I would like to create a special file similar to /dev/null or /dev/random, where the file doesn't actually exist but you can read from it all the same, except that I could actually set a cap on the ...
2
votes
2answers
2k views

Size of data that can be written to / read from sockets

I was wondering if there is an easy way to find the maximum size that is supported by Linux sockets? (Is this configurable? If so where?) For example, most of the socket examples found on the web ...
3
votes
3answers
411 views

Regarding separate a single file into multiple files according to line separation

Currently, I have a plain text file, A, such as lowest priority very high significance. outstanding very novel In this file, every line contains a sentence. I want to separate this file into ...
5
votes
3answers
4k views

Understanding character device (or character special) files

I am trying to understand character special files. From wikipedia, I understand that these files "provide an interface" for devices that transmit data one character at a time. My understanding is ...
1
vote
1answer
179 views

How to get a list all the “aliases” of a file (including of type directory) efficiently?

How can one get the list of all the aliases of a file (including of type directory) efficiently, given that a file: may have multiple hard links, multipe soft links, multi-level soft links may be ...
2
votes
2answers
905 views

How can I get entries for a given time period from a 400MB+ log file?

I have a 400MB+ Tomcat log file (catalina.out). How can I pull out entries for a given time period?
6
votes
3answers
15k views

How do I remove multiple files with a common prefix and suffix?

I have many files named sequence_1_0001.jpg sequence_1_0002.jpg sequence_1_0003.jpg ... and files named sequence_1_0001.hmf sequence_1_0002.hmf sequence_1_0003.hmf ... and files ...
29
votes
12answers
44k views

Efficiently delete large directory containing thousands of files

We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something ...
12
votes
4answers
965 views

Drop a specific file from the Linux filesystem cache?

I know I can drop everything from the Linux filesystem cache, but is there a way to drop just one specific file? Or prevent a file from being cached? Or tell a process not to cache any files it ...
7
votes
1answer
326 views

How can I split Openbox `rc.xml` into multiple files?

I don't like big text configuration files. So, I would like to split my rc.xml file into multiple files: rc.xml rc.keyboard.xml rc.mouse.xml
1
vote
0answers
167 views

Editing images with sips doesn't work without being executed directly from Terminal? [closed]

I made a cheesy application with a bash script using CocoaDialog, and within this application I need to modify the size of a photo. So, I researched a little and found the sips command; and it works ...
3
votes
2answers
5k views

Move huge number of files into date structured directory order

I have about 1 million files in this directory: /home/username/images/ Each of the files are called something like: 012345678910(Place)_0_20120414185957_28841.jpg with the timestamp part of the ...
2
votes
1answer
53 views

Writing To Disk Before Install

I burned Pinguy to a disk, and loaded the disk. If I create files, then save them, but don't install Pinguy, and then take out the disk, will those files be gone the next time I boot from the disk, or ...
22
votes
4answers
10k views

How to properly and easy configure `xdg-open` without any enviroment?

I'm using OpenBox window manager without any desktop enviroment. xdg-open behaves strangely. It opens everything with firefox. $ xdg-settings --list Known properties: default-web-browser ...