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
24 views

file locking mandated by OS/filesystem rather than opted into by file accessors?

Is there a way to have the OS (specifically, FreeBSD) or filesystem (specifically, ZFS) enforce that all access (or, at least, all non-root access, I guess) to a certain file must be done while the ...
1 vote
2 answers
33 views

How to move every three day file based on the filename to respective folders in bash

I have several files like these: 2020.001.00.01.pcc1_TBTZ_TBTZ_1.0-3.0.sac 2020.001.03.04.pcc1_TBTZ_TBTZ_1.0-3.0.sac 2020.002.00.01.pcc1_TBTZ_TBTZ_1.0-3.0.sac 2020.003.00.01.pcc1_TBTZ_TBTZ_1.0-3.0.sac ...
0 votes
0 answers
55 views

Permission denied for user in group (group has directory write permissions)

I'm getting Permission Denied when attempting to create/touch files in a directory with group ownership permissions. touch /data/www/acoder.txt [acoder@box]$ touch /data/www/acoder.txt touch: cannot ...
  • 3,134
0 votes
1 answer
33 views

How to enable all locales (character encodings) on Debian 11 (over SSH, in Bash)?

I am unsure if I should not better ask: How to display Windows UTF-16 encoding in Linux? Since I just found out that Windows uses UTF-16LE to be exact: https://stackoverflow.com/q/66072117/1997354 I ...
9 votes
4 answers
629 views

How can I restore my default .bashrc file again?

I accidentally changed all the contents of the .bashrc file and I haven't scripted it yet so there's no problem for now. I added little scripts to it (just a few alias), so I can write them again one ...
  • 95
-1 votes
2 answers
48 views

I would like to set the permissions of a file to be editable, viewable, and deletable by everyone, what permission value should he set?

There is a general report template that someone has reserved only for the CEO. Since the file has to be editable, viewable, and deletable by everyone, what permission value should he set? My first ...
  • 1
-1 votes
0 answers
32 views

'Open in terminal' not working in Download folder

When pressing 'Open in terminal' on any folder in my file manager, nothing happens. I expect that my terminal opens in this folder. I'm using Arch Linux, file manager is caja, and Gnome terminal ...
0 votes
2 answers
24 views

Thunderbird unable to save file to PDF in gnome google drive

I am having a weird issue, whereby if I want to save an email through print to PDF from Thunderbird to the Gnome managed google drive mounted drive it doesn´t work. It simply returns back to the ...
0 votes
0 answers
35 views

Change file name based on contents

I'm trying to rename a set of files based on what is in the file itself. I have likely more than a thousand files to rename by the time I'm done. I have code that will get me the first part of the ...
  • 1
0 votes
1 answer
43 views

Why no smb.service GNOME file manager can still mount a disk from network?

Tested in Ubuntu 20.04 The smb service and smbd service didn't start. I can still use GNOME file manager to discover network share folders, and I can mount it.
  • 643
0 votes
1 answer
27 views

How to Tranfser huge amount of Files to slow USB Drive (dd, cp, rsync, 7z, tar)

I have like 5GB of data and a very slow USB-Drive. Should I use dd, cp or rsync? Should I compress them first into for example 7z / tar or not? In short: What is the best way and the best practices ...
0 votes
0 answers
9 views

debugfs mi output shows different block count than the number of block references!

I have a file for which the the mi (modify inode) option gives different block count and block references : debugfs: mi <4762313> Mode [0100644] ...
  • 1
2 votes
3 answers
131 views

Batch split images vertically in half, sequentially numbering the output files

I have a folder with scans of a book numbered 001.jpg through 092.jpg The scans have two pages of the book scanned together. What I want is split these by two from the middle vertically and regenerate ...
  • 67
0 votes
5 answers
48 views

Get list of all files and directories with their permission and owners

I need to generate a list of all files and directories with their permission and owner e.g. -rw-rw-r-- black www-data foo/ -rw-r--r-- black www-data foo/foo.txt -rw-rw-r-- black www-...
  • 1,885
-1 votes
2 answers
56 views

Why can I not use find + awk to find the largest file in the filesystem?

Why does this not work? find / -ls 2>/dev/null | awk '$7 > max {max = $7}; END {print max}' This does work: find / -printf "%s\n" 2>/dev/null | sort -nr |head -n1 In the first one, $...
2 votes
2 answers
64 views

Why is /var/mail setgid?

I am learning about UNIX file permissions and I saw that on my Ubuntu system, /var/mail has the setgid bit set. Why is this? $ ls /var/mail/ -dl drwxrwsr-x 2 root mail 4096 Feb 23 05:57 /var/mail/ ...
1 vote
1 answer
68 views

Files copied with cp are disappearing or not arriving as expected

I'm trying to copy ~/Desktop/profiles/a.mobileprovision to ~/Library/MobileDevice/Provisioning Profiles. Whether or not that's a good idea is not the topic of this question. The files never appear, ...
  • 123
1 vote
1 answer
21 views

removing duplicates based on one column but not duplicate in another column but want to remove the whole line

I have a text file with so many lines with two columns, but i want to remove the whole line based on duplicate of a column but not duplicated in another column. I have following example of my data ...
0 votes
0 answers
26 views

Where on earth could my startup tasks be?

Ok, for context: I once created a task to run a script whenever I boot my computer up and log in specifically as root. That was a while ago. I now want to remove that script from autostarting, but I'...
  • 89
0 votes
1 answer
44 views

In bash shell, how can I filter an array of paths based on whether an element exists?

I'm using bash shell. I have this array representing file paths MY_FILES=(/path/to/file1 /tmp/abc.txt /tmp/test.sh /path/to/file2 /path/to/file3 /tmp/abc.txt) How can I form a new array of elements ...
  • 2,164
0 votes
1 answer
44 views

Only download first file matched by pattern using Wget

I want to use wget to download from a directory online using a pattern but I only want the first match to be downloaded. It is possible to do this with wget, if not, what are some other ways I could ...
5 votes
3 answers
605 views

Manpage for configuration file

I often find myself in the situation where I need to look up the syntax and logic for a configuration file of some program on my computer. While I can do man mosquitto, this will not necessarily yield ...
0 votes
0 answers
40 views

Getting "source output path is invalid" after upgrade to Ubuntu 18.04

We have a very puzzling error after upgrading a build server from Ubuntu 16.04 to 18.04. An in-house developed tool suddenly starts failing with: ERROR: source input path /local/mnt/workspace/dir-name/...
  • 1
1 vote
1 answer
36 views

How to iterate over a directory for files without including sub-directories in Bash

I need to parse through a directory that contains files and subdirectories however I am unable to use the find command. The for loop is supposed to go through each file and compare it to another ...
  • 11
0 votes
1 answer
51 views

How to get Steam game install/save file path programmatically?

Some Steam games don't have cloud backup support, so I'm using a Git repo with a Makefile to create backups of game save files and settings. Because of storage restrictions I've had to create an ...
  • 49.4k
2 votes
9 answers
2k views

Why grep does not work properly in this case?

Consider a file file2.txt having the following content: P 89 24 -1.5388040474568784e+01 7.4421775186012660e+00 -1.3143195543234219e+03 1.3168884860257754e+03 8.0419002445999993e+01 44 0 0 -97 0 P 122 -...
0 votes
0 answers
31 views

Whenever I commit and push a file to github, a duplicated ending with ~ appears in my local and remote repository

I am a beginner in Linux and I am still navigating my way aroung the terminal and file manipulation. Whenever I commit and push a file to my github, a duplicate is created alongside it. Can I delete ...
  • 1
0 votes
2 answers
102 views

Replace multiple lines and words using sed in a for loop

I have 2 files (mac and uid) with data on a Linux machine, that I want to carry to a "template", with a list, using sed to replace the data with variables. list.txt: CP00 CP01 mac.txt: FF-...
0 votes
2 answers
60 views

How to make lf file-manager to show only one file types?

Basically what I want: When I browse files/dires with lf, I want to toggle "something" on the way. And only see PDF files, and make invisible any other file-types. Rationale: Sometimes it's ...
  • 450
0 votes
0 answers
15 views

Is the concept of file permission only applicable when access is via shell? [duplicate]

So in Linux we have a concept of file permission. There are three classes: user, group, and others, and there are three types of permissions: read, write, and execute. Now consider this. You are on a ...
-1 votes
1 answer
63 views

Is the concept of file permission only applicable when access is via shell?

So in Linux we have a concept of file permission. There are three classes: user, group, and others, and there are three types of permissions: read, write, and execute. Now consider this. You are on a ...
0 votes
2 answers
41 views

Delete files with similar names

I have been away from scripting for years, so I was wondering if someone can help in the below. I am migrating from Google Photos to Amazon Photos (about 40k photos). Here is an example of what I ...
0 votes
0 answers
15 views

Lost files after a cut and a paste into the same path on external device

On lubuntu a pcmanfm-qt was using to cut and paste the file with a choice of an overwrite option I've got an error libmtp: could not move object and the file was erased. It happens on the connected ...
0 votes
0 answers
53 views

cant remove or access file

I cant delete a directory because a theres a file in it that returns (I'm using $filename etc. as placeholder for the actual name(s) in this post): rm: cannot remove $filename: Invalid argument I get ...
  • 101
0 votes
1 answer
39 views

Pipe with loops in shell script

I have a text file with this information: Game Copies_Sold(M) Release_date Genre God_of_War 19 20/04/2018 Action-Adventure Uncharted_4 16 10/05/2016 Action-adventure Spider-Man 13 07/09/2018 ...
0 votes
2 answers
55 views

Find folders who have at least two files over 100 MB?

How can I only list folders who have at least two files over 100 MB in them?
1 vote
0 answers
38 views

In the middle of "Too many files open" mess

I am in the middle of "file limit" mess and I am not sure what to do. I am sure restarting the system will help for a while. However, could someone point me in the right direction for tools ...
  • 1,557
3 votes
1 answer
68 views

What is the purpose of systemd's /run/user/UID/inaccessible/?

What is the purpose of /run/user/<UID>/inaccessible/? There are two device special files therein, namely blk and chr with major device number 0, so these are dummies. But what for? I tried to ...
  • 7,283
1 vote
1 answer
40 views

Standardized directory for user-specific app data

I know all applications store user-specific data in the $HOME directory, but it seems that (some) more "modern"/recent applications has a preference for stuffing their settings and ...
  • 1,060
1 vote
1 answer
19 views

Unable to see thumb drive through file manager

I am using EndeavorOS with i3 and am trying to put stuff on a thumb drive, but Thunar file manager isn't seeing it. When I run fdisk -l and lsusb I see the thumb drive, but it doesn't show up in ...
0 votes
0 answers
34 views

SSH Connection - Open File to read

im kinda confused, i tried to establish an connection to my server function autoban () { ssh -t xxx.server "sudo su && vi xxx.sh" } by this im trying to connect > go ...
4 votes
1 answer
141 views

How to find files in subdirectories and copy it to the folder immediately before the location where the file was found

I have the following scheme of file directory: . |-- FOO1 | `-- p58 | `-- file1.csv |-- FOO2 | `-- p63 | `-- file2.csv Note that each of the CSV files is located in the subdirectory ...
0 votes
1 answer
54 views

"ls -l" but with output in more than one column? [duplicate]

Monitors tend to be more wide than tall. When there's hundreds of files in a folder, ls -l and ls -l | more will only show you me maybe 100 files at a time, due to the lack of vertical space on the ...
1 vote
1 answer
51 views

Copying/moving and renaming files from multiple subdirectories to parent directory

I have multiple directories, and each one of those directories contains an "example" directory which in turn contains images. What I want to do, is to add a textual suffix at the end of a ...
0 votes
0 answers
158 views

OpenWRT can no longer install new packages because the file system has switched to read only mode

Trying to set up samba on openwrt but stuck setting up the storage as I can no longer install packages. Following these instructions Problem: I can no longer install new packages because the file ...
0 votes
0 answers
72 views

Termux Bash: ./ Permission Denied

I have a file Test.cpp that I compiled into test using clang++, but running it, I get the error in the title. I have tried using chmod u+x test and chmod 775 test, among other commands, but using ls -...
0 votes
0 answers
31 views

Dump file conversion with iconv

I tried to convert the dump file with iconv. The command that I used: iconv -f utf-8 -t iso-8859-1 | iconv -f windows-1251 -t utf-8 Unfortunately, it converts to the unreadable letters: ГЋГЎГєГїГўГ«...
  • 1
0 votes
2 answers
17 views

My Application (.out) writes folders with owner-only permissions and its contents cannot be accessed

I have a Raspberry Pi 3 on which I use Visual Studio cross-platform building to build an application (.out) file. The (.out) file has permissions for everyone. When I run this (.out), it creates a ...
0 votes
1 answer
19 views

Manullay run any service on reboot

I want to run a service on linux on reboot. I know i can do sudo systemctl enable service_name.service To run this service on reboot. But I can't use terminal. So, Is there any way that i could run ...
1 vote
0 answers
25 views

Is there a useful utility for managing multiple "alternatives" of a given file?

The example I'm going to give here is a simple media file conundrum. In this example, say I have multiple versions of a given audio file: SomeSongLibrary/ awesome-song-compressed.mp3 awesome-...
  • 149

1
2 3 4 5
98