Questions tagged [files]

Manipulating files: copying, renaming, searching, analyzing, archiving, etc. For operating on text in a file, see /text-processing. For questions about the Files file manager (formerly Nautilus), see /nautilus.

488 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
13
votes
0answers
236 views

I accidentally backed up /proc/* , and now I'm stuck with a 28Tb file called “cifs2695” that I can't remove!

Recently my boss asked me to backup a Ubuntu 16 workstation.I wanted to preserve all the libraries and system files, since we have C++ code that can only compile on that particular machine. Being lazy,...
8
votes
0answers
135 views

Examining which files are dirty or buffered in Linux

$ cat /proc/meminfo | grep Dirty Dirty: 2396 kB How do I view in which files (at least as a mountid:inode pairs) are those 599 dirty pages located? $ cat /proc/meminfo | grep Cached ...
7
votes
1answer
216 views

group member unable to write to a group-writable file with reiserfs and extended ACLs

Users vi and rust share group rust and want to use some file in shared manner. rust$ ls -l myfile -rw-rw-r-- 1 vi rust 0 May 30 03:48 myfile rust$ stat myfile | grep Gid Access: (0664/-rw-rw-r--) ...
5
votes
0answers
441 views

Find number of duplicate file descriptors on Linux

Given a file descriptor, is there a way in Linux to find out how many other file descriptors refer to the same file description (i.e. how often dup was called, not how often open was called)? I do ...
5
votes
0answers
5k views

`crontab -e` sometimes fails with “Creation of temporary crontab file failed”

From time to time crontab -e fails on me on a Ubuntu box. It is the same for all users including the root and crontab -eu <user> under the root. Goes like this on a regular basis, a success here ...
4
votes
0answers
70 views

What is the Linux file dirty page write back order

In Linux, for a single file what is the dirty page write back(to disk) order? Is it from beginning to end or out of order ? Scenario 1 : without overwrite A file(in disk) is created and large amount ...
4
votes
0answers
105 views

no such file or directory trying to list or remove file in btrfs

I have a file system mounted btrfs. I have one directory in particular, that I can't remove, because it's listed as non-empty. In that directory, there's one file, which I can see the name of, but ...
4
votes
1answer
3k views

rm -fr fails to remove directory due to “Is a directory” error

Recently noticed that one of my CentOS NFS clients have a directory which looks somewhat corrupted: CentOS release 6.3 (Final) [root@LG-B8A-LNX ~]# ls -lathr / ls: cannot access /zebra: No such file ...
4
votes
0answers
177 views

Removing duplicate files but ignoring certain lines (e.g. embedded timestamp)

I have a bunch of gzipped text files. I am trying to remove duplicate files (using fdupes) but the problem is these files contain a line that has their timestamp in them, and the files are identical ...
4
votes
0answers
286 views

How does fsnotify setting affect system performance?

Occasionally a software package I install complains that the default fsnotify setting is far too low for decent performance. Intellij IDEA or crashplan are two examples. They suggest using fsnotify ...
3
votes
0answers
169 views

Make one program use a special resolv.conf

I want to cheat a program to use a special /etc/resolv.conf file, that in turn will force it to use a nonstandard nameserver. The obvious solution is to recreate the whole filesystem except one file ...
3
votes
1answer
37 views

Copying files to mounted second drive puts process in state “D”

I am running manjaro. I first noticed this problem when I was trying to install games on my second storage drive from Steam. I would try to install a game, and it would work for a bit, but then steam ...
3
votes
0answers
132 views

Do the filesystem under Linux enforce serialization, which means only one change to the filesystem actually happens at any given time?

https://unix.stackexchange.com/a/12818/674 says Lock files are used by programs to ensure two (well-behaved) separate instances of a program, which may be running concurrently on one system, ...
3
votes
1answer
90 views

How can I get my photos off of an old cell phone in Linux?

I have an old, non-Android flip phone (Samsung SPH-M400) from about 2012, and I would like to get the photos off of it. The phone is fully functional, but its service is deactivated. I have tried ...
3
votes
1answer
151 views

'less' with header line kept at the top

Just like this question: I want to open a file with e.g., less -Sx32 file.dat, but as I scroll down, keep the top line locked in place. How can I do this with less?
3
votes
2answers
280 views

Using file command to know language of file

How can I use file command to know which language my file is written? File command use language tests to get the language file is written, but it seems it do not execute when first two tests - file ...
3
votes
1answer
426 views

Find a keystore file containing a particular SHA-1

I have the SHA-1 of a file. I have a keystore file which contains this SHA-1. But I don't know where this keystore file is on my system. Is there any way to find the keystore file that contains the ...
3
votes
0answers
90 views

Make read-only directory accessible to other users

I have mounted a read-only share via gvfs-mount to /run/user/60373/gvfs/smb-share. I would like to make other users read this share. The problem is that I can't set the permissions recursively as I ...
3
votes
1answer
229 views

Replace UID with known strings when doing ls and similar commads

When doing commands like LS I get output like this (doing so on NFS mounted remote folder) -rw-r--r--. 1 4016 folderA 23 Mar 31 10:47 soto_file This is perfectly correct and the file was ...
3
votes
1answer
501 views

Program to edit Default Applications (for MIME types)

Is there some nice programm (not necessary with GUI but would be nice) to edit my preferred applications for MIME types? I want to change e. g. default browser and default image viewer without ...
3
votes
0answers
85 views

Replace files with specific last modified date with files (or dates) from archive

I had a hard drive nearing capacity (mostly /home). I installed a new larger drive, copied /home over to it and went on with my life. This was on 5/17/2013. I know it was on 5/17/2013 because I ...
3
votes
0answers
79 views

Undeleteable 33GiB file on a 4GiB USB-Stick. fsck says “clean”, Error: “Operation not permitted”

I successfully installed a live debian 8.x on a 4G thumb-drive, like many times before. However, this time there is a 33GiB tee.1.gz file in /usr/share/man/man1/, which is much larger than a normal ...
3
votes
3answers
182 views

How can you move or copy specific files from a list of text files

So I have a directory of like 200 of the the following types of files: gre_6_c1_d34567.h3 gre_6_c1_d95543.h3 gre_6_c1_d42354.h3 gre_6_c1_d01452.h3 gre_6_c1_d23168.h3 gre_6_c1_435435.h3 The only ...
3
votes
1answer
422 views

Can file handles be translated to filenames?

Is there a tool for translating file handles to file names on Solaris 10? I've looked around and found several scripts including the one at: http://heim.ifi.uio.no/kjetilho/hacks/fhfind.perl https://...
3
votes
1answer
78 views

Can I make cross-computer sharing compatible with tinfoil-hat security (password managers, email, etc.)

Preface: I realize the following is asking for tinfoil-hat type security, but I'm really curious for answers to my questions -- not suggestions to enable two-factor logons on gmail, etc. and call it a ...
3
votes
1answer
38 views

Specify the format of application temp/backup files in kde

Many text editors will create temporary or backup files with the format <filename>~. Because of this, folders appear very cluttered with tons of files duplicated in this way ( <original> &...
3
votes
0answers
587 views

Higher-level wrapper for entr or inotifywait

I'm looking for a way to rerun a specific command as soon as any of the files in a subdirectory (perhaps minus selected excludes) changes. Use case I'm working on a project that is self-contained in ...
3
votes
0answers
146 views

Can Linux be configured to wait for USB storage to be reattached instead of returning I/O error

If a usb_storage device is physically detached from an Ubuntu machine while it is still mounted, any attempt to access the file system will produce an I/O error. Is there some way to configure Linux ...
3
votes
1answer
412 views

Equivalent of memmove on files: copy a range of bytes to an earlier position

What is an equivalent of memmove on files with the same input and output file, which works with large files? dd works when I move the file contents towards the right, but not if I move the contents ...
2
votes
0answers
22 views

How to make a symlink read only (`chattr +i /location/symlink`)?

How can we lock a symlink so it cannot be deleted? With a normal file/directory chattr +i /file/location can achieve this but doing so with a symlink we get chattr: Operation not supported while ...
2
votes
0answers
43 views

May I remove files that have a semicolon ; in them (created by updates?)

I have found, by accident, a few dozen files in /usr/bin that have a semicolon ; in them. If I remember correctly files like that are created when a file opened by some program is written to (e.g. ...
2
votes
0answers
230 views

How to copy an overlay partition to a file, and how to mount such file?

I have a disk, with two partitions: # fdisk -l Disk /dev/mmcblk0: 7381 MB, 7381975040 bytes 4 heads, 16 sectors/track, 225280 cylinders Units = cylinders of 64 * 512 = 32768 bytes Device ...
2
votes
0answers
494 views

Azure File Share CIFS Mount Not Deleting File

There's a file that's present on the Azure File Share mount that refuses to go away. It shows up in the directory: ls -l foo -rwxr-x--- 0 bin bin 1024 Aug 13 20:53 foo However, trying ...
2
votes
0answers
145 views

Automatic symlink to latest folder

Is there a way in Linux to automatically maintain a symlink to the latest version of a file/folder in a certain location? My use case: I generate datasets with unique job names, then write them to a ...
2
votes
0answers
52 views

How to split big file into multiple files and then access it as single file

Lets say I have one huge file. Backups using rsync take really long time, even when I change only small parts of it. Is it possible to split this file into multiple files, and then "mount" it as ...
2
votes
0answers
110 views

AIX : NOFOLLOW_LINKS is not supported on this platform

I have an AIX 7.2 machine. I am trying to run a Java program on it. It gives me this error: NOFOLLOW_LINKS is not supported on this platform. It is because I am using this call in the program: Files....
2
votes
1answer
2k views

Allow user to remove file owned by root

I have a limited user and access to root. How can I give that user the possibility to remove files owned by root? I have the following line added in /etc/sudoers.d/john : john ALL=(ALL) NOPASSWD:/...
2
votes
0answers
60 views

Given a pathname and a symlink to a directory in the pathname, is there a command which can return an equivalent pathname making use of the symlink?

Sometimes I have a long pathname, and want to shorten it by some precreated symlink to a directory in the pathname. Specifically, given a pathname /path/to/file, and a symbolic link /symlink to a ...
2
votes
0answers
91 views

Linux access windows share without loading to RAM

I have a laptop running an Arch-based Linux system and frequently need to access a windows share at my workplace. This is really annoying since it takes ages to load. Particularly, one folder is ...
2
votes
0answers
23 views

Macs unable to open shared files hosted on FreeNas because of temp files

We have a nfs share server (running FreeNas 11.2) mounted trough automount on which we store multiple *.xls files. Since a few days, two MacBooks refuse to open those files with the following error ...
2
votes
0answers
260 views

Maintaining file's SELinux labels when copying them from one directory into another

Default behavior for copying files or sub-dirs from one directory to another is that the copied objects do not maintain their SELinux type (domain) which is opposite to objects which were moved. ...
2
votes
0answers
54 views

How can I detect when my laptop is going to sleep

I'm using fedora 28. I have a series of programs that I'm launching based off lock and unlock times, but I wanted these programs to adjust their behavior if sleep is detected. So I want to create ...
2
votes
1answer
63 views

Reading values from a file and printing those lines present in another file

I have two different files: file1 with 1 million entries and file 2 with 1.3 millions entries. My file 1 looks like this A 54 54 67 abcd C 54 4 1.2 lmno D 43 2 22.2 asdasd File2 looks similarly A ...
2
votes
3answers
151 views

perform a read only if file is closed

I am facing an issue where I have to write a shell script to read a file only if it is not used or under write by any other program. I cannot use lsof as this script is going to run on the embedded ...
2
votes
0answers
78 views

test fails to find files with processed path

I have backup of /home/kuba/mp3 on external usb hard drive /media/kuba/JCUBIC/mp3 and I move some files to different directories on usb drive and now I want to sync the files from usb to my home ...
2
votes
0answers
63 views

Password requirement for all files with a specified extension

I'd like to be able to modify my OS so that that when I go to open any file that has the extension .zzzz (an arbitrary extension that I created a few files with, example: randomText.zzzz), I would be ...
2
votes
4answers
124 views

summing two matrixes each one in a different file

i have 2 files each contains like the following: file 1: data : [ 56, 34, 23, 54, 90, 234, 53, 12 ] file 2: data : [ 42, 56, 23, 98, 90, 23, 53, 32 ] i want to sum 1st value from ...
2
votes
0answers
62 views

“Union” based file manager

I would like to be able to perform actions on files in different locations within a common window/container. Let's say I have the following directory structure: └── DCIM    ├── browser-photos    │ ...
2
votes
0answers
61 views

Is there a way to give different permissions to different processes that are called from the same user?

I want to be able to have a r,w,x type permission given to specific processes and not to users. Any document I find shows that processes get the same permissions as the user calling it, but I want ...
2
votes
0answers
54 views

Finding files contained in particular block group

How do I see/list what files have blocks in a particular block group? I'm looking at a small disk image with an ext3 file system. Can I use debugfs, and if so, how?

1
2 3 4 5
10