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

How to recover an overwritten file with cat command?

I made my files by cat -n crib.txt then when I did cat > crib.txt and Ctrl+D it all got overwritten. Can you plz help how to recover the overwritten file? What is the backup file restore command, ...
1
vote
2answers
63 views

echo redirect appends a spaces

could someone help me? I am trying to create a lot of files, but when I try to write to it with echo it adds a space and single quotes, for example: ' (here is the space) file.tmp' ' file1.tmp' ' ...
0
votes
1answer
48 views

find command generates empty files in linux

I am trying to retrieve the filesize associated with the Logfilename listed in ip_DBfiles.txt with the logfilenames from the server.When matched the size of the file and the filename should be written ...
5
votes
2answers
120 views

How delete BILLIONS of files efficiently on linux?

A storage system had collected 1.7 billion files from revision backups over a couple of years and was getting a bit full. So I started to delete all files older than five years. Which I assume are ...
1
vote
1answer
42 views

How to compare two file names

I want to compare two files in a folder and delete the number in the name which is the smaller of the two. For instance, say the names were yearMonthDay.txt. I want to compare which is a smaller ...
-2
votes
1answer
53 views

Parse fixed width file and lookup those parsed values against Oracle Db

Files arrive within a specific time window (midnight-0600hrs EST) and get saved to the orders directory on the Linux host. these files are stored in a zip format. usually around 30 files are expected ...
2
votes
1answer
99 views

Why does echo "$ZDOTDIR" return nothing?

Background In Chapter 5 of the ZSH manual it states: Commands are first read from /etc/zshenv; this cannot be overridden...Commands are then read from $ZDOTDIR/.zshenv. Issue I wanted to view what ...
0
votes
1answer
40 views

Creating a file in the Linux home area: can't touch this [duplicate]

I want to write some text to a file in my home area, which doesn't yet exist. I've stored the name of the file I want to create in a variable. I want to use this variable to echo some text and ...
0
votes
2answers
55 views

Get the nth last line from file

I have a file with quite many lines, and I would need the nth last line (specifically the 95th from bottom). How could I go on about doing this? One way would be to use tail but then it prints ...
0
votes
0answers
26 views

While moving files, how to continue without halting if an error happens?

Imagine you have 1000 files. You move/copy to a different folder. You start the process, all going well, you leave the computer. At file number 10 an error dialog states if you want to overwrite, ...
-2
votes
2answers
58 views

sort and delete older file

How can I sort the below files based on the date and time inside the folder and delete the older ones and keep the most recent ones in Linux? I just want to keep the latest one regardless of the ...
-2
votes
0answers
22 views

How to concatenate the different ctl files with the different name and variable

I run RegCm model for dust and there are some files. The output files have a different name for every dust particle size but the variables' names are the same in ctl. Description or header Du_DUST01....
0
votes
1answer
35 views

Please how do I retrieve files saved in STDOUT after using the extract while downloading function?

I used the below function to download a large tar.gz file and extract it simultaneously. The files are now saved in STDOUT. Please how do I move them to a different file directory? wget -q -O - target ...
0
votes
1answer
13 views

Have a folder have many group based permissions

On a multi-user system, lets say I have the following groups: "writers" "readers" "reviewers" In the folder /Documents writers should be able to write files, but not ...
0
votes
2answers
49 views

How can I do something for each line of a file using bash loop?

ckim@ckim-ubuntu:~/test$ cat tt #define a b #define c d ckim@ckim-ubuntu:~/test$ for i in `cat tt`; do echo $i; done #define a b #define c d The $i variable is taking every single word seperated by ...
-2
votes
1answer
17 views

Struggling in the best part of my code at trying to save and load json data

I have a nested dictionary that i'm trying to save to json file and then reopen again, I'm failing at the last part. My code could be: myfile=open('myfile','r+')[1] dic=json.loads(myfile.read()) dic....
0
votes
0answers
4 views

Saving Files In Kdenlive to removeable media

I’m having trouble with with my files in Kdenlive. I can’t find my files through Kdenlive. They just don’t show up. I have been able to load them into Kdenlive by dragging them into Kdenlive using ...
-5
votes
4answers
72 views

awk command or script to calculate daily and hourly salary for employees

I have a text file with several employees. The text file follows this scheme. EmployeeName Department 20.00 I need an awk command with a variable that will calculate the daily salary. I also need ...
2
votes
0answers
43 views

Compare zip file and extracted directory

What is the simplest way to compare a zip file and a directory that has been extracted from the zip file? I would like to delete the zip file if they are the same. Example. Need to check if Archive....
1
vote
0answers
52 views

How to open and maintain a modifiable buffer in bash

I currently have a script that I am using multiple functions to do my own smaller templating system upon that pulls various configurations from a configs directory. I understand that this is an ...
1
vote
1answer
62 views

I need creation date and time of file in Linux [duplicate]

I need to creation date and time of file in linux. I have tried below two command but did not get any output. sudo debugfs -R 'stat <inode_no of file>' "mount point name". This gives ...
0
votes
2answers
57 views

Help with sed command

I need a sed command that will allow me to search for and display the info for all games released in the 1980's and alphabetize those results. Is there a good way to do this with only using sed? 1 ...
1
vote
0answers
28 views

inconsistency between fuser and /proc/$PID/fd

I wanted to find out what prevents the root filesystem on a certain from being remounted read-only. fuser -vm / found a few files which are supposed to be opened for writing. For example: root ...
4
votes
1answer
360 views

How do I tell which process is chown'ing my file?

I have a file that should be owned by a regular user being chown'ed to root by something approximately every 4 and 20 minutes past the hour. How can I tell what is doing this? There doesn't seem to ...
0
votes
3answers
66 views

find/detect file name goups

On fs i have files like: PREFIX_GROUPNAME_OTHERNAMES[.txt|.*] eg: A_ABC_A.txt A_ABC_B.txt A_ABC_C.txt A_XYZ_A.txt A_XYZ_B.txt A_XYZ_C.txt For some futher tasks i want to get the group names. $# ...
-1
votes
1answer
51 views

Tab completion error: bash: cannot create temp file for here-document: No space left on device

I am absolutely new to Linux. I downloaded 50GB of data on the server disk via SSH. Then I deleted them using midnight commander. Now, the tab-completion doesn't work, and it is giving me the ...
1
vote
1answer
35 views

Copy multiple .txt contents into single file based on character length

I'm looking to find the largest file within a directory by character count, copy its contents, delete the file and then paste this to another file elsewhere with the end goal being that every file (...
1
vote
1answer
38 views

How to display a sorted list of files that contains certain string in linux terminal

Assume I have 3 folders in different directories, some of them containing some more subfolders, and in each folder/subfolder I have text files named test1, test2, test3 etc..., which contain the ...
2
votes
2answers
41 views

How to get the difference between files

I've found other links on the stackoverflow communities that were similar but they didn't answer my question exactly. I have 2 files with a different number of lines BUT I have them both sorted. My ...
5
votes
8answers
821 views

How to get names of the files which contain the specified text only

I have a directory named "labels" in which there are text files which contain labels for "cat" or "dog" or both on separate lines. Contents of files in labels directory ...
0
votes
2answers
35 views

How to create a file of X bytes that will not compress with zip

I am load testing an application that is essentially an upload/download request/reply. Upload a file, zip the file, send the zipped file somewhere. I want to load test it by sending files of X bytes ...
0
votes
0answers
20 views

"82635.080657" - secondary_startup_64_no_verify+0xc2/0xcb | Will not shut down

I am shutting down from a Fedora34 and the shut down process has been halted at [82635.080657] - secondary_startup_64_no_verify+0xc2/0xcb The cursor is not blinking but is showing. Now before I shut ...
3
votes
0answers
122 views

NFS filesystem 100% full - 'No space left on device' error, cannot remove or truncate files

I'm getting a No space left on device error when I try to remove or truncate a file on a Ubuntu server. This seems to be because the NFS filesystem is 100% full and all inodes are used. Running df -T ...
0
votes
1answer
32 views

What exactly is a single "atom" in a standard stream in linux?

Conceptually, a stream is a sequence of "characters" or "atoms", i.e. a binary stream is a sequence of 0s and 1s. But in Linux standard streams, if I write a bash script that asks &...
0
votes
1answer
43 views

fdisk: unsupported wipe mode

I am trying to create a new partition fdisk -W /dev/mapper/nvmeVg-var but keep getting fdisk: unsupported wipe mode nvmeVg-var is a part of an lvm When I fdisk /dev/mapper/nvmeVg-var I get The ...
0
votes
0answers
48 views

Recover disk space lost by ZFS and Syncoid / Sanoid -- please help

Long-time reader, first-time poster here. Being new to Linux I've perhaps stupidly (given my level of expertise) allowed it to install with the ZFS file system. This seemed nice initially because it ...
1
vote
1answer
73 views

Delete sub-directories based on matching information from column

I want to keep only those sub-directories that are present in the corresponding directory from CSV file. The file structure looks something like this: 100_folder/ ├── folder_11 ├── folder_25 ├── ...
0
votes
4answers
73 views

How to loop through all files in the current and sub directories to find a string? [closed]

Hi I am trying to loop through a directory and all its subdirectories to find the string 'foo' in all the files, for example. I then want to display the file names (including full path) of all files ...
0
votes
0answers
12 views

How do I recursively cut an audio file automatically?

Okay so to begin. I'm developing a game however the sound engine that it uses is not advanced and dose not allow sounds to be paused, sounds can only played and stopped. I can not change this sound ...
0
votes
1answer
58 views

Reading in a copy of `/usr/share/dict/words` is 10x slower than the file itself

I was experimenting with dictionary implementations in C and found /usr/share/dict/words to be a pretty good file for testing. For whatever reason, I wanted to make a copy of the words file into my ...
1
vote
1answer
20 views

How can I download specific files recursive, while maintaining folder structure?

So, I just downloaded a several folders using rsync, it went something like this: rsync -rzP user@domain:/mnt/file_direction /mnt/Downloads/Files This worked well for a massive download, however, now ...
1
vote
1answer
17 views

Wrong file ordering in MySQL Docker image with Debian as base

My problem is relatively simple as I try to make a migration with the help of the Flyway CLI. The problem here is, that the system orders the migration files in the wrong order and my new file isn't ...
0
votes
1answer
45 views

Conversion of files into directories, and the possibility of changing them back

Basically what happened is due to a known bug with duplicity I had to manually extract the difftar archives (Difftarchives?) Imagine my shock and slight horror when I saw that many files that ought to ...
3
votes
2answers
323 views

How to rename multiple files by changing one component of the file name?

I found lots of questions about how to rename multiple files using the command line. However I am not able to solve my specific issue which is renaming this file name: ...
5
votes
4answers
341 views

swap files instead of cp with temp file? [duplicate]

There is this famous entry level programming exercise where you're asked to swap two variables. The obvious solution is to use a third, ephemeral variable. But if your language has something like ...
-1
votes
1answer
64 views

Check if there exists filename in directory

I have one file contains people name, like Sam Tom Dad Jack I have one directory that contains name.txt or name.zip which file's form is not the same, like Dad.txt Tom.zip Jack.zip How to find sam ...
-6
votes
1answer
61 views

Who is responsible for /usr/share/dict/words ? (slurs found)

I am writing an application that makes use of /usr/share/dict/words file to generate session keys. I was appalled to find that the most egregious of ethnic slurs - the 'N-word' (in different spellings)...
0
votes
0answers
7 views

File specifications & information given by balooshow

KDE Plasma's Baloo returns some file information via balooshow. However, I am not sure what the first two numbers stand for (the third is the inode). Can anyone shed light on this? $ balooshow -x /...
0
votes
1answer
45 views

echo > file complains file does not exists

I have a virtual machine running and its root directory mounted to in ./vm I have this script running on the virtual machine: #!/usr/bin/env bash flag=/dir/flag echo "Listening..." while ...
-2
votes
3answers
78 views

Why I can't move the content of a directory (including hidden files) to a file using only echo?

I have a directory named Musique and I want to have the list of files saved to nom.txt using ONLY echo. However I also want to copy the directory's hidden files and separate them from the "normal&...

1
2 3 4 5
93