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

learn more… | top users | synonyms (1)

5
votes
1answer
39 views

Why is mtime and ctime changing for a directory when a file is modified?

I am learning about atime, ctime, mtime with regards to files and directories. It seems to me that if I modify a file within a directory, I haven't changed the "directory file" itself in its idode or ...
0
votes
1answer
13 views

Cropping a yuv444_8bit and yuv_420_10bit input using ffmpeg

I have 3 input files to crop: 1. yuv_420 10 bit 2. yuv_444 8 bit 3. yuv_444 10 bit I am unsure about which pix_fmt option to use for these. This is the command line I am using: ffmpeg -s:v 3840x2160 ...
16
votes
6answers
1k views

How to corrupt an archive file in a controlled way?

I wrote a function that checks for a corrupted archive using a CRC checksum. To test it, I just opened the archive and scrambled the content with a hex editor. The problem is that I do not believe ...
1
vote
1answer
34 views

File/directory not being deleted?

Please see the screenshot. The image on the left says existing x installation found at /opt/x The image on the right shows the terminal where I attempt to delete the same directory. The terminal on ...
2
votes
1answer
28 views

Is it feasible to update the modified times only without copying files when using rsync?

The modified times of a large amount of local files are incorrect. I wanna update the timestamps by syncing the timestamps on the server. It would be time-consuming if the files themselves are ...
1
vote
2answers
64 views

Copy Single Value from a file to a variable and perform arithmetic over it? [duplicate]

Suppose we have a file like 'abc.txt' which has a single value 123456 and file 'xyz.txt' which also has a single value like 654321. I want to store these values form the file to some shell variable ...
0
votes
1answer
22 views

When I extract a zip file on my hosted server the permissions are different than my own server. How do I simulate the extraction on my hosted server?

I have an application, let's say Bootstraptor. When I extract it on my hosted server, it extracts fine and all the directories have permissions 755 and the files have 644. And the application works ...
0
votes
2answers
31 views

Copy file,create duplicates in different directory with predefined list of filenames

I have a file rock.mpg in the folder directory /folder1/folder2. I need to create multiple (340) duplicate copies of this file in a different directory say /folder1/folder2/folder3 but with different ...
-2
votes
1answer
72 views

Undo a mass rename of files in a directory?

So I tried to use this script to get rid of a username in a bunch of files #!/bin/bash ls | while read -r FILE do mv -v "$FILE" `echo $FILE | tr '[DarkDream]' '.' ` done Instead, all of the ...
1
vote
1answer
23 views

How to share a file over “Windows Share” protocol from scientific linux?

I have a file on my linux. I want to share it via "Windows Share" (IPMI can understand only one way of remote large files mounting). How to share my file over "Windows Share" from my scientific linux? ...
0
votes
1answer
18 views

Special file descriptors

In shell scripting, are any file descriptors other than 0, 1 and 2 special in any way? The flock manpage has the following example code: ( flock -n 9 || exit 1 # ... commands executed ...
2
votes
5answers
74 views

Extract a single file from a zip file only knowning the extension

Hi my first part of the requirement: I like to extract a single file from ex1234.zip. The structure and contents of ex1234.zip: ex1234 (directory) directory1 ex1234 (directory) ...
0
votes
1answer
27 views

ls displays files copied from an external drive with a yellow background

I copied some files from an external drive and now they appear with a yellow background under my ZSH shell on OSX. I believe that its a permissions thing as the normal ones display "drwxr-xr-x" and ...
1
vote
1answer
30 views

How to keep the file in RAM

I have a laptop with Linux Slackware. When it's working on battery saving a file to hard drive takes around a second. When I'm writing code I waste a lot of time saving the files. I have about 2 GB ...
1
vote
1answer
32 views

Form a output by combining multiple lines

I have a log file as below: /export/home/got/logs/o2877612.01:job_1432787863184_159408 Message: org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path does not exist: ...
0
votes
1answer
19 views

Have to transform some bunch of csv in req format and store it in some other location with same name

I am having some input CSV files INPUT_FILE: A_B_C_NFM001_20150729.csv A_B_C_NFM002_20150729.csv A_B_C_NFM003_20150730.csv I want output file also with the same name as input after performing below ...
0
votes
4answers
71 views

piping commands not working as expected I need explanation

I am trying to do the below touch ~/scratches/scr6.txt | cat ~/scr.txt > ~/scratches/scr6.txt | cat /dev/null > ~/scr.txt I don't know why scr6.txt is always empty, however doing the below ...
0
votes
2answers
40 views

Rename specific level of sub folders

I have list of sub folders inside a parent folder as follow: Parent folder folder1 foldera folder2 folderb folder3 folderc I want to rename the subfolders only in ...
0
votes
0answers
18 views

Failed to change last modified date of the file after do some edit in /var/www

on ubuntu server (14.04) I have a virtual host which is in /var/www and my linux user is group of www-data. But I noticed that, if I change something on a file in /var/www last modified date does not ...
1
vote
1answer
24 views

Get “recent files” in global file manager (Dolphin?)

I just switched to OpenSUSE (KDE) from my Fedora 20 KDE setup,and I find myself greatly missing a feature that was a default in Fedora: a "Recently Used" option in the file manager when saving and ...
0
votes
1answer
70 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 ...
0
votes
3answers
46 views

How do I create a directory for every file in a parent directory

I have parent folder and inside this folder I have 4 files ParentFolder File1.txt File2.txt File3.txt File4.txt I wanted to create subfolders inside the parent folder and ...
0
votes
3answers
81 views

Get recursive file count (like `du`, but number of files instead of size) [duplicate]

Since I'm having performance problems with rsnapshot, I'd like to identify directories with great number of files recursively. I think the problem is not the size of the files, but the file count in ...
1
vote
2answers
21 views

Getting a list of files modified after an apt-get upgrade or intstall?

I would like to run AIDE or tripwire to make sure executables/configuration files/... do not get modified by malware. Or at least notify me if they do get modified. I would like to get a list of ...
4
votes
4answers
276 views

Remove a directory from inside using the command line interface [duplicate]

Imaging the next simple file structure within the /home/user/ directory: /home/user |--dir0 |--dir1 |--file1 My current directory is 'dir1' and I remove the ...
2
votes
0answers
25 views

Can I make cross-computer sharing compatible with tinfoil-hat security (password managers, email, etc.)

Preface: I realize the following is asking for tinfoil-hat type security, but I'm really curious for answers to my questions -- not suggestions to enable two-factor logons on gmail, etc. and call it a ...
2
votes
2answers
324 views

unix file is corrupted [closed]

I discovered that one of my logs consumes lots of space which comes from a running process. I wanted to clean this file, so I can run logadm to rotate it after. but I don't know how # ...
0
votes
0answers
12 views

What permissions apply if specific user's permission on file or directory differ from user's group to which this user belong to in Linux? [duplicate]

Case 1: User has "rwx" permissions to certain file or directory. But has no permissions "---" in group it belongs to. Question: who wins - Does user have "rwx" or "---", effectively (not what's ...
6
votes
4answers
596 views

How to print the name of missing files in a folder?

I have 2000+ files in a folder, but there are few files missing from the folder. Name of the files are like GLDAS_NOAH025SUBP_3H.A2003001.0000.001.2015210044609.pss.grb ...
-6
votes
1answer
71 views

Delete Huge file in linux

I would like to delete a large file in my server. It's very large nearly more than TB's. What is the best way to delete that huge file ???
0
votes
1answer
57 views

find files in a folder

I'm trying to make a FIFO script that keeps deleting files when disk usages reaches a limit. I have used the find command so that number of files wont be a limit to run the script. But I get an error ...
4
votes
1answer
129 views

Undeletable directory

Everything I've tried (always with superuser privileges) has failed: # rm -rf /path/to/undeletable rm: cannot remove ‘/path/to/undeletable’: Is a directory # rmdir /path/to/undeletable rmdir: failed ...
2
votes
3answers
86 views

Modify multiple files in different folders with one command?

I have a file abc.txt in the folder /etc/zyz/ and also in a few sub folders /etc/zyz-1/ /etc/zyz-2/ How can I modify all of those files with a echo command for example (all named abc.txt) in every ...
1
vote
2answers
38 views

Piping contents of multiple files between programs while keeping contents separate

I would like to read in a number of files and pipe their output to subsequent programs while still maintaining them as individual pipelines of data. program1 *.txt | program2 | program3 folder I ...
0
votes
0answers
21 views

Get mutt to open files >2G

According to the very likely sounding answer to How to access and manage a large mailbox (11 GB) I need to use mutt to open the large mailbox. However the 2G limit was supposed to have been removed ...
2
votes
1answer
73 views

How to create gcov files for a project in a different dir?

I want to analyze code coverage datas. I want to create gcov files from OpenSSL (and from other projects), but I can only create them in the same directory of the project, and only for the files in ...
2
votes
3answers
95 views

Monitor processes trying to access non-existent file or directory

We're moving websites from one server configuration to a new configuration and the websites will live in different paths than previously. We're planning to diligently go through and replace old paths ...
3
votes
1answer
57 views

How does `lsof` keep track of open file descriptors' filenames?

I've noticed, if a file is renamed, lsof displays the new name. To test it out, created a python script: #!/bin/python import time f = open('foo.txt', 'w') while True: time.sleep(1) Saw that ...
1
vote
1answer
35 views

How do I find directories where none of the files inside have been accessed in a year?

I have a tools directory /tools/tool_name that has hundreds of releases of the tool inside. I am trying to find an easy way of knowing what releases can be archived. Is there an easy way of finding ...
-5
votes
1answer
68 views

Find the number of files with sizes

Find the number of files with sizes > 100KB in /, /bin, /usr, /usr/bin and /usr/sbin directories and output them in a two column format with the name of the directory and the number of files.
2
votes
5answers
97 views

Change strings in multiple files to current subdirectory name

I have several directories each containing a file containing this line: ../a_a_q1.out ../a_a_q2.out ../a_a_q3.out I would like to loop through all the subdirectories, and change the a_a part to the ...
-1
votes
1answer
19 views

Daemon opens a file in RO mode only

I am trying to write a kind of keylogger myself. I don't know if my logic of developing a keylogger is good or not but I have thought of doing it the following way. First a daemon is created, and to ...
2
votes
1answer
61 views

Continously writing terminal output to text file

I am running a small cli python app in terminal. It loops infinitely and outputs text to the terminal. I want to output the text to a file, and I can do that with the following command python [my cli ...
4
votes
3answers
147 views

How to copy recursively and change file names to be unique

I have a large tree containing a lot of photos on an external drive that was formatted with one of the linux filesystem types (don't remember which one). It's mounted on my mac and I'm trying to copy ...
1
vote
2answers
96 views

What is the file permission of /etc/shadow in CentOS?

What is the default file permission of /etc/shadow in CentOS? Is there any difference in the default file permission of /etc/shadow in previous versions of CentOS?
5
votes
2answers
71 views

`sudo cp -a` changes ownership to root (instead of preserving the original user)

I was trying to backup some directories and some of the copies made by sudo cp -av resulted in being owned by root while others preserved their attributes. Is this a known issue or am I missing ...
2
votes
1answer
32 views

How to create a zip of directories -mtime -150

I want to zip the directories, sub directories, files in main and sub directories from today till 150 days ago. I only consider the date of the directories where I am running the command, no matter ...
2
votes
4answers
283 views

Replace regex match with string containing match

I have a file with text as Afghanistan=+93 Albania=+355 Algeria=+213 American Samoa=+1 Andorra=+376 Angola=+244 It has all the country list and its dialing code. I want to replace: ...
1
vote
4answers
57 views

How to move all files (excluding sub-directories) from one directory to another?

How do you move all the files (excluding sub-directories) from one directory to another. I'd prefer if the solution used just basic shell scripting.
0
votes
1answer
34 views

Using imagemagick to crop video

I want to crop a video that I have in yuv format using imagemagick. I am using the following command: convert -size 1280x720 my_clip_1280_720s.yuv -verbose -crop 352x288 +repage my_clip_352_288.yuv ...