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

learn more… | top users | synonyms (1)

5
votes
3answers
543 views

Dynamic file content generation: Satisfying a 'file open' by a 'process execution'

I have a read-only file, F. A program, P, that I'm not the author of, needs to read F. I want the content of F to come from another 'generator' program, G, whenever P tries to read F (taking F to ...
0
votes
1answer
48 views

Keyboard shortcut to switch files in one Emacs instance?

I've multiple files opened in an Emacs client. Right now, to toggle between files, I've to click on the file name at the bar below in the editor. Any keyboard shortcuts for switching between files?
20
votes
1answer
637 views

How to move a directory, file by file? (instead of “copy then remove”)

My computer has one 500GB drive. I want to move 400GB of data from /unencrypted to /encrypted. Both directories are on the same partition, but /encrypted is handled by ecryptfs, so mv /uncrypted/* ...
3
votes
5answers
6k views

Find and copy directories containing file type

I have a directory "Movies" containing subdirectories "Movie Name". Each subdirectory "Movie Name" contains a movie file and related image/nfo files etc. I'm trying to copy all directories containing ...
6
votes
1answer
3k views

how to keep file owner same for newly created files

This question is regarding samba file access. I have created a folder A, and under folder A created two folders B and C. And also created three users A, B and C. User A has access to all three ...
4
votes
1answer
251 views

Can I create a symlink that will ignore subdirectories?

I'm trying to get dropbox symlinked to the relevant folders in /home. I'd like to symlink them like this: ~/Dropbox/Pictures --> ~/Pictures ~/Dropbox/Camera Uploads --> ~/Pictures/Camera ...
1
vote
1answer
1k views

Getting back rsync's deleted files [duplicate]

I accidentally rsync-ed to a server using the delete attribute when I shouldn't have. Is there any chance of getting the data on the server that rsync removed.. back?
3
votes
3answers
6k views

How to move all files with a certain file extension from subdirectories to a single directory

I have a directory that contains many subdirectories. The subdirectories contain lots of types of files with different file extensions. I want to move (not copy) all the files of one type into a new ...
0
votes
3answers
881 views

Rm command recovery for this situation

İn my desktop, i have a dir. called exam, and i wanted to remove it from the console and wrote rm * /exam, and apparently it removed some other files from my desktop. Please tell me that there is a ...
1
vote
1answer
152 views

Standard I/O File Descriptors

I am new to Shell SCripting I code this $ ls -l 1> stdout.txt and I get the output as desired, 1> stdout.txt redirects the output from standard output to the file stdout.txt. I don't ...
3
votes
2answers
146 views

Search by file dimension [duplicate]

I have many photos. How to search files by its dimensions? For example, i want to search images with exact dimensions 500 x 500 pixels. Is there any utility for this task?
1
vote
2answers
159 views

Single process accessible temporary file

I want to create a file that is only accessible to the process that created it (and potentially its children), and that disappears when the process exits, ideally never persisting the file to disk. As ...
3
votes
2answers
1k views

How does Linux know the Location of File Data on Disk

related to: What is a Superblock, Inode, Dentry and a File? None of the famous metadata structures hold onto to location data for the actual file. Dentry maps names to inodes, and inodes store ...
0
votes
2answers
680 views

Redirecting stdin with stdout to file

So I have a program that takes in user input and outputs text based on the input. EDIT2: I want to create a script that runs a C executable and the script feeds the C program input from a file and ...
7
votes
2answers
2k views

How to upgrade shared library without crash?

Here it says that you can rewrite an executable file and the process will run just fine - it will be re-read when a process restarts. However, when I try to replace a binary file while the process is ...
27
votes
2answers
2k views

Why does a software package run just fine even when it is being upgraded?

Say I am running a software, and then I run package manager to upgrade the software, I notice that Linux does not bring down the running process for package upgrade - it is still running fine. How ...
0
votes
1answer
332 views

LINUX: Permissions for files: Identify if it is a file or directory, and its access allowed to the world, user, and group [duplicate]

I am having trouble understanding permissions for directories and files in LINUX. By examining permissions for each of the following files, identify if it is a file or directory, and describe the ...
6
votes
1answer
178 views

find is missing a result — how is that possible?

What conditions explain this output: root@ip:/# find / -name "server.xml" -print /etc/tomcat7/server.xml root@ip:/# ls /var/lib/tomcat7/conf/server.xml /var/lib/tomcat7/conf/server.xml I am ...
4
votes
3answers
86 views

Replace all the occurences of a term in the files contained in a folder

In a folder on my system, I have a C++ project that I'm trying to compile. This process uses some C++ idioms which are not supported by my compiler version. In particular, often inside the code it is ...
8
votes
4answers
686 views

How do I stop the root user from deleting a file?

I'd like to know if I can prevent the root user from deleting a file. Is it possible?
3
votes
1answer
149 views

Program for identifying files from unfinished torrent-downloads?

Are there any programs that can help identify files and directories belonging to unfinished bittorrent-downloads? I've made a mess, and I'm unsure of which downloads are finished and which are not. ...
2
votes
3answers
260 views

Any programs suitable for making a database over disk-content?

I have quite a lot of external hard-drives, and often have a hard time finding what I'm looking for - not to mention not storing the same file several times on different drives or finding free space ...
3
votes
3answers
200 views

file mass deletion

I would like to delete all the txt, xls,pdf files in a directory as well as its sub directories. I would like to save everything else. find . -type f ! -iname '*.xml$,.png$,.jpeg$,.gif$,' -delete ...
4
votes
2answers
816 views

How can I backup a directory to NTFS while preserving Unix file attributes?

I want to make a backup of my home directory to an NTFS partition (an unfortunate limitation). However, when I last tried using just cp, the attributes (owner, etc) went away. How can I make a backup ...
0
votes
1answer
595 views

Transfer 150GB of files from an old MacBook Pro with Ubuntu 13.04 Live DVD

My girlfriend's old MacBook Pro 2009 (5,4) stopped working. I have tried several times to reinstall OS X, but could not do so. There appears to be something really really wrong with the OS. Since she ...
2
votes
1answer
1k views

“rm -rf Filename.iso ” Permission denied

Hi I am facing an issue while deleting an .iso file from Linux x86_64 GNU/Linux. Here are the permissions for the file: # ls -lrt -rwxrwxr-x 1 dev devgrp 2687934464 Apr 12 14:13 ...
0
votes
1answer
37 views

File inventories and logrotation

I want to collect a huge amount of data files on my actual netapp storage with the command file - f /path... > logfile.txt. Through the huge data amount, the size of the logfile will be critical. ...
1
vote
1answer
36 views

Back up snapshots without being admin

I would like to make a back up/snapshot of a folder where I have built various programs (~4.1 GB in size). The idea is to be able to quickly restore everything in this path to it's original state in ...
0
votes
1answer
166 views

Searching for multiple files and changing file extension [duplicate]

I want to search and identify multiple files, within a directory, having a particular file extension (.txt) and changing the extension to (.fasta). This is considering not changing the file itself, ...
2
votes
1answer
2k views

Download files and create same file structure as the source

I have a config file which consists of list of URIs I want to download. For example, http://xyz.abc.com/Dir1/Dir3/sds.exe http://xyz.abc.com/Dir2/Dir4/jhjs.exe http://xyz.abc.com/Dir1/itr.exe ...
2
votes
2answers
5k views

How to scp/tar files that are in between specific days?

I need to copy db log files between two suse servers where I am interested in files ONLY in between 10.3.2013 - 13.3.2013 It is desired to compress the files before copying so I tar them and scp. ...
2
votes
1answer
382 views

Unable to preserve ownership in a copy but able with a move?

I have noticed that I am unable to preserve ownership if I rsync -o files. However, I am when I move them. This is all without admin privileges. What is the rationale of this? Several threads e.g. ...
0
votes
1answer
984 views

Create link to folder in Elementary-OS

When I used to use stock Ubuntu, you could create links to folders and put them in other folders. How can I do this in elementary 0.2?
1
vote
4answers
3k views

Is there a command to list files, exclude sub-directories and display size and date?

Before I begin please assume I have only basic knowledge in UNIX. Basic meaning I have only started reading about it since last week for a work related purpose. I have been experimenting with the ls ...
2
votes
2answers
1k views

Delete whitespace in filenames in directory

I have a directory where some filenames have been wrongly named something .pdf rather than something.pdf. Is there a quick one liner I can use to delete the whitespace in the filenames. I have tried ...
1
vote
4answers
82 views

Is there a robust way to cache contents of usb on local hd?

I'd like to switch between working on a laptop with a debian vm and a desktop pc running debian while carrying all my work files in a usb. Is there a robust way to automatically start caching the ...
1
vote
1answer
385 views

Apache created files and its permissions for CentOS 6.x

In short, I have an authenticated HTTP-POST that: posts a jpg image (created as 666 apache:www) into /directory1 (777 ftpuser:www) creates /directory2 (created as 666 apache:www) in a 777 ...
1
vote
1answer
63 views

Quota utilities

Are there any command line utilities that make it easier to read quotas (e.g. showing percentages, approximate size in MB, etc.). Perhaps something like what htop does for top, but for quota?
40
votes
6answers
21k views

Find duplicate files

Is it possible to find duplicate files on my disk which are bit to bit identical but have different file-names?
3
votes
1answer
131 views

Copy file permissions from user to group

I have a folder with some files, which each have different permissions. Some are read-only, some are read/write, some are read/execute. How can I copy the permissions from user to group, so that for ...
1
vote
2answers
259 views

How to strip directory structure with command line (or script)

I have a large collection of files packed into a two-level directory structure with many, many, many folders. In other words, I have a folder with a great many subfolders in it. There are no ...
2
votes
1answer
135 views

View temporary files which exist for milliseconds

I'm trying to debug a program which is not logging the information I need. Fortunately, it does write temporary files which should contain the information. These files are written to a directory like: ...
3
votes
5answers
2k views

How to count recursively for the number of files in several directories?

I have a directory, containing a lot of files and directories. I am trying to get the number of files (and directories) contained recursively in every directory. I tried the following approach: for ...
2
votes
5answers
536 views

Create and open file with one command?

I want to create a text file and open it in a text editor with a single command. I know touch file.txt creates a file and open file.txt opens the file, but is there a way to do this with a single ...
2
votes
2answers
19k views

BASH reading txt file and storing in array

I'm writing my first BASH script , I have some experience with c and c# so I think the logic of the program is correct..it's just the syntax is so complicated because apparently there are billions of ...
2
votes
3answers
209 views

What has happened to the file when I entered “mv file.txt ../”?

I wanted to move 'file.txt' one folder up, but instead of mv file.txt ../file.txt I entered mv file.txt ../. Now the file is gone and I didn't get any error message. So it seems the some action was ...
1
vote
2answers
319 views

Merge chunks from multiple files

I need to merge chunks from a few but large files. Each line contains the file name and byte offsets. # file begin end foo/a 11970 12010 foo/a 22995 23035 foo/b 45090 45130 foo/b ...
8
votes
2answers
573 views

Cleaner way to delete files on Linux which include a datestamp as part of file name

I have a new requirement to purge MySQL dump files that are older than 30 days. The files use a naming convention of "all-mysql-YYYYMMDD-HHMM.dump". The files are located on SAN mounted file system, ...
1
vote
1answer
107 views

Error writing /home/alessiomtx/.config/tint2/tint2rc: Not a directory

I need to edit my ~/.config/tint2/tint2rc because the file is blank and so I don't have tint2 shown in my desktop, but when I try to save I have this error: [ Errore durante la scrittura di ...
25
votes
3answers
42k views

Find and remove large files that are open but have been deleted

How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open? The situation is that we are running a ...