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)

0
votes
1answer
81 views

How can I execute any command as a normal user without sudo?

Is it possible to assign the sticky bit to sudo in order to execute any command as a normal user? Let's suppose that we have the user test and then: test@test$ apt-get update But I don't wanna use ...
3
votes
2answers
85 views

Restrictive “group” permissions but open “world” permissions?

I understand that with Unix file permissions, there's "user", "group", and "world" octets. For the sake of this discussion, let's assume that setuid/sticky bits don't exist. Consider the following ...
3
votes
3answers
71 views

Get lines between two timestamps from a file

I have this large file that I need to go through using date and time. Every line in this file has a date and time in it. I need to search through the lines and get the lines that lie between two ...
3
votes
1answer
50 views

reserve disk space before copying files

I would like to reserve (or is the keyword "claim"?) some amount of disk space before an rsync occurs so other programs will believe a disk has less space (because after the rsync, the disk will have ...
1
vote
1answer
49 views

Creating a virtual file whose contents are determined programmatically [duplicate]

Is it possible to create a virtual file in unix, whose contents are determined programmatically when the file is accessed, a bit like the files in /proc? For example, I have a program that retrieves ...
1
vote
3answers
55 views

Is there a faster way to find specific files than using find?

I have to find in a folder the files not having certain permissions (755). The sub-directory has other sub-directories containing in total millions of files, and the find ./ -not -perm 755 command it ...
0
votes
1answer
63 views

Copy last n-lines from one file to another

In the context of adding the same lines at end of the .bashrc or .vimrc files of several user accounts on the same machine, what would be an easy way to copy the last n-lines from one shell script to ...
27
votes
8answers
3k views

Is there a convenient way to classify files as “binary” or “text”?

Standard Unix utilities like grep and diff use some heuristic to classify files as "text" or "binary". (E.g. grep's output may include lines like Binary file frobozz matches.) Is there a convenient ...
0
votes
2answers
33 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. I'...
1
vote
1answer
54 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 ...
1
vote
1answer
33 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
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
34 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
52 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
41 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
51 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
40 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
240 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
142 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
78 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
42 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
37 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
39 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
137 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
67 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
77 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
223 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
119 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
49 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
48 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
48 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
296 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
67 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 ...