Use this tag for questions about file management and operations on files.
0
votes
2answers
27 views
Create a list of files in a directory with a certain char
I would like to be able to list all files within a folder which have a certain character as the third character. For each file, I then want to be able to perform an action, maybe delete or move. ...
1
vote
1answer
30 views
How to organize files in Linux/Unix shell?
I would like to try to organize my documents, and I was told that I can do this using the linux/unix cygwin terminal. I searched for the command in google but all I ever did find was organizing the ...
0
votes
1answer
21 views
How to search recursively within several levels of embedded tar tgz files? [duplicate]
Can somebody help me to figure out a command to find a file recursively that is embedded in a tgz file which is within another tgz files recursively:
MainFile.tgz → SubFile1.tgz → SubFile2.tgz → ...
1
vote
2answers
26 views
How to know the path of a running executable?
I am working on a Linux server, and I running different jobs on different node.
However, when compiling my program, I didn't set their specific name, so they are all a.out
Now I found one of the ...
0
votes
1answer
22 views
Broken files after moving them back and forth [on hold]
I have different partitions for / and ~, both with ext4 filesystems. In ~, I have a folder with many files, I tried to move the complete folder to the root partition
mv ~/folder /folder/
In the ...
2
votes
1answer
23 views
According to what does GNOME purge the trash “30 days later”?
In GNOME 3.18 Settings > Privacy > Purge Trash & Temporary Files, one can configure the desktop environment to automatically empty Trash "after 30 days".
The description here isn't very clear. ...
1
vote
3answers
25 views
Rename only one file in each directory, based on condition
I have 100 folders inside every folder I have one or two files named as the following:
XXX_001_014_max.jpg
XXX_001_024_max.jpg
I saved the folders names in a file "list.txt"
I ran the following ...
0
votes
0answers
39 views
Splitting a file in given size chunks (linux) [on hold]
I am trying to split a file into smaller files that are going to be used in a concurrent script and split throws an error:
split: =4: invalid number of lines
in the following script:
CHUNK_SiZE=12
...
0
votes
0answers
19 views
How to remove a single quote from a file name? [duplicate]
I have some podcasts on my radio server which contain a timestamp when they should be played. I noticed one of them is put into single quotes 'filename.mp3', and I'm unable to remove them. Check this:
...
1
vote
1answer
30 views
Creating if/than statement to move files to another location based on value of 1 column?
I have thousands of xyz (latitude,longitude,elevation) text files that I want to separate by latitude or longitude. How and what commands could I use to create an "if latitude(column1) is greater than ...
0
votes
1answer
23 views
Delete files between two dates
I have a folder in which there are very old files. It contains files since 2009 and they are dump files with error log.
What I want to know is if it is possible to delete the files between let's say ...
0
votes
2answers
24 views
File Size Limit
What is the maximum file size limit in rhel 32 bit OS, is there any OS limitation for the file size , if there is any limitation set then please tell me what will be for root & oaa.
6
votes
1answer
211 views
Have a 'file' generate its content on demand? [duplicate]
Is there a way that I can have something which appears as a file, but when being read some code executes which fills the content of the file "on the fly"?
Like FIFO/ named pipe, but without the need ...
3
votes
3answers
107 views
Add mtime to grep -c output and sort the output by mtime
I have a directory full of logs named in the following style:
info.log00001
info.log00002
info.log00003
...
info.log09999
info.log
My current output (using grep -c)
I need to analyze the ...
-1
votes
1answer
51 views
Organize a file [closed]
I want to thank the great help and support. Well, I have the following file:
name id alello chr pos snp
s1 215 a 1 11 a215
s1 216 a 1 11 a216
s1 217 ...
-2
votes
1answer
53 views
When a particular file arrives then execute a procedure using Shell Script [closed]
When a particular file for eg: "abc.csv" file arrives into a directory for eg: "mydir", I need to execute a procedure using shell script.
"There was a procedure which will load data from csv to table ...
1
vote
1answer
34 views
Interactive remove files listed with paths in text file
I am trying to interactively remove files listed with their paths in a text file.
The command I am trying is:
xargs rm -i <filelist.txt
The error I get is:
rm cannot remove ...
1
vote
0answers
18 views
How long does process wait for locked file? [closed]
If a process in a Unix based OS finds that a file is locked because another process is writing to it, how long does it wait and retry before giving up and returning an error?
2
votes
2answers
33 views
List all the files in ending with several file extensions?
If I want files ending with .fas I know I can do the following with ls command :
ls -l /users/jenna/bio/*.fas
and this lists out all the files ending with .fas. But how can I get files ending with ...
0
votes
0answers
13 views
find and copy files change the modified date to 1980-1-1
I use command to find and copy files in cygwin in windows . My command is
find -name '*.docx' -exec cp -p -t /word {} +
however , when the files is copied to destination folder, I can see the ...
0
votes
1answer
35 views
One liner to replace file contents [duplicate]
When I run base64 filename >> encodedfile the new content is appended to existing content. Is there any way I can replace entire old content with new content. Using any similar one line ...
1
vote
0answers
28 views
Access directory as a different user
On a Debian (Jessie) server provided by my university, I have a mounted directory (say it's /MagicDir) that can only be accessed by one user (say magicuser). Not even root can access this directory! ...
0
votes
1answer
26 views
How to implement config file expiration time?
I have a Debian server which runs a service using multiple config files (in a similar way to apache2) which I need to add an expiration date to. The config file that has an expiration date starts with ...
-2
votes
1answer
31 views
Copying files from multiple directories [closed]
I want to copy a single file from 10 different directories and append them in another directory.
0
votes
1answer
28 views
linux - setting order in which files are read or output with utilities (sorting)
I'm having issues with programs reading files in the wrong order, and also outputting in an undesirable order with utilities such as ls.
I've tried some of the LC_COLLATE options, but none of them ...
0
votes
1answer
30 views
How to execute a command for all mp3 files in a directory? [duplicate]
I have a directory with some mp3 files. I want to remove (almost) all ID3 tags using
mid3v2 <file> --delete-frames=AENC,APIC,...
for every mp3 file in the directory. Other files should not be ...
-4
votes
0answers
203 views
How can I locate package linux-headers-4.3.0-kali1-amd64
root@kali:~# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ...
0
votes
0answers
69 views
Is it possible to change the prefix of an application without recompiling? [closed]
I am trying to convert some Debian packages to match the directory structure of XDG apps (without the sandboxing aspects). But I need to change the application prefix by recompiling which could be ...
-9
votes
1answer
46 views
Unix “ls” command? [closed]
Can someone explain to me what are all the options available with the -la flags for the ls command ? I have read the man pages, but still not sure.
-1
votes
1answer
23 views
file transfer between host macine(win10) and virtualbox machine(centos 6.3)
I am trying to copy some files from my host machine to my virtual box machine centos. I tried vsftpd and share folder but it's not working.
Please advise me on how to do it.
1
vote
1answer
38 views
How do i open it .emz files on linux?
I want to view or open .emz file on Linux.
EMZ file extension is a Windows Compressed Enhanced Metafile file.
How i have to open this file.
Any software required?
I don't want to convert through ...
1
vote
5answers
47 views
Running commands on several files and giving each output a unique name
I want to run a script on all the files in a folder like this:
sh script.sh *.fasta > output
however I want the outputs to be in individual files for every input. So instead of getting 5 files ...
-1
votes
1answer
57 views
Remove files with certain extensions and 0-length files
Want to know how we can clean the directory by removing all the files with a zero length , with a .tmp or with a .swp extension that found in this directory (note that sometimes .swp and .tmp files ...
0
votes
5answers
47 views
Remove the latest modified file
I have created two files:
sample.txt and sample.txt (the second file contains some hidden characters, e.g. a space). How can I remove the latest modified file? I'm using Linux.
1
vote
2answers
107 views
Read from and write to file from stdin and stdout
I need to continually read from and write to a (virtual) file in bash, without closing the file in between. I'm looking for a program which will open the file for read and write, read from stdin and ...
1
vote
1answer
38 views
“time > time.txt” refuses to work propely
I just started learning Linux commands. I was experimenting with the > command, that, as far as I understand, makes the command before it write it's output to the file after the sign. This ...
0
votes
2answers
63 views
Move log file which is older than 2 days
I want to move log files which are older than two days to a new directory by date, like below.
Source:
1) /Test1/Server.log
2) /Test1/Server17032016.log
Destination:
...
1
vote
1answer
29 views
How to give write / create right to not yet existing files w/o write access of the parent directory?
I don't know if this is even possible so I need to ask. I'd like to allow a single file to be created by a user (a flag-file) but only that file should be able to be created.
As I have the parent ...
1
vote
2answers
45 views
Difference between 1> and >
Is there any difference between (# comments taken from documentation)
command > filename # Docs: Redirect stdout to a file.
and
command 1> filename # Docs: Redirect stdout to file ...
1
vote
1answer
47 views
Move specific directories from certain depth
I've tried to make a bash script that will help me move specific subfolders from my folder.
The issue is,in the main folder photos I have folders named like this:
1,2,3,4,5,6,7,8,9,0 and inside them ...
1
vote
2answers
31 views
/usr/bin/file exit status always 0
I'm trying to use /usr/bin/file to detect file types in a program but also would like it to report if the file does not exist. However the command always returns exit status 0.
Besides grepping the ...
1
vote
1answer
30 views
How to set csplit output filenames by pattern?
Is there a way to set output names of csplit through the pattern?
I want to split the ssh-config by hosts to corresponding files.
If there is a solution without csplit I'm happy as well.
1
vote
1answer
20 views
How to handle broken link after file deletion.in /proc/<pid>/fd directory?
A process is creating huge number of log files and also deleting it.
Many of those deleted files are having broken links in the /proc/pid/fd directory.
Do these file handles need to be closed by ...
5
votes
4answers
280 views
how to delete all files with specific extension in specific named folders in large tree?
I have large tree, with many pdf files in it. I want to delete the pdf files in this tree, but only those pdf files in sub folders named rules/ There are other type of files inside rules/. The rules/ ...
0
votes
2answers
50 views
How do I find a range of numbers in the content of file and move files containing the range of numbers to another directory?
Okay so I have about 90 files, each with a body like
187942 78.9
I want to filter files that has the values between 70 to 90 on the second column and move them to another directory.
I'm ...
1
vote
2answers
56 views
Bash iterate on pairs of files
I have a directory with a bunch of files with names like a04x.txt, each with a corresponding b04y.txt file. I need to be able to run some commands on each pair of files and produce an additional file ...
-1
votes
2answers
35 views
What are exactly mknod command parameters?
What are exactly mknod command parameters?
I want to create a jail in chroot. So I need to do:
mknod /var/chroot/bind/dev/null c 1 3
mknod /var/chroot/bind/dev/random c 1 8
What are c, 1, 3 and 8?
...
0
votes
0answers
17 views
dialog menu to display files, select one of them and then able to delete it
I want to be able to display files under a given directory, then select one of the files and be able to delete it.
Heres what ive found so far, can anybody help?
let i=0 # define counting variable
...
8
votes
2answers
1k views
Why did mv delete a file with mv id_rsa *.old? [duplicate]
I wanted to backup my ~/.ssh/id_rsa to id_rsa.old, and it looks like it got deleted! How is this possible? :)
root@localhost:~/.ssh# ls -l
total 16
-rw------- 1 root root 3326 Mar 12 11:22 id_rsa
...
-1
votes
1answer
22 views
Sorting and outputting in another file
How can I sort a file then output it into another file I never created or do I have to create the file I want to put in. Might not make sense how I am typing it so...
Let's say the file I have is ...