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

learn more… | top users | synonyms (1)

1
vote
2answers
53 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.
1
vote
1answer
25 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 ...
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 ...
0
votes
0answers
30 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 ...
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, ...
4
votes
2answers
277 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 ...
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 ...
1
vote
2answers
90 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
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 ...
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 ...
12
votes
5answers
895 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 ...
1
vote
0answers
40 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
44 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 ...
1
vote
4answers
169 views

How to sort files by part of the filename?

Given the files below: ABC38388.SC01.StatueGrade_MKP ABC38388.SC02.Statue_GKP DEF38389.SC03.Statue_HKP XYZ38390.SC00.Statue_WKP How can I list them all based on the SC value, like this: ...
0
votes
0answers
40 views

How to write into local file and set its content to a variable within a ssh command substitution

I would like to write on local file (or local variable if better) and set its content to a variable within a ssh command substitution. Here is my code : REMOTE_OUTPUT=$(ssh remote@server /bin/bash ...
0
votes
1answer
33 views

Unable to mount a windows share drive

I have to access some files present in a windows share drive from a linux machine which is running centos. I am able to do this from a Mac machine using the command sudo mount_smbfs ...
1
vote
1answer
28 views

Are device files implemented by device drivers or OS kernels?

Device files are interfaces of device drivers to user programs. In Linux, is a device file implemented directly by its corresponding device driver, or by the OS kernel (excluding the device driver)?
0
votes
1answer
58 views

CentOS 7.1 - how to install gnome commander

I have CentOS 7.1 and cant install gnome Commander. I dont see it in the Software module as well as yum install gnome-commander does note see the package. I tried RPMs from ...
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 ...
3
votes
2answers
63 views

Find files recursively, but choose largest from among those with duplicate names

Given a nested directory structure containing various files, I would like to find all the files within it, but where there are multiple files with the same name, I'd like to return just the largest ...
1
vote
3answers
48 views

How to find out where a certain subdirectory is mounted?

Let's say that /var/log is /dev/sda2, and /var/spool is part of /var which is part of / which is /dev/sda1. Now I'd like to issue a command like $ sudo get_mountpoint_of /var/spool and get the ...
1
vote
1answer
27 views

Is there any way to list the latest GUI transactions in Linux?

Suppose that I've moved a directory in my Xfc desktop in another directory, which I can't remember the name of the destination directory. Is there any way to list the latest transactions in ...
2
votes
1answer
43 views

What happens when multiple processes try to mv the same files between two different filesystems

I accidentally launched 32 processes (one process per core on my virtual machine) to mv some files between two ext4 filesystems, but only some of them were successfully mv'd: for i in `seq 1 32`; do ...
0
votes
2answers
47 views

Folder in /tmp won't delete despite the computer being restarted

There is a folder in /tmp/ that won't delete despite my computer being restarted. I know it's not being recreated at restart since the last edited and added date is 23 November 2015. I do know which ...
1
vote
1answer
46 views

group files into fixed-size chunks

Example: Say I have 20 000 images and I need to group them into folders in order to burn them to a CD (max 700MB / folder). General: I have N files and I need to group them into M groups, so that all ...
0
votes
2answers
79 views

File System with permission as “rwxrwSrwx”

I have a shared directory from SAN, whenever I create a folder or file inside that directory, it already has permissions; for directory we have "drwxrwxrwx" permission and for files we have ...
1
vote
1answer
29 views

Cannot share directories between virtualbox and Desktop

I need to share the Desktop directory in order to copy some files I need from there. This is a Virtualbox and I'm running Ubuntu 14.04. But the "Desktopy" link is not showing up in the media ...
0
votes
0answers
8 views

Access images in Mint 17.2

Linux Mint 17.2 has lots of magnificent images that appear on the login screen. I would like to use these images for other things, such as the desktop background. Can anyone tell me where I might ...
1
vote
1answer
22 views

Transmission: Get rid of old never removed files?

I've been using transmission to download various torrents, but every now and then transmission does not remove the file but removes the torrent file. This makes it that my download folder is full of ...
2
votes
3answers
347 views

Copy content from files X and Y to create file XY but XY content is all lowercase

What's the right command to copy the content from file X and File Y to create a new File XY with all letters being lowercase?
0
votes
1answer
40 views

how to get latest file in each dir

Is there a Unix command to get the latest file in logsarchive of each dir of /app/instance? In the example below, I have 5 folders in /app/instance: as_a, as_b, as_c, aunz, naeu and I need to get the ...
1
vote
2answers
37 views

path of folder within a folder in terminal

I have a number of files that are saved as Year -> Month -> Day -> bunch of .nc files I would like to generate a list of all of the directories that contain the nc files. I can list the ...
1
vote
1answer
36 views

Create file for every result of find command?

With this line of code I generate an output of every result. exec("find ics/ -mmin +3 -type f -name '*.pdx' -exec basename {} ';' > ./tmp/filename") How can I generate a file with dynamic file ...
5
votes
2answers
440 views

How do you call the “happy-dog” part of file “happy-dog.png”?

I just realized I don't know how file is called in file.ext. The whole file.ext is called a file or filename, ext is called extension but how do you call the file part itself of file.ext? For ...
14
votes
1answer
299 views

Why does ArchLinux keep some users/groups after package uninstallation?

I've noticed that after uninstalling the postgresql package in ArchLinux the postgres user and group are not removed automatically. The same is true for some other packages. Investigating this ...
1
vote
1answer
31 views

Linux - wrapper to monitor an application's file access?

Are there any user-level wrapper-like scripts/programs that can watch what files an application accesses, without impacting performance? I'm trying to capture what files are produced by an automated ...
0
votes
0answers
18 views

The order in which the the files are copied from the folder using sftp

I m transferring a folder to a destination server via sftp which has 8 files in it out of which one is the summary file ,this contains the details of all the other 7 files. At the server end we ...
1
vote
1answer
21 views

Replicating growing log files in a near real-time manner over the network

I have a server with a bunch of processes writing log files as they run. I need to enable a client host to get a replica of the server-side log files in a near real-time manner. Is there a better way ...
0
votes
1answer
25 views

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

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 ...
1
vote
2answers
44 views

Merging two files using scripts

I am trying to merge two files of different lengths using a script. I want the longer file to be appended to the end of the shorter file and when both files are of equal length they are suppose to ...
1
vote
1answer
24 views

Displaying a file in another file [duplicate]

I was wondering how to print the contents of a file above the occurrence of a pattern in another file. I know that using sed -n '/^PATTERN/i\\ INSERTING' filename would insert above the pattern but ...
3
votes
4answers
101 views

How do I create a text file (1 gigabyte) containg random characters with UTF-8 character encoding?

The following command does not use UTF-8: head -c 1M </dev/urandom >myfile.txt
2
votes
5answers
145 views

List (or move) only files with a certain number of lines?

Dealing with a whole bunch of two-line config files, I'd like a way to exclude any files that have a different number of lines. So, something like: mv * destdir only if file contains exactly two ...
2
votes
0answers
21 views

Set default program for one specific file in Nemo

There's a lot of questions on how to change the default program for a specific file extension, but I want to know if I can change the default program for a specific file. Reason: Some PDFs don't ...
5
votes
1answer
19 views

What are SELinux “.lst” files under /usr/share/selinux/targeted on CentOS 7?

I can see several ".lst" file under /usr/share/selinux/targeted on CentOS 7: base.lst modules-base.lst modules-contrib.lst nonbasemodules.lst ".lst" files contain a list of SELinux policy ...
0
votes
2answers
58 views

how to delete larger file (e.g., 180G) in unix system?

Because of some reasons, my server machines had some too-large files (e.g.,:180G), How can I delete these files quickly?
1
vote
2answers
46 views

Rsync behavior with changed files

When after running rsync for the first time a file is changed on the source, when you next run rsync on the same filesystem does it copy the whole file from the source again or just the changes to the ...