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
2answers
54 views

How to ignore part of a filename

Sorry if this question has been asked before. I am new to all of this. I would like to concatenate all files from different folders that contain R1 at a specific position in their filenames. My ...
142
votes
5answers
192k views

Understanding of diff output

I have file1.txt this is the original text line2 line3 line4 happy hacking ! and file2.txt this is the original text line2 line4 happy hacking ! GNU is not UNIX if I do: ...
0
votes
2answers
65 views

How to concatenate 12000 files into 4 files based on first line?

I have 12,000 files in a folder that have a similar naming convention because I used csplit on a larger file. I need to sort these files by the first line in the file, and concatenate the similar ones....
2
votes
0answers
30 views

Is there a way to “map” multiple files into a single file, without writing to disk or RAM?

I've been thinking about different ways files could be hidden, and while encryption is excellent at hiding the contents of files, they're not really good at hiding the fact that files exist. In the ...
0
votes
1answer
30 views

How to edit a file that only exists on the web? (Debian Linux)

I play minecraft on an HP Chromebook 14. When I look up, "How to turn up gamma without mods", it tells me to go to ".minecraft" and find a file called "options.txt". I ...
1
vote
2answers
190 views

Files holder application like dropover and yoink for Mac

I've recently switched back from macOS to Linux Mint. The only thing I miss about Mac is having a utility that could hold my files for copying and pasting while I switch between the desktops. Yoink ...
14
votes
3answers
3k views

Is that possible to integrate zip and tar.gz files as directory into the file system

I wonder if there is a way to integrate (it's a bit different from mounting, I think) compressed files as directories into the file system? E.g., one could download a compressed-file.tar.gz to his ...
3
votes
1answer
468 views

Two supposedly same M4A files are giving different hash results. Why?

Two files containing same song, both in M4A format, output two different results when I calculate their hashes: md5sum f149e2d2a232a410fcf61627578c101a new.m4a ad26ed675342f0f45dcb5f9de9d586df old....
-1
votes
1answer
44 views

How to compile lines with a certain word in the last column into a separate file?

I have a csv file and I need to filter it out into two files based on whether the last column contains the word "ecDNA". I already have two more copies of the file to edit without changing ...
0
votes
1answer
18 views

Empty many folders into into single folder? [duplicate]

I've tried Googling this but I only get answers relevant to Windows. I've got a series of folders, for the sake of example I'll say ~/Downloads/abc ~/Downloads/def ~/Downloads/ghi etc. What I would ...
0
votes
0answers
24 views

Share files and folders between Mac, Windows and Linux

I've read a lot about this but I want this a little bit different. The articles about FTP and folder sharing all needs a specific software at both end hosts like SAMBA. But I want to connect the ...
9
votes
3answers
13k views

Can we merge binary files without any copy operation by handling filesystem?

I would like to merge efficiently binary files using a shell command and I quickly found classical ways like this one : cat file1 file2 > file3 Not bad but : It's slow. IO access are slow. It ...
0
votes
1answer
1k views

How to execute genymotion?

I just downloaded an Android Emulator and it downloaded as genymotion-2.3.1_x64(1).bin-- how do I open that? Install it?
0
votes
1answer
24 views

after installing a new distribution I don't have access to my previous Home partion files

after installing a new distribution I don't have access to my previous /home partition files but about 121 GB of volume is full also If I try live mode I can see them. I tried:ls -la in /home ...
38
votes
6answers
134k views

Cannot remove file: “Structure needs cleaning”

I have an external hard drive which is encrypted via LUKS. It contains an ext4 fs. I just got an error from rsync for a file which is located on this drive: rsync: readlink_stat("/home/some/dir/...
1
vote
3answers
55 views

Sorting and copying files

I am newbie here, please be patient. I have a directory containing thousands of files. Filename always start with 1 or 2 letter and have 4 character before underscore "_". The number of ...
1
vote
2answers
24 views

rsync files across multiple user accounts

I am quite new to using rsync and I'm wondering if it is possible to rsync files across multiple user accounts on a single PC? For the computers I want to apply the rsync command to, each user has to ...
0
votes
2answers
64 views

What does mounting do in Linux and why do files appear in both /dev and /media after mounting?

I'm pretty new to Linux and I've been trying to understand how the file system works but I just can't seem to get what mounting is. I've seen several other questions on this site explaining but they ...
118
votes
7answers
55k views

How are “/dev” Linux files created?

There are special files in Linux that are not really files. The most notable and clear examples of these are in the dev folder, "files" like: /dev/null - Ignores anything you write to the file /dev/...
0
votes
1answer
87 views

Regex for a non-fixed pattern

I am trying to come up with the right regex (compatible with python) that would match a file that contained sample input as follows: On the third day of Christmas my true love sent to me: three ...
0
votes
2answers
92 views

Can not change the user owner of a file

I'm running Ubuntu under Windows. I have a file which is owned by a user named leon: -rwxrwxrwx 1 leon leon 0 Jun 8 20:25 linux1.txt but for some reason, I can't change its owner by running (...
2
votes
2answers
32 views

In a file to find and replace/change multiple strings in a line with shell script

I am new to shell scripting What I have is a log file, each line begins like the below entry, [2021.04.27.17:03:43.813]: ERROR - [2021.04.27.17:04:36.790]: SUCCESS - The desired output to a new file ...
0
votes
2answers
65 views

bash: Read from stdin until a string delimiter

Let's say I have two files containing arbitrary bytes: ./delimiter and ./data. I want to read from ./data up to and excluding the first occurrence of the byte sequence in ./delimiter. How would I do ...
2
votes
0answers
25 views

Tool for clearing build directories (different programming languages/frameworks)

Aside from writing own scripts, is there some kind of CLI tool that can scan target folders or volumes and delete build artifacts or recreatable dependencies with support for different programming ...
2
votes
1answer
2k views

Locate and manage files on extern hard drive through FileZilla over SSH

I have installed Debian Server on one of my servers and plugged in a extern hard drive to it through USB (sdb1, 2, and 5 on the image below) where I have all my files on right now. Before I used this ...
12
votes
8answers
9k views

sed in-place line deletion on full filesystem?

Due to an application bug as yet undiagnosed, I have several hundred servers with a full disk. There is one file that has been filled up with duplicate lines—not a log file, but a user environment ...
0
votes
1answer
84 views

How to limit the number of files in a directory?

Is it even possible to limit the number (and not the size) of files in a specific directory? My directory only can contain up to five files, and cp file_6 mydir must not be allowed.
3
votes
2answers
104 views

Parent child directory same name , move files to parent directory

I need a way to search directories for child directories with the same name and then move all files in the child directory to the parent. Thus from /recup-dir1/recup-dir1/files to /recup-dir1/files. ...
24
votes
3answers
22k views

viewing dll and exe file properties/attributes via the command line

I have a need to see some additional file properties for exe and dll files. If I open windows explorer and add the additional columns to my view, I can see things like Company, Copyright, Product ...
2
votes
1answer
24 views

How can I move files to different directories depending on their contents?

I have many files which contain a string like this: /databis/defontis/Dossier_fasta_chrm_avec_piler/SRR6237661_chrm.fasta: N putative CRISPR arrays found Where the N is a number that can be either 0 ...
2
votes
1answer
39 views

Reading stale file data with debugfs cat

I'm trying to read the contents of a file using the file's inode. This works fine: echo "First line" > data.txt sync sudo debugfs -R "cat <$(stat -c %i data.txt)>" /dev/...
6
votes
4answers
1k views

In Linux, is there a system layer/script that handles the opening of files?

in Linux, is there a layer/script that handles program-requests to open files? Like when you open a file-descriptor in bash: exec 3 <>/documents/foo.txtor your text-editor opens /documents/foo....
1
vote
1answer
99 views

How does the OS access files stored on the hard disk?

I know the first thing the OS accesses on the harddisk is the superblock. But then what?
4
votes
1answer
51 views

Bad byte count while using hexdump

I am trying to display a binary file with records consisting of: 8 bytes unsigned int 4 bytes unsigned int 4 bytes unsigned int 4 bytes unsigned int 4 bytes unsigned int I try to display it using ...
0
votes
2answers
24 views

File listing in SFTP doesn't synchronise

I have a SFTP account that I use to store files. It works fine, but when I am using lftp on connection A to look at the files, and connection B to store files, connection A does not reflect any ...
0
votes
2answers
43 views

How should btime be specified?

I have read that Unix systems has not specified btime or generally like POSIX, there is no specification about btime. There is a mention about btime. Therefore the question, how should btime be ...
56
votes
3answers
268k views

Changing a file's “Date Created” and “Last Modified” attributes to another file's

I'm using merge cap to create a merge pcap file from 15 files. For the merged file, I have changed the name to that of the first of the 15 files. But I would also like to change the merged file's ...
1
vote
2answers
51 views

How to create a temporary file that has “normal” permissions?

In a build script I want to create a temporary file that has a unique generated name, then write some data to it, and then rename that file to its final name (the reason for this procedure is that I ...
42
votes
6answers
67k views

How do I shorten the current directory path shown on terminal?

If I am in a deep directory, let's say: ~/Desktop/Dropbox/School/2017/C/A3/ then when I open up terminal, it says bob@bob-ubuntu:~/Desktop/Dropbox/School/2017/C/A3/$ and then I write my command. ...
0
votes
2answers
54 views

Reshaping tab separated file

I have a file that looks like this: Time Flag 0.65 5.885581e-01 0.56 5.847484e-01 0.58 5.278409e-01 0.57 1.140746e+00 1.00 0 0.00 0 1.00 1 0.00 0 But this is because I ...
0
votes
2answers
2k views

find and replace with the value in another file

I have two files with different formats with columns tab spaced. I have to compare the columns column1, column2 of file1 with file2. If they matches, I need to replace the value in column6 of file1 ...
192
votes
8answers
26k views

Why is looping over find's output bad practice?

This question is inspired by Why is using a shell loop to process text considered bad practice ? I see these constructs for file in `find . -type f -name ...`; do smth with ${file}; done and for ...
0
votes
1answer
84 views

How do I copy a file to the clipboard with the terminal?

I'm aware of how to copy the contents of file: xsel -b < myfile.txt But this is not what I want. I would like something like this: ./file2clip.sh myfile.txt Which would copy myfile.txt to the ...
0
votes
1answer
42 views

Why isn't tail command tracking the changes in a file in realtime? [duplicate]

When I track a file in realtime using descriptor i.e tail --follow=descriptor file_name, it doesn't show the changes made in the file, whereas if i track the file in realtime using name i.e tail --...
0
votes
2answers
63 views

If files are copied from a first volume to a second volume, will the files stay the same?

When I connect the external hard drives to my computer(with FreeBSD or other Unix systems) and copy files from the first external hard drive to the second hard drive, are the files on the second hard ...
1
vote
0answers
38 views

Is there any tool in linux that can monitor two folders in real time?

Is there any tool in linux that can monitor two folders and have the contents of folder a synced to folder b in real time?
0
votes
2answers
36 views

Compare the times of different files using shell script

I have a file with below contents. Here i need to compare the timestamp of HIW.ear in the first line with the timestamp of .jars from the second line and i am running out of ideas on how to do this. ...
0
votes
2answers
45 views

Compare content of two folders/disks (including timestamps,permissions)

I have two directories on two different hard drives and want to check if the content is really exactly the same. From what I read I can use diff -rq dir1 dir2 to check if files are missing or differ. ...
1
vote
2answers
26 views

How do I output the unique lines from a grep pattern match while ignoring other parts of the line?

Suppose I have a file called names.txt, which contains a list of names and corresponding emails of people in the following format: FName1 LName1 <random1@test.com> FName2 LName2 <random2@...
53
votes
4answers
94k views

How to find all binary executables recursively within a directory?

If I use find command like this: find /mydir/mysubdir -executable -type f all executable files are listed (excluding directories), and including executable script file (like script.sh, etc). What I ...

1
2
3 4 5
91