Use this tag for questions about file management and operations on files.

learn more… | top users | synonyms (1)

0
votes
0answers
13 views

How to configure Double Commander to ask for my password and use sudo when it needs it?

As a Total Commander lover I am trying to replace it with Double Commander as Midnight Commander doesn't feel enough to me (needless to say standard single-pane file managers don't). One of the ...
52
votes
7answers
96k views

How to find creation date of file?

I want to find out the creation date of particular file, not modification date or access date. I have tried with ls -ltrh and stat filename.
0
votes
1answer
42 views

Help testing special file in `/sys/class/net/`

Background I am managing a cellular interface. I have a bash script that is testing the interface. In question is the file located at /sys/class/net/wwan1/carrier where wwan1 is an unconfigured ...
0
votes
3answers
32 views

Is there a way to know which files are being created, read or updated by running app? [duplicate]

I would like to list all files that have been read, created or updated from the app running.
1
vote
1answer
15 views

Terminal based Norton Commander program

I am looking for a terminal-based file manager like the good old Norton Commander or Total Commander...but all I have found so far are graphical and hence don't run in terminal. Is there any?
0
votes
4answers
10k views

How to write a Java Program / Shell Script combination such that you can call the Java program as a remote command and yet supply a local file?

This is related to How to execute a remote command on a local file? I wrote a simple Java program that prints the first line of a file - import java.io.BufferedReader; import ...
6
votes
3answers
251 views

Flatten the output of a recursive directory listing

Is there a way to list out all the files within a directory tree in a single list, sorted by modification time on Linux? ls -Rlt lists out files recursively, but they are grouped under different ...
4
votes
3answers
2k views

Obtain .avi file info from command line

What is the best way to obtain information as bitrate, framerate, width/height of an movie file (in my case .avi) from the command line? I am looking for a basic tool that works similarly as ...
4
votes
3answers
304 views

Bash - file, arrays and output

I have a file that contains employees names, departments and the cities the employee is in, something like: John IT Chicago Joshua accounting New York Marcy CEO Los Angeles ... I have to transform ...
36
votes
5answers
64k views

Script to monitor folder for new files?

How do I detect new files in a folder with a bash script? I would like to process the files as soon as they are created in the folder. Is this possible to do so or do I have to schedule a script with ...
0
votes
0answers
42 views

Google Drive HTTP Error when downloading .zip file with Firefox

I'm using openSUSE 42.1 and opened a fresh install of Firefox, but somehow when I try to download a zip file from my Google Drive, an error is shown: Could not download "[filename]". HTTP error. ...
0
votes
0answers
20 views

Tips for parsing proprietary file formats?

So I got a quarkxpress file. The problem is, it confidential, so I can't upload here. In general, given some proprietary file format, what steps can you take to recover data from it in linux? I have ...
21
votes
6answers
38k views

Linux ls to show only filename date and size

How can I use ls in linux to get a listing of filenames date and size only. I don't need to see the other info such as owner or permission. Is this possible?
0
votes
0answers
28 views

Files Just Go Missing On ext4 Partition (within TrueCrypt Volume)

There are spooky things happening on one of my external hard drives. It's a 3 TB hard drive with: one big partition taking up basically all the storage space there is, and a pretty small partition ...
1
vote
1answer
26 views

Restore file permissions after Windows copy

I lost my drive with my media center on it, and I realized that I had an old backup lying around. But when I went to restore my backup, I realized that all of the files had been copied with a Windows ...
2
votes
3answers
30 views

Find files with group permissions more restrictive than owner permissions

This is an actual work-related problem. Users could previously "su - userx" and was able to execute a script with user:owner permissions as userx:groupz 760 or 540, or modify a file that's ...
4
votes
2answers
52 views

Invert matching lines, NUL-separated

I’m writing something that deals with file matches, and I need an inversion operation. I have a list of files (e.g. from find . -type f -print0 | sort -z >lst), and a list of matches (e.g. from ...
1
vote
1answer
25 views

Evenly allocate resources over multiple desinations

I'm not quite familiar enough with bash to figure this out properly, I'll try to be brief with what I'm trying to figure out! I have many paths stored in a file, along with their size (in G), such ...
7
votes
2answers
4k views

File Permissions mode ending in @ or +

I was changing file permissions and I noticed that some of the permissions modes ended in @ as in -rw-r--r--@, or a + as in drwxr-x---+. I've looked at the man pages for chmod and chown, and searched ...
1
vote
2answers
49 views

list size of folders and their changed date

How can I list the size of folders as well as their changed date? I am able to get the size of folders using du. I am also able to list the folders together with their date using $ls -ltr $path | ...
5
votes
6answers
278 views

Find files older than X days and output them by their size

I am trying to get the files older than a number of days and list them in descending order based on their size with all their information (size, full path etc - something similar that is provided by ...
3
votes
1answer
310 views

I want to list all the files in my Linux server which are older than Dec 31, 2014

I want to list all the Linux files in a directory and sub directories which are older than 31 Dec 2014. Please help me out for this.
3
votes
7answers
3k views

Remove a specific extension from all the files in a directory

I have a couple of files with ".old" extension. How can I remove the ".old" extension without remove the file? I can do it manually but with more work: mv file1.key.old file1.key mv ...
1
vote
1answer
16 views

Rename files to insert _ between StudlyCapsified words

I've a music lib where files names are like 05WithoutWallsSpanishMixChillDeLucia.mp3 (no space between words BUT exist a capital letter at beginning of every word). How do I detect this string form ...
2
votes
2answers
140 views

reformat a text file to have all text on one line using CentOS 5.6

I have a 210-line block of HTML that I have stored in a HTML for debugging purposes. The HTML, as you would expect, is formatted accordingly so is stored in the file with spaces and tabs. Is it ...
61
votes
10answers
93k views

How do I loop through only directories in bash?

I have a folder with some directories and some files (some are hidden, beginning with dot). for d in *; do echo $d done will loop through all files, but I want to loop only through directories. ...
60
votes
6answers
52k views

What is a Superblock, Inode, Dentry and a File?

From the article Anatomy of the Linux file system by M. Tim Jones, I read that Linux views all the file systems from the perspective of a common set of objects and these objects are superblock, inode, ...
1
vote
2answers
52 views

How to fetch file with highest version number

abc_efg_2015_hanshake_01.csv.gz abc_efg_2015_hanshake_02.csv.gz abc_efg_2015_hanshake_03.csv.gz how to fetch file with highest version number and store it in a array.
3
votes
1answer
2k views

viewing dll and exe file properties/attributes via the command line

I have a need to see some additional file properties for exe and dll files. If I open windows explorer and add the additional columns to my view, I can see things like Company, Copyright, Product ...
3
votes
5answers
6k views

move file by list in file

I have a file that contains file names. For example: /tmp/list.txt (it is with the spaces at the start of each line): /tmp/file.log /app/nir/home.txt /etc/config.cust I want, using one ...
31
votes
7answers
3k views

Is it a UUOC (useless use of cat) to redirect one file to another?

If I want to make the contents of file2 match the contents of file1, I could obviously just run cp file1 file2. However, if I want to preserve everything about file2 except the contents—owner, ...
34
votes
8answers
72k views

List only regular files (but not directories) in current directory

I can use ls -ld */ to list all the directory entries in the current directory. Is there a similarly easy way to just list all the regular files in the current directory? I know I can use find find . ...
1
vote
1answer
24 views

How to navigate in dialog's file and directory selectors?

I wrote some shell scripts using dialog prompting the user for directories and files. However, I don't know how to change the directory. When I press Space in a dselect, the directory gets added to ...
22
votes
1answer
387 views

When did directories stop being readable as files?

I have the 1st edition of The Unix Programming Environment book. In chapter 2, the authors state that directories are readable as files, and mention some facts about the format of these files. They ...
0
votes
2answers
43 views

Replace numbers in file1 with corresponding line in file2

I have a file that looks like this File 1 3 123456789 3 00000 2 123456789 2 abcde 1 4 abcdefgh The lines in the first column correlate with the line number of another ...
2
votes
1answer
23 views

how to differentiate error returned while reading and for EOF in shell script

I have this task of uploading a delimited file and processing it. Once the processing is done, i either say its successful and if parsing fails, i need to throw the error. I'm reading this file line ...
11
votes
3answers
2k views

Why are some files and folders hidden?

I can understand the rationale of hiding files and folders in the /home/user directory to prevent users from messing around with things. However, I do not see how the same rationale can be applied to ...
4
votes
2answers
276 views

Unix Multiple Column Sort Issue

I am trying to sort a file: TX001;A0004|Number|5|0|Y|1 TX001;A0110|VARCHAR|5|0|Y|4 TX001;A1332|VARCHAR|15|0|Y|3 TX001;B3321|VARCHAR|15|0|Y|5 ...
1
vote
2answers
81 views

Remove file with pound signs around it [duplicate]

I am using SSH to another terminal with very limited disk space. upon typing ls I see a file called #korpus.txt#. I suspect this file is an emacs buffer, but upon running emacs and trying to kill it ...
0
votes
1answer
41 views

Opening .txt file when you open directory

Is it possible to automatically open *.txt file as you open certain directory on Ubuntu? We have a school assignment to make a text file to pop up when you open certain directory. For example, when ...
0
votes
2answers
27 views

How to auto run script upon driver reboot?

I am trying to set an auto run on my shell script (named driver_check.sh) which will trigger upon rebooting the driver. Basically, my script is as shown below: #!/bin/bash echo "Start script" ...
2
votes
1answer
36 views

Is there a way to create endless stream with custom character?

I need to create an endless stream of characters like /dev/zero but I need it to spam custom character (like 'a') instead of 0x00. Is there a way to do it?
10
votes
3answers
1k views

Why is it rm -rf and not rmdir -rf

I've always been curious why the command for deleting everything in a directory is rm -rf. Why aren't there flags to do the same thing with rmdir? Wouldn't it be more intuitive to use rmdir for ...
55
votes
4answers
17k views

locate vs find: usage, pros and cons of each other

In Linux and Unix systems there are two common search commands: locate and find. What are the pros and cons of each? When one have benefits over the other?
12
votes
5answers
859 views

mv: Move file only if destination does not exist

Can I use mv file1 file2 in a way that it only moves file1 to file2 if file2 doesn't exist? I've tried yes n | mv -i file1 file2 (this lets mv ask if file2 should be overridden and automatically ...
4
votes
2answers
56 views

Case … in, file type cases

I was given homework where I need to test if $1 is a file, special file or a folder in a Case $1 In statement. I tried some things but wasn't able to make it work. Do you have any idea on how to ...
1
vote
1answer
52 views

Concat all remotely distributed files in your cluster

I want to concatenate all abc_2015-12-15.txt files present on my cluster.Is there any best way to achieve this ? One way is to use below command across all nodes till all files concatenated :- ssh ...
1
vote
0answers
39 views

Removing duplicates in a large text list

I've searched around the internet and stackexchange for this. Even though there are lots of similar topics, I haven't found a solution yet. So, I have a quite large list (approx. 20GB), which ...
1
vote
0answers
40 views

Creating a sparse (automatically expanding and contracting) swap file with hole-punching support

I have this crazy idea, and want to know the pitfalls of such an approach (or whether it can even work with no deadlocks.. etc). The goal is to create an automatically expanding and contracting ...
2
votes
4answers
247 views

Transforming text to tabular form

I have a text file with the following structure: aaa bbb ccc ddd eee fff 1 2 3 4 5 6 1.1 1.2 1.3 1.4 1.5 1.6 ggg hhh iii jjj kkk lll 7 8 9 10 11 12 2.1 2.2 2.3 2.4 2.5 2.6 and I want the ...