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
0answers
25 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
40 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
29 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
35 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
34 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
51 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
32 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
81 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
62 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
65 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
179 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
39 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
87 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
45 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
50 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
56 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
34 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
43 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
38 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
290 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
60 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
83 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
56 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
22 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
24 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
87 views
0
votes
1answer
27 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 ...
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
41 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 ...
4
votes
1answer
54 views

Split file and know how many files were generated

I'm using the following lines to split a file into smaller parts: split --line-bytes=100M -d $input $output/FILENAME echo "$input was split into ??? 100MB files." >> demo.log After that, I ...
1
vote
2answers
71 views

Why doesn't unix filesystem store creation time of a file? [duplicate]

Is there any historic reason? Stat stores last accessed time, last modified time and last changed time , but not the creation time! Isn't that important information. I can't understand why the ...
0
votes
1answer
46 views

Size of a character/block file

Why is the size of a character or block file given as comma separated? crw-rw-rw-. 1 root root 1, 3 Mar 8 10:15 /dev/null brw-rw----. 1 root disk 8, 1 Mar 8 10:15 /dev/sda1 Size of a file is ...
2
votes
1answer
92 views

Why is this find command not returning filenames containing non-ASCII characters only?

I'm trying to determine the root cause of why this find command is not working; it shouldn't match the file called this_should_not_match below: $ > find . -type f -name "*[^ -~]*" ./__º╚t ...
2
votes
1answer
41 views

Searching Files according to PNG Meta-Tags

As stated in the title, I want to search for PNG's in a (sub-)folder structure with the meta tag software set to the value GNOME::ThumbnailFactory and delete them with a single bash command. Have ...
3
votes
1answer
55 views

Identify files/processes that prevent remounting read-only

My system runs Debian Testing, and / is generally mounted as read-only. The main problem with this is, every time I install something or update the system, I cannot remount the filesystem (I get the ...
0
votes
1answer
70 views

recover files if still being used by a process

I have run into a problem where I accidentally erased the contents of a conf file. I am trying to use the cp and tail recovery process that I saw online but it does not appear to be working. The file ...
1
vote
1answer
81 views

Find tar.gz files in a folder which are older than 20 days and delete

I have a backup script which creates a backup (in tar.gz) of my /var/www-folder in my CIFS-mount-folder. To delete old backups which just waste memory I have created a cronjob that checks every day ...
-1
votes
1answer
41 views

Accidentally moved file to `,` (comma)

I logged in as a root user and when moving a file, instead of: mv myfile . I entered mv myfile , And now my file is gone but I am not sure where to. Where has it moved to?
1
vote
2answers
34 views

Reorganizing lines in a text file

So I have the following file: First Line Second Line Third Line 3 0.374 2 0.777 1 0.245 Fourth Line 4 0.687 ... And I want to reorganize it so the lines beginning with an int are appended to the ...
3
votes
2answers
45 views

Is it possible to display directory contents automatically while typing command?

I'm new to Linux. I wonder if it is possible to make terminal display directory contents automatically while I typing a command with directory arguments? For example, if I want to do cp ./fileA ...
0
votes
4answers
68 views

How to merge one directory into other?

May somebody tell me if there is there some way to "merge" one dir into another? I.e. let I have /some/directories/structure with subdirs/files. And now I want to "implantate" it into /etc for ...
0
votes
0answers
27 views

How do I hook an application and find out what files it writes while running? [duplicate]

I'm not sure how to exactly word this question, because my searching hasn't yielded anything that describes my situation what I'm looking for. Say my friend writes an application and sends it to me ...
1
vote
1answer
27 views

How do permissions on a directory affect files in it?

I just learned something that shocked me, because I did not have a clue it was a fact. If I have a directory with the following permissions: user@host:~$ ls -la testdir total 8 drwxrwxrwx 2 user ...
1
vote
3answers
176 views

Cannot remove <file>: No such file or directory

I just ran some self-written program in which I make files and fill them with stuff. However, I did something wrong (or at least, not as intended) with the name generation and now there are four files ...