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

learn more… | top users | synonyms (1)

-3
votes
0answers
19 views

File layer (want to get requested filename) [on hold]

Imagine that there is running application that wants to read a file from working directory. When it happens I want to get a name of requested file and check if it is existing in specified directory, ...
0
votes
3answers
60 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
13 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
244 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 ...
0
votes
1answer
29 views

Scanning user directories for specified file [on hold]

i want to find all files in /etc/passwd called cat.sh and then outputs the timestamp and * of entries. I was thinking of using grep -l "cat.sh" * | wc -l
1
vote
0answers
20 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
311 views

unix file is corrupted [on hold]

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
553 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
52 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
0answers
16 views

Is there a way to change file/folder ownership on a server in Ubuntu/Kali-Linux? [migrated]

I accidentally changed file ownership of a folder in Windows 7 and now nobody can edit, copy, view, move it, etc. Not even the administrator account account can change it back. I tried icacls and ...
0
votes
1answer
50 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 ...
0
votes
0answers
31 views

why this file not modifying? [closed]

sed -i "s/'${line[*]}'/'${newlinem[*]}'/" test2.txt I'm trying to replace whole line of my text file with new modified line. but my file not modifying with sed -i Both the above arrays are working ...
4
votes
1answer
117 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
74 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
35 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
18 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
43 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
83 views
+50

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
45 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
33 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
64 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
91 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
16 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
52 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
120 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
68 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
58 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
29 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
267 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
50 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
21 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 ...
3
votes
0answers
10 views

Get consistent encoding for all files in directory

I have a directory containing lots of csv files from various vendors with two different encodings: ASCII Text / UTF-8 UCS2 / UTF-16 little endian I'd like to use grep, awk, sed and other utilities ...
0
votes
3answers
60 views

What is the difference between a directory name that ends with a slash and one that does not? [duplicate]

Is there any difference between a directory name such as mydirectory and mydirectory/ I noticed this happens when I execute ls in some directories - some of the directory names have a slash and ...
2
votes
2answers
89 views

How to remove a file that can be seen but no program can seem to touch?

I'm trying to remove some obsolete backups, and deep inside one I've found a file 'cifs3bee' that I can find no way of removing. (And since I can't remove it, it's preventing the removal of the entire ...
0
votes
2answers
52 views

Merging large data set in fastest possible way

I have a large data set ~100 GBs having smaller csv files ~ 100,000. I wish to merge all .csv files together in the fastest possible way. Files are located in two different folders. Someone ...
1
vote
1answer
32 views

What are the default file permissions in CentOS?

What are the default file permissions in CentOS 5, CentOS 6 and CentOS 7? Is there any difference in the default file permissions between these OSs?
1
vote
4answers
190 views

change last 10 characters of the base (not extension) of multiple files

I have many files of different lengths but the same extension and I have tried many commands to rename all of them at once. Is it possible to change only the last 10 characters of the base of all ...
0
votes
0answers
58 views

extract text to csv file from output of reading multiple files into specific rows

I am trying to write a bash script to generate a csv file from text within multiple pdf documents. I have a script for converting pdf to text, but not for generating the csv file. Each text document ...
18
votes
7answers
2k views

Why compute checksums of downloaded files?

I often see a checksum given next to a file available for download. The purpose of this practice eludes me. It is obviously to detect corrupt files, but what could be the cause of this corruption and ...
0
votes
1answer
60 views

Operation of “mv” described in “Advanced Programming in the UNIX Environment”

In Advanced Programming in the UNIX Environment (book) Section 4.14, interpret the i-node and directory, there is a paragraph: When renaming a file without changing file systems, the actual ...
3
votes
7answers
155 views

for loop in bash lists dot and double dot folders [duplicate]

for f in ~/common/.*; do echo $f done The entries listed are, /home/sk/common/. #undesired /home/sk/common/.. #undesired /home/sk/common/.aliasrc And i am putting a ugly ...
-3
votes
1answer
41 views

Create five copies of file with the same inode number

How can I create five copies of /etc/profile with the same inode number?
7
votes
2answers
174 views

Sorting a file with integer in parentheses with no space

I am trying to sort a file like this (which is a list of subroutine names) cfn=(1370) __lib_file_MOD_file_open fn=(1368) __universe_MOD_general_boot fn=(916) __universe_MOD_general_main fn=(6142) ...
0
votes
4answers
82 views

given a file, find where within a subdirectory it was copied to

Given a file that I know has been copied into a given directory, I want to find the exact path where the file copy now resides. It is guaranteed the file has not been edited and will look exactly like ...
2
votes
2answers
51 views

remove whitespace from all items in a directory and sub directory

I have a directory which contains files and sub directories, some of which have whitespace in their names. Further more each of these sub directories contains files with whitespace in their names. Is ...
2
votes
1answer
24 views

How to tar-bzip old files in yearly groups

I wish to know a command I can use to grab and archive all files for a year at a time. I am working on a directory that has 72000 files, with files dated from 2007 to current. And I wish to make that ...
0
votes
0answers
28 views

How do I move files from a disk image using Terminal.

I downloaded an application (LaTeXiT) that installed itself as a disk image. I navigated to /Volumes and into the disk image, but when I try to move the contents to my /Applications folder, it returns ...
0
votes
0answers
67 views

How to check if the shell script created a new error log file in a folder with the same shell script? [duplicate]

I am trying to check if the new file is created in the specific directory or not when I run the shell script. Here, I am creating a new file through the shell script itself and then checking whether ...
3
votes
5answers
56 views

How one can re-read image with dd so it will match one you just wrote?

I have a ~1GB image that I'm writing to a 8GB SD card via the dd tool. I'd like to verify that it was written without corruption by reading it back and comparing its hash with original one. ...