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 votes
0 answers
30 views

File size inconsistency under Linux [duplicate]

I am writing a small program to test BadgerDB, and list the directory contents of in bash: ... ... -rw-rw-r-- 1 fxr fxr 2147483646 9月 27 22:17 000027.vlog -rw-rw-r-- 1 fxr fxr 1687 9月 27 22:16 ...
xrfang's user avatar
  • 163
0 votes
1 answer
48 views

Can't interact with a file with an apostraphe directly in bash

I have a file titled "I'm Here.mp3" when I try to interact with it with ls, cp, mv, anything, it returns cannot stat "./I'm Here.mp3": No such file or directory. I tried double ...
phenivol's user avatar
0 votes
1 answer
40 views

Any operations with file system takes forever

I'm using Ubuntu 22.04 LTS. Unexpectedly for me all operations with the file system stopped working. I tried ls /, df and nautilus - all of this command takes forever to execute. What happened to my ...
Minuta18's user avatar
0 votes
3 answers
52 views

Use bash to overwrite old file with a new file named according to current date

I am a complete beginner with linux, and need help making a bash script to create a file with a specific date in the file name. I have a directory called /backups/, in which I would like to create a ...
teeeeee's user avatar
  • 187
0 votes
1 answer
22 views

How to get the size of a folder as reported by Windows Explorer on Linux?

On Windows when you view the properties of a folder the size is calculated as follows (recursively): for files the length of the content counts symbolic links count zero folders themselves count zero ...
zomega's user avatar
  • 873
0 votes
2 answers
20 views

Using find in order to detect a magento module

At magento routes are located in adminhtml/routes.xml each module has a folder named adminhtml with a file routes.xml each module has its own folder. In other words I have the following file structure:...
Dimitrios Desyllas's user avatar
0 votes
1 answer
30 views

Counting characters between grep searches

Is there a way I can use the grep command in conjunction with a series of other commands to find a character sequence (ie 'GAATTC' in a fasta file) and count how many characters are between each match?...
Alina's user avatar
  • 1
0 votes
1 answer
47 views

How to copy a directory structure and rename a subdirectory in the destination

Given this directory structure $ lsd --tree ...
mrt181's user avatar
  • 111
0 votes
1 answer
31 views

How to preserve file creation date when overwriting files?

When I'm overwriting one file with another one, not only it's modification time updates, but also birth time, which is unwanted. I want to make Dolphin overwrite files that way, so target's birth time ...
Velent's user avatar
  • 39
0 votes
0 answers
13 views

Disparity between file-nr and netstat

> netstat | grep :389 | grep ESTABLISHED | wc -l 2116 > cat /proc/sys/fs/file-nr 1920 0 3178047 how can a subset of the number of tcp connections be more than the total number of file ...
soupybionics's user avatar
1 vote
2 answers
38 views

Leftover kernel directories with files

Why there are Kernel leftovers and can I get rid of them automatically? There are so many kernel directories after a few months, that I get annoyed with it. I just carefully inspected the /usr/lib/...
Vlastimil Burián's user avatar
5 votes
6 answers
1k views

How to find files that don’t have a suffixed version?

I have a few million .jpg files and I want to generate a .jpg.webp version for each one (foo.jpg -> foo.jpg.webp). For this, I need to find all files ending in .jpg for which there’s no .jpg.webp ...
bfontaine's user avatar
  • 166
1 vote
1 answer
21 views

Convert directory with opus files to CSV or similar?

I have a folder with opus sound files. I would like to convert that folder listing to something I can use in a spreadsheet. I want the result to contain something like file name, length of the sound ...
d-b's user avatar
  • 1,713
3 votes
2 answers
187 views

I want to find lines where a specific word appears in a file along with line number and take the line numbers in an array .How to do that in bash?

This returns line numbers but they are in a string: grep -n -F -w $word $file | cut -d : -f 1
Arpan Koley's user avatar
0 votes
0 answers
30 views

Showing the Creation date of a File [duplicate]

I guess there's no way to get that under most Linux flavors, please correct me if I'm wrong. My hack is to go up a directory level and get the info and the directory containing the file I'm ...
user13574's user avatar
4 votes
1 answer
189 views

ln will not create symlinks to nonexistent targets / target without permission

First of all please note that I'm on a shared server and I don't have root access, so anything involving su or sudo would not be possible. AFAIK ln and Linux should not even bother checking whether ...
Dan's user avatar
  • 141
3 votes
3 answers
610 views

How can I remove everything except last n bytes from the file in Linux?

I've a Tomcat server where logs are stored as catalina.out. It's a pretty huge file and causes troubles a lot of times. Because of it taking too much space, other servers have to stop involunatarily. ...
achhainsan's user avatar
0 votes
0 answers
22 views

Sum of all file sizes in a folder down not adds up to what what ls or du show [duplicate]

I have downloaded couple of thousands file form a cloud. the download is done without any error. When I check the files occupied space in my hard drive is showing size, then what is shown on the cloud ...
Ahmad.S's user avatar
  • 101
0 votes
2 answers
62 views

Linux - listing and removing multiple different files which have names containing specific pattern

I have multiple folders which contains files and folders created with Windows File History. The filenames all have the same structure e.g - Super secret document (YYYY_MM_DD HH_MM_SS UTC).ext For ...
Kristaps Esterliņš's user avatar
0 votes
1 answer
42 views

Symbolic link on Linux to a Windows-like file - not sure this is possible

I have to migrate a Windows application to Linux. The directory/filename format within this Windows application are of the form C:/dir/dir/file (I know, not exactly Windows format with reference to ...
tale852150's user avatar
1 vote
1 answer
51 views

Create a file for writing with controlled flushing to disk in large chunks

On Linux I have a process (ffmpeg) that writes very slowly (even slower than 1kb / s sometimes) to disk. Ffmpeg can buffer this to 256kb chunks that get written infrequently but ffmpeg hangs ...
Pete's user avatar
  • 133
0 votes
1 answer
56 views

Delete all the files in a folder and its subfolders without deleting the folder structure

I am replicating a server -> I want to delete all the files inside the folders and the subfolders, without deleting the directories themselves. Example: home\apps\Batches\hello.txt home\...
amalAF's user avatar
  • 3
1 vote
0 answers
38 views

Accidentally moved a directory using Dolphins GUI. After cancelling, the dir is empty

In Dolphins places menu on a Debian system I dragged a directory (Desktop) to another (Home) by accident. I then canceled the the action. I then killed the window. The Desktop had a shortcut to ...
esseestpercipi's user avatar
1 vote
0 answers
19 views

What happens behind the file system when moving the source of a loop drive into its mountpoint?

I moved the source of a loop drive into its mountpoint and umount it. Then the source disappeared. Note that after moving the source to its mountpoint (or other location), the source was shown as ...
PanJianhong's user avatar
0 votes
1 answer
397 views

PuTTY logging file date time

I use Putty on my job and capture the output with the logging option. What I need to do is have a date and time appended to each line. Is there any way to capture the live PuTTY output and append the ...
RtR's user avatar
  • 1
1 vote
1 answer
32 views

See if any of a number of zip files contains any of the original files in a directory structure

I have a pretty hard problem here. I have a photo library with a lot of photos in it in various folders. I then started using Google Photos for my photos, I put those originals into Google Photos, and ...
Albert's user avatar
  • 131
1 vote
2 answers
88 views

How to break syslog into smaller files without losing data

Here we try to break syslog file into smaller chunks. For that we use following script. #!/bin/bash date=$(date +%Y%m%d_%H%M) cp /path/to/sys.log /path/to/chuck/file.log cat /dev/null > /path/to/...
Sachith Muhandiram's user avatar
2 votes
1 answer
41 views

Is it safe to slicing byte directly to split a big file?

In my case, the big file is tar.gz, I have myBigFile.tar.gz with size 52GB, I splitted it with chunk size 2GB therefore I have 27 parts file. Here is the code I program from scratch: from time import ...
Muhammad Ikhwan Perwira's user avatar
-1 votes
1 answer
62 views

Bash script via .desktop save to variable external filename with fullpath

ok i try to make the most resumed the points i want to do. Sorry for the repetions i don't know how make this question more objectively The first i am making a script for launch "mupen64plus"...
Inukaze's user avatar
  • 47
0 votes
1 answer
99 views

file permission for ls and lsattr

The file permission for ls and lsattr are same: debian@debian:~$ ls -al /usr/bin/ls -rwxr-xr-x 1 root root 147176 Sep 24 2020 /usr/bin/ls debian@debian:~$ ls -al /usr/bin/lsattr -rwxr-xr-x 1 root ...
showkey's user avatar
  • 99
1 vote
0 answers
27 views

How can I auto run the USBs files when it's plugged into my Chromebook?

Auto running the file with a ".inf" is not working.
Anonymous212's user avatar
1 vote
2 answers
79 views

Pinning a file to that it appears in the beginning in a folder

I am using Ubuntu (Linux mint). There is a mouse option, if I right-click on a file, I can then choose to pin a file (inside its folder), so that whatever file arranging method (alphabetical, by-date, ...
mahbubweb's user avatar
  • 141
0 votes
0 answers
11 views

What's the best method for migrating a media server from Windows 10 to Ubuntu whilst retaining media files?

I currently have a Windows 10 machine running Plex, operating from an SSD boot drive, which is getting its files from a local DrivePool consisting of 3 8TB drives. These drives are pretty much full ...
Jake Mansell's user avatar
0 votes
0 answers
25 views

How to rename a one file name with another file part name in the same directory?

the database I am using is Unix and I am trying to automate where I want it to rename the file for me when I run it instead of me going to file and manually rename it. For example. Two files in the ...
Mawuko's user avatar
  • 1
0 votes
1 answer
40 views

How to iterate through directories of zip files and locate & append files without a .zip extension

I have a directory of sub-directories that contain sub-directories which are supposed to be compressed archive files. Structure is illustrated below ParentDirectory |-SubDirectoryA |-File Mr X.zip |-...
McGooks's user avatar
0 votes
0 answers
25 views

du and du -h give different results, and neither match ls -lh [duplicate]

I can paste a screenshot if preferred, but here is what I typed: me@server:~/dutest/test2$ du 12 . me@server:~/dutest/test2$ du -h 12K . me@server:~/dutest/test2$ du -b 4243 . me@server:~/dutest/...
Ben Holness's user avatar
0 votes
0 answers
30 views

Accessing OneDrive Folder on ElementaryOS

I have a computer with Windows 11 and Elementary OS 7. I can't access my OneDrive folder. I tried fsutil reparsepoint delete "C:\Path\To\OneDrive\Folder" but it output an access permission ...
Mohamed Hisham Abdelzaher's user avatar
0 votes
0 answers
28 views

Rearrange file based on first field [duplicate]

I Have a file with contents like in sample input, want to rearrange as in required output. Unsure how to achieve with sed and awk with this. Sample Input bni bce_merge_bni ...
iamsage's user avatar
  • 25
0 votes
1 answer
44 views

Are symbolic links stored as files or just entries in directories?

My question is related to the way symbolic links are implemented in Linux file systems. Are they regular files stored (inodes used) or are they just special entries in directories? If they are stored ...
mrn's user avatar
  • 149
0 votes
0 answers
54 views

Creating file or folder showing drwxr-x--- 2 root bin

I am not sure why i get this drwxr-x--- 2 root bin every time I create a new file or folder on an NFS share. Earlier I used to get drwxrwxrwx 2 root root. id root uid=0(root) gid=0(root) groups=0(root)...
Rixxo's user avatar
  • 1
0 votes
0 answers
26 views

archiver/backups does not save/restore hardlinks

I will explain what kind of hardlinks and where and why they appeared, and why to save them. pictures on the server are saved: ../foto/M/ay/uZbIKBgsXr0222858001661067986M ../foto/M/ay/...
Aliskin's user avatar
  • 121
0 votes
3 answers
78 views

How to keep permission for migrating Files and Directories from one linux to another

I need to migrate files and directories from one machine to another using tar. I would like to use tar or something similar. But I don't have a root permission. As far as I know "To extract file ...
SBMVNO's user avatar
  • 103
0 votes
1 answer
112 views

Creating a zip file incrementally

I currently have a large directory on S3 (>100GB). I want to create a zip archive of this directory. Currently, I download the contents of the directory and create a scratch (temp) directory on the ...
testing09's user avatar
0 votes
1 answer
106 views

Is there a case where Applications need to do it's own File corruption checks with file systems like EXT4 and XFS and recent Linux OS like Red-Hat 8

What I presumed is File systems like EXT4 and XFS. Writes blocks to disk (Could be a Hard Disk or a SSD) along with a checksum. When Reading back, if checksum fails, read operation will NOT return ...
aKumara's user avatar
  • 111
-1 votes
1 answer
87 views

What is the "l" command in Linux?

I just accidentally typed l and hit enter. Then this happened. I'm not talking about ls -l just l. Why did this happen?
lunix's user avatar
  • 29
0 votes
1 answer
94 views

What file compression software/algorithm is best for mixed types of files? [closed]

I am looking to backup a large amount (~400GB) of different types of files (50% images and videos, 30% audio, 20% text). I hesitate to give an amount by which I'd like the size to be reduced, since I ...
Lukas's user avatar
  • 47
0 votes
1 answer
60 views

Temporary symlink in shell - "named process substitution" - rename a file without creating a copy/symlink on the disk?

Thunderbird doesn't open files that don't have .eml extension as email files, but instead starts to compose a new message and adds them as attachments. To use thunderbird in scripts I'm looking for a ...
Daniel Krajnik's user avatar
0 votes
0 answers
37 views

How make multiple files available as one, akin to symlinking?

Is there a way to take a list of files and make them available under a single name (in a read-only fashion)? Let's say I have: f1.txt f2.txt f3.txt And I would like to read sequentially through all ...
miku's user avatar
  • 673
1 vote
1 answer
75 views

How to trace file descriptor duplication?

I am learning to use redirection. the typical operation is like below: command > file 2>&1 Refer to APUE 3.10 and 3.12, I think the critical syscall sequence is like below: open(...
Yao Li's user avatar
  • 21
0 votes
1 answer
53 views

How to find a file and copy its directory without copying the other files in that same directory?

I have a lot of different folders with pdf files and other extensions. I want to copy all the pdf files to another destination. But if I do that with find like this: "${SEARCHDIR}" -iname &...
pwrsheller's user avatar

1
2 3 4 5
99