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)

2
votes
0answers
20 views

RHEL / SELinux - Apache unable to write to a directory it can write to [duplicate]

I have a RHEL 7 machine running an Apache web server with multiple virtual hosts on it. I've recently run into an issue where I am unable to upload media, e.g. images / pictures / video, to my machine ...
0
votes
0answers
16 views

Search multiple remote file systems at once?

Say that I've lost a particular file. I know part of the name, so I could use something like this to find it: sudo find / -iname "*filename*" ...except that I can't remember which device or server ...
39
votes
8answers
50k views

Find the total size of certain files within a directory branch

Assume there's an image storage directory, say, ./photos/john_doe, within which there are multiple subdirectories, where many certain files reside (say, *.jpg). How can I calculate a summary size of ...
52
votes
9answers
127k views

How to list all files ordered by size

I would like to list all files in the order of big to small in size and the files could be present anywhere in a certain folder.
-1
votes
1answer
435 views

How to find the htpasswd file created for SVN over Apache?

I setup subversion with remote access over apache. I created an htpasswd file for it, but now I've forgotten the filename and path. How can I find it?
0
votes
0answers
18 views

find lastly zipped file in a directory which has so many zip files [duplicate]

I am trying to make a script in that i need to execute a command which can give me the lastly zipped logfile(ex:my log file is going to be zipped toady so i need to place this file in script.likewise ...
1
vote
1answer
41 views

How to convert file from one format to another with file attributes?

I have an audio file named with attributes: BreakingNews.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz I wanted to convert it to in below format: BreakingNews.wav: ...
22
votes
8answers
41k views

Test if there are files matching a pattern in order to execute a script

I am trying to write an if statement to test whether there are any files matching a certain pattern. If there is a text file in a directory it should run a given script. My code currently: if [ -f /*...
1
vote
1answer
46 views

How do I rename files that have '|' in them?

I am using Fedora 24. I have tried many different ways to do this. I've tried it under a Windows VM with the folder in question as a shared folder. I've tried using the 'rename' command. I've ...
1
vote
1answer
60 views

Understanding file systems and mount points as seen from df and Nautilus

Forgive me I am a novice of Linux. I am trying to understand Linux file system. Let's say we run df command to show something about file system in my CentOS. I can see a LVM /dev/mapper/...
0
votes
1answer
29 views

how to keep oldest file in same directory

I had 2 directories "../in/" and "../temp/".My question is how to write bash script to keep the oldest file or directories in same ../in/ directory and remaining files or directories are moved to ../...
0
votes
0answers
23 views

Unrar specific files using wildcards

I want to extract only a specific file type using unrar. With unzip command I can extract all archives with a specific extension. unzip "$FileName" *[.txt,.TXT] How can I do the same with unrar? ...
-3
votes
0answers
35 views

File attributes and permissions [on hold]

From above example barney isn't owner or member of group for file lfile2 then why he can't delete that file ? I mean that, answer of last question is none. Barney is supposed to be able to delete ...
2
votes
1answer
1k views

How to create gcov files for a project in a different dir?

I want to analyze code coverage datas. I want to create gcov files from OpenSSL (and from other projects), but I can only create them in the same directory of the project, and only for the files in ...
-1
votes
0answers
30 views

How to find delimiter of a text file in linux? [on hold]

I have text file with first 7 lines having no data, from 8th line it has many columns and couldn't open the file. So, I want to check the delimiter of this text file from linux. Can anyone please tell ...
0
votes
0answers
18 views

How to prevent special group to delete files or folders?

Folder path: /var/www/html group name: "ftpusers" user: "admini" How to prevent from group "ftpusers" to delete files or folders in html folder, but allow them to create files or folders? User "...
2
votes
2answers
41 views

How can a user Edit a file even when Write bit is off on a file

Here is the thing i just had a urge to play with umask on my training machine. i created test user john and logged in using john. and set the umask to 0200 and created a testfile in vim and saved it. ...
1
vote
1answer
30 views

how to search file for begin of string and save a variable

i am trying to find a way of searching a file for string, it needs to work by searching then file and if any line in the file begin with what i am searching for, then take that whole line and save it ...
-1
votes
3answers
44 views

What does it mean “Everything in the Linux is file” [duplicate]

Forgive me I am a novice of Linux. I just read the post here. It just said. This statement is true because there are special files that are more than just files (named pipes and sockets, for ...
0
votes
1answer
36 views

Does file directory/folder your code is in matter when using python3 modules ? I had an Issue [on hold]

I am asking as lately while doing python GUI programing I installed tkinter by doing apt-get install python3-tk everything went well and when I opened python3 console while I was in the following ...
3
votes
4answers
285 views

Delete file with filename that contain unallowed characters

In /tmp dir I have file with this filename: .<?php passthru($_GET['cmd']);echo 'm3rg3';?> I can't remove this file by normal means and have tried with quoting this filename with no results. ...
3
votes
1answer
43 views

Sort files into folders, depending on filetype

I have about 2.8TB (yes, terabytes) of data I have recovered, this will be scanned for duplicates, the machine these files reside on is quite old and only has 2GB of memory (works fine for LVM, ...
0
votes
1answer
26 views

Using File manager with Second Hard Drive

I am going to install Ubuntu 16.04 on a new hard drive and install my current HD as a second drive. (It will stay there until I can copy over my /home directory to the new drive.) My questions is, if ...
1
vote
2answers
45 views

How to display the contents that give rise to the sizes that `ls -l` reports for directories?

I understand that the sizes that ls -l reports for directories reflects the space taken up by the "metadata" for those directories. Also, I imagine that this metadata exists in binary/non-human-...
-2
votes
3answers
23 views

Making tar file to un tar file

using Red Hat Enterprise Linux Server release 5.6 (Tikanga), when I fire tar command it's taking huge time to untar file. Below is the command which I have used: tar zcvf filename.tar filename ...
3
votes
2answers
44 views

magic example using search and/or regex

I am trying to have the file command detect some Windows text files that were never meant to be classified by file... The best choice seems to use regex to match the line content, but I cannot find a ...
0
votes
1answer
44 views

Rename file (Prefix) with full path?

I'd to Prefix my files (.dat) like this : CLY_BIZ_COM_PERD.dat -> 20160622CLY_BIZ_COM_PERD.dat I have tried the following: key=`date "+%Y%m%d"` for i in $(ls /Path/*.dat); do mv ${i} "${key}${i}...
0
votes
1answer
35 views

Rsync to copy specific subfolders and files to new directory

Original path, RootFolderI: RootFolderI/FolderA/Subfolder1/Subsub1/JPG1.jpg -> want this jpg RootFolderI/FolderA/Subfolder2/Subsub1/JPG2.jpg -> want this jpg RootFolderI/FolderA/Subfolder2/...
1
vote
5answers
54 views

How can I use the rename command to fix these file names?

I'm trying to change files that look like 01 Track name.mp3 into 01 - Track name.mp3 So far my futile attempts were rename '0. ' '$&- ' *.mp3 rename 's/0. /$&- /' *.mp3 rename '/0. /' '/$&...
1
vote
1answer
35 views

How to get file owner in AIX without munging ls output?

How might I reliably get the owner of a file in AIX? By reliable, I don't want to parse the output of ls. On Linux, I would just do a stat --printf=%U foo, but I'm working on AIX 6.1 and 7.1. I ...
6
votes
2answers
382 views

Remove all files with a prefix except the one of the largest size

What is the best way to remove all the files in the current directory with some prefix, except the file with this prefix but having the largest size among all the files with this prefix? (In the ...
-2
votes
1answer
52 views

cat command appears to be adding extra $ character at the end of each line

I am trying to create a file and it looks like the vi editor is adding a $ at the end of each line. I don't know what's causing this or how to prevent vi from doing it. vi file.txt 12345 abcde cat -...
5
votes
3answers
594 views

Duplicate file x times in command shell

I try to duplicate a video file x times from the command line by using a for loop, I've tried it like this, but it does not work: for i in {1..100}; do cp test.ogg echo "test$1.ogg"; done
4
votes
1answer
161 views

Where is information about hard/soft links stored?

Where does the *nix system store information about number of hard links to a specific inode? I can't find any information about that. Everywhere what a hard link is but rarely a bit more advanced ...
1
vote
3answers
45 views

Move files by reading their file names to different directories

I need to move files by reading their names. I have to move system generated files and the names include a time stamp. I need to move the files by reading the file name by month. If the file name ...
3
votes
2answers
60 views

Can you tell if a file has been renamed?

Many tools out there for syncing files aren't quite right for syncing you're home directory. Because of this, and to learn Ruby, I've been working on my own sync tool. An issue I've encountered, ...
2
votes
2answers
63 views

How to refer to multiple files from a directory to one command

I have a command that needs to take multiple input files, which are originally from one directory and have certain file name patterns. For example: In directory /home/mydir/ I have files: A.dat B....
30
votes
2answers
32k views

What are character special and block special files in a unix system?

How are character special files and block special files different from regular files in a Unix-like system? Why are they called “character special” and “block special” respectively?
15
votes
3answers
11k views

Finding all “Non-Binary” files

Is it possible to use the find command to find all the "non-binary" files in a directory? Here's the problem I'm trying to solve. I've received an archive of files from a windows user. This archive ...
1
vote
4answers
75 views

script to delete files if there is no corresponding file with the same name but a different extension in another subdirectory

I have a series of preview images and RAW files in a directory structure (shown below), I quickly review the preview images, and delete those that I don't want. The RAW files are in a RAW ...
67
votes
12answers
84k views

Efficiently delete large directory containing thousands of files

We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something ...
4
votes
4answers
1k views

How to count occurrences of all the words in all the files of a directory using grep? But with count incremented only once per word per file

I have already asked a similar question but people misunderstood what i was asking. I was asking how to generate a list of every word with a word count incremented only once per word per file. For ...
1
vote
1answer
32 views

How to convert GBK to UTF-8 in a mixed encoding directory?

Background : You can skip this section, if you are not interested in. I usually backup my MicroSD card of my cell phone, with command sudo dd if=/dev/sdc1 of=~/Document/Cell\ Phone\ Files/...
4
votes
1answer
27 views

Why am I able to open this file?

While debugging a USB device usage I've come across a puzzling behavior of open(2): admin@anahata-core-i5:/tmp$ groups admin sudo admin@anahata-core-i5:/tmp$ ls -l /dev/bus/usb/001/051 crw-rw----+ 1 ...
-1
votes
1answer
29 views

Read file and write output in another file using shell script

My input file is: Employee e_id e_name 100 abc 101 xyz 102 pqr Salary e_id e_salary 100 12345 101 67890 Dependents e_id depp1 depp2 100 qwer tyui 102 asdf ghjkl I want the output line by line ...
4
votes
1answer
53 views

Decode binary output from Fortran program created on Sun Sparc system

I have one f77 file,which was created on SunSparc machine.I know that each record contains 5 reals and one integer.Is there any way how I could unpack that file on my Ubuntu 16.04 Intel little-endian ...
3
votes
4answers
850 views

Copy All Files With Certain Length File Name

In directory /source I'd like to copy all files with a file name more than 15 characters to directory /dest. Is there a UNIX command to do this? EDIT: Although this question explains how to search ...
2
votes
2answers
91 views

Something like a symbolically linked file, but with change details attached?

Is there a file type or method for using files in which certain files look and behave like symbolically linked files, but contain extra meta information for changing the data when they are read? ...
0
votes
2answers
35 views

How do I make a server automatically move files?

I have a folder and I would like all the files that are put into that folder to instantly be moved to another folder. Is this possible.
4
votes
1answer
73 views

Is posix_fadvice / POSIX_FADV_DONTNEED functional in Linux?

If I am doing once only scanning across big files then do I need to worry about impact on the page cache or does the OS take care to avoid my scan causing pointless churn in the page cache. I want to ...