Skip to main content
The 2024 Developer Survey results are live! See the results

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
19 views

Bulk Resize Images of Different Aspect Ratio so that all have Same Width

I am trying to resize multiple images inside of a folder so that all images have the same width, keeping aspect ratio. The images are all different sizes and aspect ratios. I don't care about the ...
Druid's user avatar
  • 21
0 votes
0 answers
12 views

Understanding the usage of fdtable entries in files_struct

I've been looking at the files_struct in https://github.com/torvalds/linux/blob/master/include/linux/fdtable.h and am struggling to understand the relationship between files_struct, fdtable and file. ...
end0finvention's user avatar
-2 votes
1 answer
33 views

Is there a port of the Windows' REN command for Unix-like operating systems? [duplicate]

I already know the rename command in GNU/Linux. However, it is very complicated and cumbersome because it uses regular expressions. For example, in Windows, I can simply rename files in bulk by typing:...
TranslucentFoxHuman's user avatar
0 votes
0 answers
57 views

cleaning up full directories at once

right now, i have a filesystem that fills up fairly regularly. the TL;DR is that I can't introduce better log rotation, and the files must be deleted regularly. let's say i have the following output ...
Britton Harsch's user avatar
-2 votes
0 answers
60 views

mv * ~/ --- where could it have gone?

Relatively new Linux user, using Arch Linux. I was loading from a backup hard drive today by mounting the backup partition to /dev/hd, then as superuser did a simple mv * ~/ to move all the files in ...
siphonus's user avatar
0 votes
2 answers
26 views

How do I batch move all files from subdirectories into a main directory while renaming overwrites

I downloaded all files from a website from the Internet Archive. Now I have a directory with over 1000 subdirectories labeled by date archived. Each of these subdirectories contain a few files. I ...
Siena's user avatar
  • 3
0 votes
1 answer
24 views

Add files only one program can see (without root) [duplicate]

I have a program with hardcoded config files in /etc, which I do not have write permission to, because I have no root (except I can use pacman in sudo). I need a way for the program to see a file ...
Xandaaah's user avatar
0 votes
1 answer
63 views

How can Firefox access /dev/dri/renderD128 when it should be only root accessible

/dev/dri/renderD128 should only be accessible to root or users in the render group as per: project_kohli% ls -lha /dev/dri/renderD128 crw-rw----+ 1 root render 226, 128 May 26 09:...
Kirtivr's user avatar
0 votes
0 answers
40 views

i cant open camera file

I got a camera not too long ago, and when I connect it to my computer, all I get is this file. (I use a USB cord I bought off amazon). sI don't know how to screenshot, so apologies for lack of ...
oddkam33's user avatar
-1 votes
1 answer
42 views

Single command to delete all files in a folder & the folder itself if it is now empty?

Sometimes I want to delete all the writable files in a folder and delete the folder itself if it is now empty (meaning it did not have any subfolders, and did not have any write-protected files). I ...
End Antisemitic Hate's user avatar
0 votes
0 answers
31 views

du -h only show folders but not files, how to show all?

I don't know what's going on with my centos 7 machine but seems like du -h /path only shows folders, not files, and it's annoying. I want to find all the files and folders at a specific depth and sort ...
Hoang Minh Quang FX15045's user avatar
0 votes
3 answers
127 views

How to display all existing regular files from a text file using one-liner?

How to display all existing regular file names from a text file? Example: $ cat file.txt zzz xxx/yyy 234 546 "abc def" --bbb $ cat file.txt | <one-liner> zzz xxx/yyy In this list ...
pmor's user avatar
  • 619
2 votes
1 answer
37 views

How does fnctl provide byte range locks?

fnctl (https://man7.org/linux/man-pages/man2/fcntl.2.html) supports locking a portion of a file (specified by start position and length). Behind the scenes, what does the algorithm look like? I'm ...
Novice User's user avatar
  • 1,399
2 votes
2 answers
2k views

Why is off_t signed?

On my journey to create a 16 EiB sized file, I encountered the following issue: POSIX defines files to have their size represented using type off_t, and that "blkcnt_t and off_t shall be signed ...
Semnodime's user avatar
  • 377
0 votes
3 answers
65 views

Keeping owners in a folder copy

I'm trying to copy a folder (SRC) containing some files and subfolders. The content and SRC itself have setgid bit enabled (that is the s in place of the x in the group triplet). Furthermore, the ...
user9952796's user avatar
0 votes
1 answer
41 views

Unreadable file as root on NTFS HD

I have an NTFS partition on an HD. This partition contains 6 files which I can't read in any way. I have tried reading them as root, doing chmod, chown and mount -o rw,remount ... nothing worked. # ls ...
user2543740's user avatar
1 vote
3 answers
297 views

I know I can create folders from a list.txt, but can I move files to those folders based on a mapping?

If right now, I only had a bunch of files dumped into a single directory, is there a way that I could move the files into a folder based on a mapping file. For example: A B 1 File Name Folder Name ...
Nicole's user avatar
  • 19
0 votes
1 answer
47 views

Use grep to search stdout, without replacing stdout

At the moment, I have this in a wrapper script: 2>&1 ./update.sh | ts | tee -a ./update.log and this in update.sh: if apt full-upgrade -y | grep linux-headers then echo echo Need to ...
AaronD's user avatar
  • 153
0 votes
0 answers
27 views

Rsync command to move directories and overwrite existing ones

I need an rsync command that moves directories from a source folder to a remote folder and overwrites existing directories on the remote side. I don't want to write into existing directories on the ...
Mayor Mayer's user avatar
0 votes
0 answers
37 views

File descriptors get corrupted when program runs in background

I have written a program for an embedded Linux system(petalinux). It runs fine when started from the terminal or TCF debugger. However, I want it to run when the system starts, so I use the start-stop-...
user3219624's user avatar
1 vote
2 answers
77 views

Removing a file does not increase available space?

OS is Debian. Output of df -h /: Filesystem Size Used Avail Use% Mounted on /dev/sda3 99G 97G 0 100% / lsof shows /var/log/syslog file handle is open, but nothing related to /var/log/...
cat pants's user avatar
  • 487
1 vote
1 answer
29 views

Moving and organizing files with find

I have a folder on a Debian GNU/Linux 12 (bookworm) x86_64 Server used as a NAS/Homelab server with a lot of files from a surveillance camera. MDAlarm_20240301-091804.jpg ... MDAlarm_20240316-153813....
JoSSte's user avatar
  • 195
1 vote
1 answer
2k views

How to clean up a Linux system to free up disk space?

What are some generic ways to free up lots of storage space without deleting personal files? I'm doing a distro upgrade (Debian11->12) and it needs lots of disk space on the root partition / which ...
mYnDstrEAm's user avatar
  • 4,398
0 votes
1 answer
42 views

How do I copy directory structure as symlinks inside other directory

I am looking for an easy way to backup all my dotfiles in a git repository. Solution that I'm aiming for: have git as my source of truth for my dotfiles contents in my home directory backed up files ...
Artem Sevos's user avatar
1 vote
1 answer
40 views

How can I see the number of files that the current folder contains, excluding the files located in subfolders, with ncdu?

I use ncdu to browse some folders. How can I see the number of files that the current folder will contain, excluding the files located in subfolders? By default in ncdu, the number of files that the ...
Franck Dernoncourt's user avatar
2 votes
1 answer
56 views

Why leading zeros do not alter order of files?

In all three cases below (folder, files with zeros only and files with 1), I expect the order to be C-A-B and not A-B-C. Why are leading zeros not considered? It seems to be taking contiguous numbers ...
luchonacho's user avatar
0 votes
1 answer
84 views

Can you tell me why rsync is saying my files are different

I'm using rsync to sync files from my NAS to a Remote Server. The files on the Remote Server appear to have the same user, group and permissions as the source. However rsync wants to copy the files ...
ghines's user avatar
  • 13
0 votes
2 answers
83 views

Is there a way to find all PNG files in a folder that have transparent pixels

I have a couple thousand PNGs, all of them probably support the alpha channel but only some of them actually use it (Only some of them actually have transparent pixels). Is there any way at all for me ...
Cestarian's user avatar
  • 2,071
2 votes
1 answer
124 views

Multi computer cron

I have many computers and I ssh between them. I have a single cron file, which I manually type after into each computer. And when I change this cron file, I have to manually ssh into each computer to ...
john-jones's user avatar
  • 1,736
0 votes
0 answers
174 views

`No such file or directory:` ruff. but file exists

I am using nixOS and I have a flake.nix. I use pre-commit to run ruff. my pre-commit config: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.3.4 hooks: - id: ruff ...
linuxNewbie's user avatar
0 votes
1 answer
87 views

Access USB device with Bash script

I am using a Raspberry Pi 4 Model B. I am trying to make a script that runs automatically whenever a USB device is plugged in. It will try to read from a text file on the USB device. This is what I ...
XII's user avatar
  • 3
0 votes
1 answer
197 views

Why do "force create mode" and "force directory mode" parameters exist in smb.conf?

I am reading How to Set Up a Network Shared Folder on Ubuntu With Samba. At the "Step 2: Configuring Samba" section the following configuration is given: [sambashare] comment= Network Shared ...
Manuel Jordan's user avatar
0 votes
0 answers
111 views

Unable to copy using wl-copy (wl-clipboard) - issue with `xdg-mime`

OS: Arch linux (linux-6.8.1.arch1-1) WM: Hyprland When I run echo 'hello' | wl-copy, I get the following output: echo "hello" | wl-copy Usage: file [-bcCdEhikLlNnprsSvzZ0] [--apple] [--...
chaitanya sharma's user avatar
1 vote
0 answers
47 views

How was the formula for calculating umask derived?

When using umask, I know that to get the resulting permission, the mask is first NOTed and then it is ANDed with the default permission (777 or 666). Now my question is, how was this formula derived? ...
JLC's user avatar
  • 317
1 vote
1 answer
140 views

Permission denied when opening a file in gdb

I'm implementing some CTF challenges. The flags are in some text files, that get read from the programs. To protect the flags I have changed the owner of the files, but have set the setuid to the ...
r3k0j's user avatar
  • 15
0 votes
1 answer
27 views

How does Lustre decide how much of a file to restore to front-end storage when a program reads a file?

I read about the Lustre file system: With huge files, it’s unusual for the entire file to be restored to frontend storage How does Lustre decide how much of a file to restore to front-end storage ...
Franck Dernoncourt's user avatar
1 vote
0 answers
31 views

Difference between non-executable directory with and without write

Is there a difference between a directory that is not writable (and not executable) and one that is writable (but still not executable)? It seems to me that they are equivalent, because creating/...
CarmenCarmen's user avatar
0 votes
1 answer
131 views

Rsync throwing errors but files appear to be fine

I am doing a massive 200TB transfer with rsync. I used a shell script I found off the internet to spawn a few processes but here is the relevant rsync command itself: rsync --recursive \ ...
john cs's user avatar
  • 164
0 votes
0 answers
95 views

Ubuntu - trying to delete a file that has no inode

I try to delete a file that is left in a directory, but even an ls -i will not give me an inode to remove it. Deleting/removing the directory won't work even with the inode. $ ls -ila ls: cannot ...
merkc's user avatar
  • 1
0 votes
1 answer
43 views

How does KD acronym unveils? /usr/include/linux/kd.h

I do understand that it is related to console (a "real" TTY which is at Ctrl+Alt+F[1-9]). ioctl_console man page lists many KD* prefixed constants. there is also a vt.h in /usr/include/linux ...
Michael Quad's user avatar
0 votes
0 answers
27 views

Deleting an entry from the ext2 directory entry list

From this question, which references this site, I understand that when an entry in a directory is deleted, the size of the previous entry is pushed to the next entry or to the end of the block ...
Mora's user avatar
  • 1
0 votes
2 answers
97 views

How to locate installation path for software that I am able to open but I do not know the name of?

The title is a bit confusing and I am a bit of a noob when it comes to linux. Basically, I have a form of qBittorrent which did not allow me to use magnet links the convenient way, I would need to ...
Greg Robson's user avatar
0 votes
1 answer
41 views

Why does my hdd copy files when I intend to move them? Using Gnome Files GUI

I have an extra HDD that I am trying to move files from to my main ssd and when I drag the files from one window to the other it copies them over, rather than moving them. Why is this? How can I get ...
Aslan French's user avatar
0 votes
1 answer
53 views

Why does `du` report that my `rsync` backup is not the same size as the original?

I'm creating a backup of my $HOME directory on an external storage drive using rsync, using the following options: --archive --xattrs --hard-links After a fresh backup, du reports that the sizes of ...
jth's user avatar
  • 195
0 votes
2 answers
78 views

How to get the cursor back on the last line of a file

I have a `text file with three numbers and each number separated by new line. -55 -56 -64 When I open the file I can see the cursor is on the fourth blank line. I want the cursor to stay on the last ...
Damien 's user avatar
1 vote
0 answers
107 views

How to prevent programs from automatically creating files in home directory?

I prefer to have an uncluttered home directory. However, it inevitably gets cluttered up by hidden files and hidden directories which are created automatically by various software: things like ~/....
Superbee's user avatar
  • 119
0 votes
1 answer
77 views

How can I create a file named "\?$*'ChouMi'*$?\"?

I need to create a file with this exact name "\?$*'ChouMi'*$?\" so that ls would show it as: $ ls | cat -e "\?$*'ChouMi'*$?\"$ $
prince royce's user avatar
-1 votes
2 answers
121 views

Batch rename of files that share the same prefix

I have a list of files on my server with a prefix that I want to de-dupe. These are completely different generated files. It seems to be generated files with {Title} - {yyyy-MM-dd}_{random} - {...
mysterio21_troy's user avatar
0 votes
2 answers
90 views

Command-line tool enabling tagging and related tags functionality

Is there a command-line tool that enables to give a file more attributes than a name? For example, we have a file called ubuntu.pdf and we give it tags like command-line, shell, nautilus, ...
xralf's user avatar
  • 15.2k
1 vote
2 answers
63 views

find files that start with a 6 digit number and matches number from the list

I have a big number of files around 185000, 99% of then start with a 6 digit number follow by underscore and other random symbols and random extensions 312095_ck_image-24-10-20-11-29-1.jpeg ...
Azat Usmanov's user avatar

1
2 3 4 5
101