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

learn more… | top users | synonyms (1)

2
votes
1answer
252 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
614 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
542 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
76 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
0answers
246 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
55 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?
31
votes
6answers
13k views

Howto find duplicate files on disk

Is it possible to find duplicate files on my disk which are bit to bit identical but have different file-names?
3
votes
1answer
82 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
173 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
116 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
4answers
813 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
233 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 ...
1
vote
2answers
10k 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
185 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
254 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
360 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
72 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 ...
16
votes
3answers
20k 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 ...
0
votes
0answers
25 views

no such file or directory [duplicate]

I have a 64-bit Ubuntu and want to execute a 32-bit FreeRTOS binary. The error message says no such file or directory. The files are there I can read them with ls -l.
0
votes
1answer
261 views

how are directories implemented in UNIX filesystem?

This question is extension to How are directories implemented in Unix filesystems? I'm aiming to implement basic filesystem: After reading inode number and name we come to know Name of file and hence ...
1
vote
2answers
139 views

Merge a number of text files into one with next line for every file

I have 2 files. I want to merge them. File1 contents: abc File2 contents: def Combined File should be: abc def
0
votes
1answer
72 views

Rsync adding a “?” at the beginning of directories

I currently have many of these commands running in a .sh file that looks like this: rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup rsync -avz ...
1
vote
2answers
370 views

Cannot access any files Manjaro Linux

I cannot open any files on my Manjaro Linux laptop. I really can't remember why it happened but I restarted my computer and now I dont have read/write access to any folder or file even though I've ...
1
vote
2answers
333 views

A bunch of files have 777 permissions

I have been learning Python and Bash scripting, and I up to now I have given my scripts 777 permissions. Having learned more about how to set permissions, and knowing this is a bad idea, I ran the ...
4
votes
1answer
4k views

Better way to copy multiple directories to new directory

Is there a better way on the command line to essentially accomplish the following but with a single command cp -r css/ ar/ cp -r images/ ar/ cp -r js/ ar/ cp -r backups/ ar/ I've just been ...
5
votes
5answers
4k views

Delete files in directory without erroring if it's already empty

As part of a deployment script, I want to dump some cached stuff from my temp directory. I use a command like: rm /tmp/our_cache/* However, if /tmp/our_cache is empty (fairly common when pushing ...
3
votes
4answers
4k views

Piping output to text file within a for loop

I'm trying to do the following within a for loop: Find files that satisfy a condition Echo the name of the files to a log file. Gzip the file. I can get the script to find the files and echo their ...
12
votes
4answers
588 views

Is there a top-like command that shows the network bandwidths and file accesses of running processes

For example, we'd like to see: PROCESS IF TX RX FILE(regular) R/W prog1 eth0 200kB/s 12kB/s -- -- wlan0 12kB/s 100kB/s -- ...
20
votes
2answers
2k views

How do I make a file NOT modifiable?

While logged in, I can do the following: mkdir foo touch foo/bar chmod 400 foo/bar chmod 500 foo Then I can open vim (not as root), edit bar, force a write with w!, and the file is modified! How ...
4
votes
4answers
8k views

Move all files with a certain extension from multiple subdirectories into one directory

Suppose I have a bunch of zip files in several directories: Fol1/Fol2 Fol3 Fol4/Fol5 And I want to move them all to a common base folder. How would I do this?
0
votes
1answer
1k views

Log4j File Location

I have a Webapp running on an Amazon EC2 Linux AMI. I've been trying to configure my Log4J file for logging but haven't been able to figure out where the logs are getting created. This is my log4j ...
1
vote
1answer
42 views

Can one move a relpath in one command?

This question is similar to one I asked recently, but the answers to that question, for the most part, do not extend to this one, AFAICT. The main difference between the two questions is that the ...
2
votes
3answers
503 views

Create a virtual file that is actually a command

Is there any way to create a virtual file, such that reading from the file actually reads from the stdout of a command; writing to the file is acually writing to the stdin of a command? So far I have ...
2
votes
2answers
639 views

Can one copy a relpath in one command?

I find myself doing this often enough that I wonder if there's a standard Unix way to do it: % mkdir -p /TARGETDIR/relative/path/to % cp ./relative/path/to/somefile /TARGETDIR/relative/path/to In ...
1
vote
1answer
188 views

How to find undeletable files that were removed?

I just created a file: touch myFile Made it "undeletable": chattr +u myFile and removed it: rm myfile How can I get it back? What is the purpose of "u"? Is it used?
5
votes
1answer
1k views

`ls` command does not list latest directory contents

The Linux shell does not print up-to-date information when it comes to ls. For example I use my other processes (IDEs etc) to create some directories. However when I run an ls command I don't see ...
2
votes
2answers
189 views

Select greatest numbered filename

Simple requirement but can't find anything online which can achieve it. I have a list of dated files as below... filename_20120101.dat filename_20120102.dat filename_20120103.dat I ...
3
votes
2answers
744 views

How to write file into another

I have an empty file (only zeroes are in it) of size 9,0KB and I need to write another file (with size 1,1KB) to it, but the first file must not lose its size or the rest of its contents. So if the ...
0
votes
1answer
110 views

Debian VirtualBox Guest - Common Files to Remove for Space Saving?

I have created a VirtualBox guest using debian-6.0.7-amd64. I am using it as a clone template to create Java work nodes, so my needs are pretty much limited to the JVM, networking, SSH and the basics ...
2
votes
3answers
407 views

How does gcc handle file permissions?

The executable files that gcc creates have execution permissions -rwxrwxr-x which are different than the permissions that the source file has. -rw-rw-r-- How does gcc set these permissions ?
2
votes
1answer
2k views

Create sub-directories and organize files by date

I have some directories of files copied from my security camera that I would like to organize into sub-directories by file date. So for example; -rwxrwxrwx 0 root root 4935241 Jul 19 2012 ...
4
votes
4answers
636 views

Using GNU Parallel With Split

I'm loading a pretty gigantic file to a postgresql database. To do this I first use split in the file to get smaller files (30Gb each) and then I load each smaller file to the database using GNU ...
5
votes
8answers
2k views

Run a command on all subfolders

If you have a series of subfolders (like from a to z) and want to run a command on each one of them (like rm *.pdf or ls *.pdf), how do you do that? The "manual" approach would be cd a, rm *.pdf, or ...
1
vote
0answers
42 views

Existing file can not be found? [duplicate]

/usr/share/tipp10$ ll insgesamt 9408 drwxr-xr-x 3 myname ssl-cert 4096 Feb 26 20:07 ./ drwxr-xr-x 288 root root 12288 Feb 26 20:07 ../ -rwxrwxrwx 1 myname ssl-cert 9480 Okt 6 2010 ...
5
votes
3answers
144 views

Control how linux deletes files

What exactly happens when an application deletes a file? Is there any way to control this behavior? Basically I want to shred instead of rm in all cases, but of course applications do not make calls ...
1
vote
2answers
402 views

reading from a file and changing its pattern into an array?

I have a CSV file containging entries like this : ipaddress,VLAN,VLANid 10.192.168.1,vlan-xyz,3 10.192.168.1,vlan-abc,8 10.192.168.1,vlan-mnp,11 10.192.163.24,vlan-llz,3 10.192.163.24,vlan-bbz,5 ...
1
vote
4answers
84 views

How to find what device a file is on (and use that in a script)?

I want to find out what device my file is on so that I can use it in a script. I can get this far: $ df . Filesystem 512-blocks Used Available Capacity Mounted on /dev/disk0s2 498438976 ...
0
votes
2answers
487 views

What is sources.list?

I know sources.list is a file that contains a list of HTTP links pointing to some software downloads. I would like to know more detailed explanations and various conventions followed in the ...
2
votes
1answer
150 views

How can I identify the total files open by userid

Yesterday one of the users on our system had a poorly formed script that consumed all the space in one of our file systems. Through a lot of trial and error, I was able to identify the user and kill ...