Logical entities that contain data in a filesystem. Use this tag if your question: is about programs that create files (e.g. gzip, tar, zip); deals with characteristics of files (permissions, size, path/location); or is about management of files (renaming, listing, moving, removing). For operating ...

learn more… | top users | synonyms (1)

0
votes
1answer
38 views

Explain the output of realpath [closed]

I am trying to use the command line to return the absolute path to a file. I read that there are multiple ways to go about this, namely the realpath, readpath -f, and locate commands. None of these ...
2
votes
1answer
35 views

How to store endless stream to file?

Let's have any stream of binary data (like /dev/random, /dev/zero, etc.). Let's have a file which size can be N at maximum. Let's the N is in order of gigabytes. Is there any elegant method/...
1
vote
1answer
28 views

Is it possible to pipe into dirsplit?

I'm trying to figure out the "Linux way" of accomplishing the following task. I have a directory with a bunch of sub-directories, each of which contain multiple files of various filetypes. I can ...
2
votes
4answers
56 views

How to delete all duplicate hardlinks to a file?

I've got a directory tree created by rsnapshot, which contains multiple snapshots of the same directory structure with all identical files replaced by hardlinks. I would like to delete all those ...
4
votes
2answers
67 views

Rename Multiple files gzips them and delete older than 10 days

I'm new to Linux/Unix and slowly learning it step by step. Unfortunately on today’s job interview was surprised by a task to do (which of course I didn’t know). I was asked to prepare a bash script ...
2
votes
2answers
45 views

Incorrect permissions on special files

I've noticed a lot of special files on Linux have what appears to be incorrect permissions: E.g.: $ ls -l /dev/fuse crw-rw-rw- 1 root root 10, 229 May 29 09:59 /dev/fuse appears writable but in ...
2
votes
1answer
48 views

Stop user from deleting file in directory

This is the scenario There is one directory /test which is owned by oracle.dba I created new user TEST who will have permission to create NEW files but it should not be able to delete the files he/...
5
votes
0answers
49 views

Why group-writable file works “unidirectionally”?

Users vi and rust share group rust and want to use some file in shared manner. rust$ ls -l myfile -rw-rw-r-- 1 vi rust 0 May 30 03:48 myfile rust$ stat myfile | grep Gid Access: (0664/-rw-rw-r--) ...
2
votes
1answer
102 views

How to sort files separately without merging?

File1: Brazil New Zealand Argentina Uruguay File2: Chile Russia Latvia Switzerland I realize that the command sort -n File1 File2 will sort all the files merged together and display it ...
-1
votes
1answer
33 views

How can I successfuly port W10 files to Ubuntu? [closed]

I just installed Ubuntu (Dual boot with W10) and I can see my W10 partition from inside Ubuntu with all my files. They seem fairly corrupt on the Linux side (Text editors, web browsers, Steam etc) ...
1
vote
1answer
25 views

Finding change in shared object through bash

Here's my case- I have a package named say foo-1.2.3. I want to know which package it installs. So, I install it in a fakeroot approach and make a list of all files it install in a file called FILES ...
2
votes
2answers
86 views

search contents of files that are packed in a zip file

For my school project i have to create a script that allows you to search the contents of files that are packed in a zip file. You can give a "search string" with the script, followed by one or more ...
1
vote
2answers
34 views

Copying Files before They're Finished Transferring [closed]

Using Ubuntu 16.04 ext4, especially for chrome downloads. Can you copy files while they are not finished transferring?
0
votes
1answer
48 views

How to merge or join more than 2 files? [duplicate]

I have four files; file1: gene_id FPKM TRINITY_DN56960_c4_g1 36.91 TRINITY_DN42427_c0_g1 12.83 TRINITY_DN48728_c0_g1 6.22 TRINITY_DN50706_c0_g2 6604.75 TRINITY_DN51449_c1_g1 8.19 ...
0
votes
0answers
72 views

Count and compare files in Linux

I want to just compare the number of lines in two files. Below is the list of names of files. One file contains names/location of fastq files; the other file contains names/location of bam files. ...
0
votes
2answers
44 views

How can I copy a hidden directory recursively and preserving its permissions?

mkdir backupcache cp -rp .cache backupcache # or cp -rp \.cache backupcache does not work nothing gets copied and directory backupcache remains empty
2
votes
2answers
71 views

find command, is there a way to get a progress report?

firstly please forgive my lack of knowledge of Unix - that's why I'm here after all. I've created an AppleScript which searches for files on a Mac and have greatly improved the speed by using the ...
1
vote
2answers
53 views

How to determine which files are necessary in /bin, /lib, /var, etc.?

I'm currently trying to get an image working for a network boot using somebody else's file contents. The previous images I made keeping all original files present were way too big, so I need to shrink ...
-1
votes
1answer
27 views

Move all sub-directory content up one level

My top level directory contains a bunch of sub-directories: af ar ca cs da de el en ... (lots more) Each of these directories has the exact, same structure. They contain two directories: v2.3.0 ...
1
vote
1answer
23 views

Delete old package versions within a backup folder

I have a folder that contains a large number of tar.xz packages that have their version number in their filenames . ex : vlc-2.2.2-3-x86_64.pkg.tar.xz (old and should be deleted) vlc-2.2.3-2-x86_64....
1
vote
0answers
32 views

rhel - file modification logs

I found a strange file in my /home/user named FireZeMissiles1111.tmp. I am the sole user and did not create it, so it is kind of suspicious. It may have been left there by a program who's programmer ...
1
vote
1answer
49 views

Why are given file sizes slightly different between Windows and Linux?

I have just transferred (via scp) a bunch of .gz files from a Windows machine to my Linux machine. They are large files so I checked they had transferred entirely by comparing file sizes. Those that I ...
1
vote
2answers
82 views

search for files with specific text and copy these files to another directory

Relatively new to unix and still learning -- How do I search for files in a directory that contain a specific text and copy them to another directory ? I am using .ksh shell.
0
votes
1answer
54 views

Validate user response in shell script

My shell script is working fine and the files are copying to the remote directory. However I need to check if my INPUT_STRING is starting with S and also check if the files are present in the ...
0
votes
0answers
20 views

Assign a name to an inode [duplicate]

As far as I can tell (from what lsof tells me), once a file is opened by a process, I can rm it and the process will still be able to access it, because at that point all that counts is the inode. ...
1
vote
1answer
62 views

copy huge number of files into date structured directory order

I need to copy around 40.0000 files into date structured folders. example file: /var/public/voicelogging/quality_monitoring/20151209/bbbbbb_I_20151209-185841_xxxxxx_12434_89343.WAV Is one of the ...
1
vote
4answers
85 views

Bash script to fix file names

I have hundreds of folders with thousands subdirectories and files inside of them. The file names are currently in the format sf{number}-{number} - {text} and I need everything deleted until {text}....
13
votes
2answers
676 views

dd: write to multiple disks?

I have 2 exactly same formatted, same size and same brand SD-cards. I would like to dd image to /dev/disk2 and to /dev/disk3 at the same time. Pseudocode sudo dd bs=1m if=/Users/masi/2016-05-10-...
2
votes
1answer
33 views

Find differences of ownerships between two home folders?

I have two home folders: /home/masi and /home/masi_backup and I would like to find the differences between files of the two directories. Pseudocode vimdiff <`ls -la /home/masi` <`ls -la /home/...
0
votes
2answers
39 views

Copy and rename on collision

I'd like to merge the content of these folders with a command line. . ├── folder1 │ │ file.txt │ ├── folder2 │ │ file.txt │ └───folder3 │ file.txt How can I do this ?
1
vote
1answer
32 views

Compressing a folder but do not compress specific file types but include them in the gz file

I am using tar with pigz to compress a folder and save a backup. Size of this folder ~250 GB or more. This folder has variety of content including numerous text and log files, ISOs and zip files in ...
0
votes
0answers
19 views

burn ISO + save other files

is it possible to burn a linux installer on a flash drive with rufus on my 8gb flash and then after the ISO finished burning, just copy paste in 1 folder some other files. And then the istallation ...
0
votes
0answers
39 views

hidden directories to ls (not dot prefixed file)

I'm facing with a uncommon issue, which is: After btrfs read failure and a btrfs check --repair on my partition mounted in /home, it seems that some directories have disappeared. I explain : When I ...
1
vote
4answers
59 views

How to gather the name of the files in each subdirectory into a text file in that subdirectory?

I wanted to save the names of all files in each sub directory into a text file in that sub directory, so I wrote this script: #!/bin/bash for X in "$PWD" * do if [ -d "$X" ]; then ...
3
votes
1answer
27 views

What are semi-files?

I'm reading a paper about Android/Linux. It contains a line I'm not able to understand. I tried searching about "semi-files" but nothing relative came up. Can someone please rephrase it or explain it ...
0
votes
1answer
64 views

inserting modified date into filename - 2 cases

I believe I'll ask two separate questions, but the context is the same, so I hope it's alright. I have an output of few processes as presented below (which I can't modify). 25978.csv 26044.csv 26865....
0
votes
1answer
23 views

Retrieve text from a large file using a smaller matching header

I need to extract the text between two headers, if the first one matches with a source file for lookup the headers to search, example: &Header1 ...
3
votes
4answers
426 views

Bash script detecting change in files from a directory

I am a beginner in bash scripting and I am trying to make a script that detects if any of the files in a directory were changed within a 2 seconds interval. What I have so far is: #!/bin/bash for ...
0
votes
1answer
33 views

How to manipulate a file descriptor in another process? [duplicate]

Is there any way to manipulate (read, write, etc..) a file descriptor for any app which can be found in the path /proc/{pid}/fd? Especially for sockets. $ ll /proc/4229/fd total 0 lrwx------. 1 ...
1
vote
3answers
106 views

How can I compare different files without opening them?

I have two directories A and B; each one contains a lot of sub-directories geom001, geom002 ....etc each sub-directory contains a file named results. I want to compare, without opening any of them,...
3
votes
3answers
65 views

How can you move or copy specific files from a list of text files

So I have a directory of like 200 of the the following types of files: gre_6_c1_d34567.h3 gre_6_c1_d95543.h3 gre_6_c1_d42354.h3 gre_6_c1_d01452.h3 gre_6_c1_d23168.h3 gre_6_c1_435435.h3 The only ...
1
vote
4answers
41 views

rename the 10 most-recently modified files on AIX

I have some .xls files in a defined directory (say in /A/B). I want to rename top 10 latest files and append "-bkp" in their names. I tried, not working ls -lt *.xls | head -1 | awk '{print "mv " $9 ...
1
vote
2answers
59 views

Process several files and print filename without extension and the value of a specific key

I have ASCII file and I want to output the file name and a specific field from this file beside each other. For example: The contents of the ASCII file "data1.txt" is as follow: Name: John Age: 90 ...
1
vote
0answers
53 views

What is a “file header” in Linux file systems?

The following sentence appears in an article in the web: All cryptographic metadata is stored in the headers of files, so encrypted data can be easily moved, stored for backup and recovered. ...
3
votes
2answers
95 views

find latest file created in folder and grep contents

I have a need to search a certain folder for the newest created file and grep the contents for a pattern. I have had ok success so far using this command: find /var/log/folder -type f -printf '%T+ %p\...
1
vote
1answer
48 views

Find All images file size and width in directory

I'm trying to find all .png .jpg and .gif files in my directory. I'm getting the file sizes properly but unable to get image width (I'm using imagemagick) in log file. Script code #!/bin/bash for d ...
-8
votes
1answer
28 views

What does it mean when Linux states “the directory does not contain all necessary files”? [closed]

Copy all the files from the directory /usr/local/linuxgym-data/gutenberg whose names contain the string s2 into your ch4-pipewild/s2 directory. mkdir s2 cp *s2* /usr/local/linuxgym-data/gutenberg I ...
-3
votes
1answer
42 views

How can I treat my disk like one big file?

I was reading about device files in FreeBSD, but my understanding is not great. To practice, I thought up the following scenario. I suspect that the problem can be solved using device files. Imagine ...
1
vote
1answer
56 views

Pass a list of URLs contained in a file to curl

I have to set ACL on a multiple files. I have downloaded a list of object stored using below commands. C:\Users\Gshrivastava\Downloads\curl_748_0>curl -o urlname.csv -i -k -H "Authorization: ...
1
vote
1answer
28 views

Is there any ways to copy all file to one specific sub-folder under the same parent-folder? [duplicate]

So for example i have one folder called "test". Inside that folder, i created one another folder called "player" and a lot of text file, let's say 50 files. [root@ip-10-0-7-70 test]# ls kaka.txt ...