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
2answers
37 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
24 views

Broken files after moving them back and forth [closed]

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
32 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
50 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 ...
1
vote
0answers
22 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
40 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
47 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
36 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
236 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
138 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
52 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
77 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
37 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 'directory1/...
1
vote
0answers
29 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
41 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
33 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
43 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
29 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
31 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
32 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
36 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
38 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 ...
-9
votes
1answer
52 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
41 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
132 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
64 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
59 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
76 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
216 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
41 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
109 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)/Test2/17032016/...
1
vote
1answer
48 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
51 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 "filename....
1
vote
1answer
57 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
38 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
47 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
46 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
293 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
65 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
101 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
73 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?
1
vote
0answers
27 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. Here's what I've 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
25 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 ...
-3
votes
2answers
113 views
0
votes
1answer
29 views

Difference running the same script from Windows than Linux

I've written a script that run unoconv, converts from csv to xls. I run it connecting using openssh client to the server where script is and it works fine. (Always the same Linux user...) But when ...
11
votes
7answers
2k views

How to create a large file in UNIX?

I found a way in Windows to do such thing echo "This is just a sample line appended to create a big file. " > dummy.txt for /L %i in (1,1,21) do type dummy.txt >> dummy.txt http://www....
1
vote
1answer
26 views

Moving non-writeable files vs moving non-writeable directories

I'm a bit puzzled about the following behavior (Linux, Debian 8.3, ext2 filesystem) test@linux:~$ ls -ld directory/ file drwxr-xr-x 2 root root 4096 Mar 10 18:51 directory/ -rw-r--r-- 1 root root ...
-1
votes
2answers
36 views

First and last five lines of file [duplicate]

How to see first and last 5 lines of file? Right now I am using head filename ; tail filename Any other way around and more efficient?
-4
votes
1answer
43 views

how to move all files under one directory to home directory

I have the script files script1.ksh ...script10.ksh in the directory star2 PATH : home/aaa/star2 I need to move all the files under star2 to the home directory (home/aaa) NOTE : I do not want the ...