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)

1
vote
0answers
19 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
37 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 ...
0
votes
2answers
66 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
47 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
54 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
2answers
64 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 ...
11
votes
2answers
549 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 ...
2
votes
1answer
27 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 ...
0
votes
1answer
24 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
21 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
17 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
37 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
53 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
59 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 ...
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
413 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
23 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
93 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 ...
3
votes
3answers
64 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
38 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 ...
0
votes
0answers
42 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
62 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+ ...
1
vote
1answer
34 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
26 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
40 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
43 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
23 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 ...
1
vote
1answer
47 views

move files with special characters to new directory

I'm trying to write a loop for a script that checks a specific directory for any special characters and moves those files to a specific directory (except spaces and hyphens - those are simply replaced ...
1
vote
0answers
7 views

Track amount of data application and a device file are exchanging

Is it possible to track how much data is going into a device file and an application as a third person? Background A web server is communicating with a device /dev/ttyACM0. The server offers a HTTP ...
1
vote
1answer
42 views

Limited access to a directory's contents

There is a file in a directory that me and the other users want to be able to read. I want the other users not to be able to see the other files in the directory. They should be able to read a ...
-1
votes
1answer
34 views

File size limits

i have a text file which its size is 23.5 Mb. i want to reduce file size under 20 Mb. how can i do that? the file type is: plain text document (text/plain). this file have ~40000 line and ~500 column. ...
1
vote
1answer
26 views

Ubuntu shell curly brace expansion - confusion with sox command

I'd like to search through multiple subdirectories and convert all .mp3 files to .al files. Here's how I do it: find . -name '*.mp3' -type f -print0 | xargs -0 -t -r -I {} sox {} -r 8000 -c1 -e a-law ...
0
votes
1answer
37 views

How to maintain only four lines in my file in shell scripting?

Input file: 01.05.2016 87893938 02.05.2016 35435345 03.05.2016 35435345 04.05.2016 12345678 I want to keep only four lines in my file. that means if date 05.05.2016 6905698 is inserted then ...
3
votes
2answers
272 views

How can I find files with a long first line?

currently I have a problem with a server. One user who is hosting a lot of sites got hacked and some of his php files were modified. Now I want to get a list of the infected files and also want to ...
1
vote
2answers
52 views

Check in pure bash that the download is complete

short story is, I probably need a simple loop in bash which checks periodically whether the size of a given file has changed or not since last checked. Long story, I will be downloading a file ...
2
votes
1answer
80 views

Cannot mv to a subdirectory of itself

I am running this simple script and I am trying to create a cron job so that the file gets copied to my thumbdrive (with the new name) sudo cp /home/pi/NewLog.log /media/usb sleep 20 cd ...
0
votes
0answers
20 views

Can't delete files using SSHFS on windows

My problem is that i can't delete any fails from any folder using my windows sshfs client. Even though i'm logging in through root account, it still says that i do not have enough permission to ...
2
votes
1answer
64 views

How to delete files with ~?

I have removed all my python code from the home directory, but when I do ls I get: a11.py~ class1.pdf foobar.txt~ n1 pic.py~ When I do ls like this: ls *.py I get: ls: cannot access *.py: No ...
70
votes
1answer
7k views

Why does the following script delete itself?

If you create an executable file with the following contents, and run it, it will delete itself. How does this work? #!/bin/rm
3
votes
3answers
88 views

Display files to size with lower and upper bound without using `find`

I need to create a program via vim in Linux called between. The script takes two arguments as the lower bound and upper bound of the file size, and prints out a list of file names as well as their ...
13
votes
4answers
660 views

dd: multiple input files

I need to concatenate chunks from two files: if I needed concatenate whole files, I could simply do cat file1 file2 > output But I need to skip first 1MB from the first file, and I only want ...
0
votes
2answers
24 views

How can I give files extended attributes in mac os x?

How can I give files extended attributes in mac os x? Mac os x doesn't have the 'setattr' command.
0
votes
0answers
19 views

Qubes/Xen OS: access file manager for dom0

I hope somebody more experienced with Qubes specific terminal commands can help. If the KDE manager is installed, how does one open via terminal input the file manager for 'dom0'? To browse 'Home' ...
0
votes
0answers
23 views

Where is my 7za data being written to

I have a weird question about 7za on Centos 7. I am adding a file to a 7za archive using the following command (the total size of the directory is around 40GB) /usr/bin/7za a -ppassword -t7z -mmt=off ...
2
votes
3answers
39 views

Is there a way to see the dimensions of a jpeg file in linux using the command line?

I have some .jpeg images saved in a file in a cluster at school. I am at home using PuTTY to access one of the Debian nodes. I'm able to get to the folder with all the images but I need to see the ...
0
votes
3answers
26 views

How to apply dos2unix recursively to all the contents of a folder?

Is there a way to apply the dos2unix command so that it runs against all of the files in a folder and it's subfolders? man dos2unix doesn't show any -r or similar options that would make this ...
0
votes
2answers
43 views

How to see information inside inode data structure

I can do an ls -li to see a file's inode number, but how can I list information inside a particular inode by using that inode number.