Use this tag for questions about file management and operations on files.

learn more… | top users | synonyms (1)

0
votes
2answers
26 views

Search for a non exact match and return column 1 of that file

I have a tab seperated file which looks like this: Adam Group1,Group2,Group8,Group9,Group10 James Group1,Group11,Group12,Group7 Kelly Group18 Alfred Group1,Group8,Group10 Manuel ...
2
votes
3answers
50 views

Recursively delete files with 'WIDTHxLENGTH' in the name in a directory

I have a directory that has subdirectories, and I want to delete images named like thumbnail-name_WIDTHxLENGTH.{jpg,png}, where WIDTH and LENGTH are both decimal integers, like box-image-150x150.jpg ...
1
vote
3answers
131 views

Move files up by a directory by depth criteria

I have a directory tree that looks like this (simplified, in truth there are hundreds of folders): . ├── a │   └── b │   └── a.h5 ├── b │   ├── b │   │   └── e.h5 │   └── c │   ├── a.h5 │   ...
0
votes
5answers
94 views

Find all [filename].mp4 and rename [filename].audio [duplicate]

So I have a script that adds 2 films together using the audio from the $1.audio file. What I would like to do is rename any file in the directory with: *.mp4 To: *.audio Keeping original file ...
4
votes
3answers
223 views

How do I find all square images in a directory

The images are stored in JPEG and PNG files. I want to get a list of those of them that are square.
0
votes
2answers
28 views

changing the numbering of several files

I have 456 files with the format like aaa_0.plt aaa_2.plt ... aaa_455.plt I want to change them so that the numbers starts from 910 and I would have aaa_910.plt ... aaa_1365.plt
11
votes
5answers
679 views

Test if File was Modified After Date in File Name

I have a files named with YYYYMMDD in the file name, such as file-name-20151002.txt I want to determine if this file was modified after 2015-10-02. Notes: I can do this by looking at the output ...
2
votes
5answers
127 views

Rename files not directories

I want to rename all files to lowercase in a directory without renaming subdirectories. I know rename function but it renames files and subdirectories which is not desired. Can you help?
2
votes
0answers
60 views

I can't delete a file from EFI System Partition

I'm trying to delete a file since I installed rEFInd instead or Grub, I want to remove Grub or just remove "grubx64.efi" from my ESP, to make it disappear in the rEFInd boot screen. I can mount my ...
1
vote
1answer
27 views

How can I update the database of files on the system daily? [closed]

What is the command that I should execute daily to update the database of all files that are on the system?
1
vote
1answer
28 views

Only color files according to file types? [duplicate]

When using ls to list files in a directory, the files are colored according to their access permissions. Is it possible to color the files only according to their file types (e.g. a regular file, a ...
1
vote
5answers
76 views

Remove repetitive entries from a file

There is a file with a couple of identical and repetitive entries, which looks something like this: 123 abc nhjk 123 abc cftr 123 abc xdrt 123 def nhjk 123 def cftr 123 def xdrt If the combination ...
2
votes
1answer
17 views

How can I delete a former MTP directory, which now gives me input/output error whenever I try?

I have ~/srv/mtp, which I do not remember how I created. It was back when I was trying to set up a MTP mountpoint using various tools for that. Currently I can't do anything to the directory. ○ file ...
1
vote
3answers
69 views

Downloading a few thousand files - how?

I want to download a few thousand files one by one. The average size of each one is 5-10Mb. Each has a name of "name_{i}", where "i" is a counter. What's the easiest and best way to do that? Note ...
2
votes
2answers
42 views

How to delete files if a numerical part of their name is greater than a given number?

I've got files like this: cap_20151023T122915_791033959.png cap_20151023T122918_946392456.png cap_20151023T122920_227637228.png cap_20151023T122920_875467456.png and I would like to use the find ...
1
vote
2answers
48 views

Stack data from multiple delimited files into one, with variable columns

I'm new to scripting. Got struck with a file merge issue in Unix. Was looking for some direction and stumbled upon this site. I saw many great posts and replies but couldn't find a solution to my ...
2
votes
1answer
36 views

Why grep shows different results when I use file1 as a pattern on file2 and viceversa?

When I run grep -m 1 -Fnxvf file1 file2, for some couple of files I get a different line number than running grep -m 1 -Fnxvf file2 file1 (swapped files). Why? I've reduced the files to a minimal ...
2
votes
2answers
40 views

Delete file while it is in use

I have a process that receives a video file (RAW) and transcodes it with FFMPEG generating three (different resolutions) resultant files. I'm using a distributed task queue system (Celery) to process ...
3
votes
4answers
202 views

How can I pad lots of file names with zeros in a directory?

I just wrote a script that generated hundreds of files and stored them in a directory ~/foo. These files are ~/foo/X-file where X ranges from X=1 to X=900. My problem is that I would like to view ...
0
votes
1answer
58 views

how can I create two files with same name with different case in mac osx

I can't create two files with same name with different cases in a folder. as an example if file names are like below. test.java and Test.java. warning message appear that saying The name “Test” ...
1
vote
0answers
18 views

RHEL / SELinux - Apache unable to write to a directory it can write to [duplicate]

I have a RHEL 7 machine running an Apache web server with multiple virtual hosts on it. I've recently run into an issue where I am unable to upload media, e.g. images / pictures / video, to my machine ...
5
votes
1answer
58 views

Locate owner of a computer on file system

I am trying to locate the owners name from a computer that was turned in, in order to return it. I am unfamiliar with Linux, and would prefer if I could be directed to a location in the actual file ...
0
votes
1answer
129 views

file with permission lrwxrwxrwx does not show any link on “ls -l” command

lrwxrwxrwx. 1 tomcat tomcat 27 Oct 17 00:23 work This is my file(link) I want to go inside a directory within it to rm a file and then copy the new one. But it says permission denied and does not ...
10
votes
2answers
517 views

How to redirect the output of a command to an already existing file without deleting its contents? [duplicate]

I am making a backup of some files and am creating a checksum file, checksums.txt, to later check the integrity of my data. However pasting each checksum manually into the file is inconvenient since ...
2
votes
4answers
77 views

Copy files to new directory only if name of file is in an array

I'm not much of a zsh buff but I imagine this should be an easy layup for someone: I can bulk copy files from sourcedir to targetdir with the following: $ find sourcedir -type f -exec cp {} ...
28
votes
5answers
2k views

What is the point of mv -f

The GNU Coreutils manual for mv says: -f --force Do not prompt the user before removing a destination file. However, this already seems to be the default behaviour for mv, so the -f option appears ...
0
votes
2answers
30 views

Is there a method to make Multipart or Virtual Files?

Is there a method of creating a symbolic file that refers to the contents of a directory? So for example, calling: cat all_keys would give the same output as: cat keys/key1+keys/key2+etc... I've ...
1
vote
3answers
102 views

using grep and wc commands to solve a problem

I am trying to figure out how to count the number of lines in file.txt that have at least ONE number or digit. So far I figure will count the amount of lines: wc -l filename.txt I then figure this ...
1
vote
0answers
34 views

How to determine all files that were created by a command

I want to know what files were created during execution of some shell command.
5
votes
4answers
224 views

How to find missing files with sequential names?

I have thousands of files named 1.txt 2.txt and so on. Some of those files are missing. Which would be the easiest way to find out which files are missing?
0
votes
1answer
49 views

Cost of file Operation in Shell Script

I just want to know, the file operation in shell script is expensive operation?. We can say, it is expensive in Java or other OOP languages(Need to call open() with read or write option and then we ...
1
vote
1answer
45 views

Find matches from an index file without exact matching and print the last field

I have a large file (~6mill rows) with 2 columns which looks like this: 1111.aaaaabbb.b.cccc.c ValueA 2222.dddddeee.e.ffff.f ValueB 3333.gggghhhh.h.iiii.i ValueC I want to use that as my index ...
5
votes
0answers
57 views

Why does OS X `install` errors on redirected input when the same version of `install` on linux works fine?

I would like to use install command in order to create a new executable file with pre-populated content (e.g. with single pwd command in it). So I've extended this example which creates a new empty ...
1
vote
0answers
41 views

Folders and files lost from Desktop

All my folders and files were lost from my Desktop yesterday. I can not find them. I wanted to have two Firefox profiles on Ubuntu 14.04 so I followed this tutorial. After I run Firefox profile ...
0
votes
2answers
38 views

Merge Two files depending on a Column, nth occurrence of a string in the column of file 1 to be merged with nth occurrence

Merge Two files depending on a column, nth occurrence of a string in column1 of file1 should be merged with nth occurrence of the same string in column1 of file2. I tried join but the results are not ...
4
votes
4answers
132 views

Unable to delete a file whatever I do

So here is my problem I have a pretty strange file that I can't get out of my computer. I tried pretty much everything. First I used software like CleanMyMac, TrashIt, CCleaner etc... None of them ...
0
votes
0answers
72 views

Permissions set to 755 but I cannot access folder

I want to access some files in a folder that I created in a server. I have changed the file permissions recursively to 755, which basically should allow everyone to read and execute files, but this is ...
0
votes
2answers
60 views

How do I gain read access to another user's directory?

I have two users: Alice and Bob. They both belong to the group staff. I want to be able to list the content of the directory /home/alice/Private/ when I'm logged in as the user Bob. As it is now Bob ...
2
votes
2answers
80 views

Combination of find command and sed (stream editor)

I am trying to find all directories in /proc with names containing only numbers and belonging to users other than "root" I have already tried this: sudo find /proc -type d -user | sed -n '/[0-9]/p' ...
2
votes
0answers
118 views

Unable to run chmod, chown, and even ls on a folder

I searched the net and tried to apply answers to similar problems but none worked so far. There is a folder named ocrpaylasim under /home/bnet path. This file belonged to bnet user before and was ...
15
votes
2answers
828 views

Do hard links count as normal files?

I was wondering if there was a way to register this, but since most modern search engines don't work well with phrases over about 5 words in length, I need some help on this one. I was wondering ...
2
votes
2answers
1k views

Why do I get permission denied when using mv althrough directory rights are correct?

I get permission denied when trying to move folder Music via mv although directory owner is set to my user and user permissions are set to 7. What's going on? (I know that I could use sudo but I want ...
6
votes
2answers
375 views

Combining several files into a single CSV

Input files: File: 1.txt: 1 2 3 File: 2.txt: Apple Mango Orange File: 3.txt: 55 100 30 Desired Output: File: example.csv: column1 column2 column3 1 Apple 55 2 Mango ...
3
votes
2answers
283 views

Regex file name with multiple digits

Say I have the following file: test_file-1234-master.tar.gz I have tried to un tar using the following commands tar -xf test_file-[0-9]+-master.tar.gz tar -xf test_file-[:digit]-master.tar.gz ...
0
votes
2answers
45 views

How to loop over each file in a directory, if and only if the directory contains the .csv files?

/dir1/--$ ls 1.txt 2.ssl.txt If the dir1 directory has the given .csv files, then only process the files listed in the .csv in a loop one after another. Here as the dir1 does not have any files ...
3
votes
3answers
92 views

Why size reporting for directories is different than other files?

I was wondering why an empty directory occupied 4096 bytes of space and I have seen this question. It is stated that space is allocated in blocks and hence, the size of a new directory is 4096 bytes. ...
1
vote
1answer
17 views

Re-setting perms on RPM's does not seem to work

I am using RPM for file verification. What I do is run rpm -Va to get a list of files that have been changed. Then I run rpm -qf to get the package name the file belongs to. Finally I run ...
4
votes
5answers
403 views

Sum of filesize of a list of files

I have a text-file that contains a list of filenames (one filename per line). Now I would like to calculate the size of all these files. I think I will have to do a ls -la on every line of the file ...
1
vote
3answers
48 views

awk script to delete blocks in json

I have a newline delimited JSON file with entries like this: {"id":"eprints.ulster.ac.uk/view/year/2015.html","title":"Items where Year is 2015 - Ulster Institutional ...
1
vote
2answers
56 views

Why do I not see inode data in a hexdump or dd?

I'm not quite familiar with filesystem layers in the Linux kernel but I suppose that dd and hexdump do not get the inode information since they only do open() and read() syscalls, but I might be ...