Use this tag for questions about file management and operations on files.
0
votes
1answer
12 views
Keyboard shortcut to switch files in one Emacs instance?
I've multiple files opened in an Emacs client. Right now, to toggle between files, I've to click on the file name at the bar below in the editor. Any keyboard shortcuts for switching between files?
13
votes
3answers
10k views
How to merge all (text) files in a directory into one?
I've got 14 files all being parts of one text. I'd like to merge them into one. How to do that?
0
votes
0answers
32 views
Creating and writing to an UTF-8 file with C++ [migrated]
I have to create a m3u8 playlist in my http streaming C++ server code. m3u8 is nothing but UTF-8 m3u file.
How do I create an UTF-8 file (i.e. how to write UTF-8 characters to a file)? Maybe with ...
13
votes
1answer
211 views
How to move a directory, file by file? (instead of “copy then remove”)
My computer has one 500GB drive.
I want to move 400GB of data from /unencrypted to /encrypted.
Both directories are on the same partition, but /encrypted is handled by ecryptfs, so mv /uncrypted/* ...
4
votes
3answers
352 views
How can I exclude files by default with rsync?
How can I exclude files by default with rsync? Here is how my normal rsync syntax starts out:
rsync --exclude ".ht*" --exclude "error_log" --exclude ".DS*" --exclude "old" ...
I've seen a lot of ...
4
votes
4answers
5k views
Linux file access monitoring
Is there any way in unix to find out who accessed certain file in last 1 week? It may be user or some script ftp it to some other place. Can I get a list of user name who accessed certain file? How ...
1
vote
1answer
89 views
reading from a file and changing its pattern into an array?
I have a CSV file containging entries like this :
ipaddress,VLAN,VLANid
10.192.168.1,vlan-xyz,3
10.192.168.1,vlan-abc,8
10.192.168.1,vlan-mnp,11
10.192.163.24,vlan-llz,3
10.192.163.24,vlan-bbz,5
...
2
votes
4answers
92 views
Find and copy directories containing file type
I have a directory "Movies" containing subdirectories "Movie Name". Each subdirectory "Movie Name" contains a movie file and related image/nfo files etc.
I'm trying to copy all directories containing ...
2
votes
3answers
694 views
Gedit won't save a file on a VirtualBox share: Text file busy
I have a text file that I can change using other applications (for example openoffice). But when I try to change and save it using gedit, I am getting error from gedit:
Could not save the file ...
2
votes
1answer
199 views
Samba set share browsable only for a group
How I can configure samba to set browsable a share for a group only.
I wanna hide the share for all other users, if a set browsable to yes all the users can see the share when explore. I don't want ...
4
votes
3answers
735 views
shell script to read from multiple files in parallel
I need to write a script that runs parallel and looks for a string in multiple files. I tried a lot of options but they slow down the speed of my processor.
3
votes
3answers
82 views
How to move all files with a certain file extension from subdirectories to a single directory
I have a directory that contains many subdirectories. The subdirectories contain lots of types of files with different file extensions. I want to move (not copy) all the files of one type into a new ...
11
votes
5answers
6k 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 ...
16
votes
3answers
2k views
Clone ownership and permissions from another file?
Is there a command or flag to clone the user/group ownership and permissions on a file from another file? To make the perms and ownership exactly "like" that of another file?
2
votes
1answer
36 views
Unable to preserve ownership in a copy but able with a move?
I have noticed that I am unable to preserve ownership if I rsync -o files. However, I am when I move them. This is all without admin privileges. What is the rationale of this? Several threads e.g. ...
2
votes
1answer
47 views
how to keep file owner same for newly created files
This question is regarding samba file access.
I have created a folder A, and under folder A created two folders B and C. And also created three users A, B and C.
User A has access to all three ...
2
votes
3answers
137 views
file mass deletion
I would like to delete all the txt, xls,pdf files in a directory as well as its sub directories. I would like to save everything else.
find . -type f ! -iname '*.xml$,.png$,.jpeg$,.gif$,' -delete
...
6
votes
6answers
5k 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
1answer
53 views
Can I create a symlink that will ignore subdirectories?
I'm trying to get dropbox symlinked to the relevant folders in /home. I'd like to symlink them like this:
~/Dropbox/Pictures --> ~/Pictures
~/Dropbox/Camera Uploads --> ~/Pictures/Camera ...
2
votes
3answers
41 views
Get files on remote copy but not local
I have a folder.
I have one copy of this folder locally and one on a server. I edited my local folder as I wanted and then rsync it to the server.
Is there any way of comparing those two copies, ...
17
votes
4answers
694 views
Howto find duplicate files on disk
Is it possible to find duplicate files on my disk which are bit to bit identical but have different file-names?
1
vote
1answer
34 views
Getting back rsync's deleted files [duplicate]
I accidentally rsync-ed to a server using the delete attribute when I shouldn't have.
Is there any chance of getting the data on the server that rsync removed.. back?
0
votes
2answers
111 views
Redirecting stdin with stdout to file
So I have a program that takes in user input and outputs text based on the input.
EDIT2: I want to create a script that runs a C executable and the script feeds the C program input from a file and ...
1
vote
1answer
54 views
Standard I/O File Descriptors
I am new to Shell SCripting
I code this
$ ls -l 1> stdout.txt
and I get the output as desired,
1> stdout.txt
redirects the output from standard output to the file stdout.txt.
I don't ...
3
votes
2answers
53 views
Search by file dimension [duplicate]
I have many photos. How to search files by its dimensions? For example, i want to search images with exact dimensions 500 x 500 pixels. Is there any utility for this task?
5
votes
1answer
373 views
Immutable bit on AIX?
Under Linux I can:
chattr +i SOMEFILE
so that even root can't modify the SOMEFILE. Are there any similar solutions for AIX?
13
votes
2answers
7k views
How do I do a ls and then sort the results by date created?
In what order are the dated ordered by? Certainly not alphanumeric order.
ls -lt sorts by modification time. But I need creation time.
1
vote
2answers
144 views
Any programs suitable for making a database over disk-content?
I have quite a lot of external hard-drives, and often have a hard time finding what I'm looking for - not to mention not storing the same file several times on different drives or finding free space ...
3
votes
2answers
165 views
rm -fr not working
I have a directory that was generated by mistake by an application and this directory has a structure that involves more than 2000 directories, one inside a another, something like:
Directory aaaa ...
1
vote
2answers
27 views
Single process accessible temporary file
I want to create a file that is only accessible to the process that created it (and potentially its children), and that disappears when the process exits, ideally never persisting the file to disk. As ...
4
votes
2answers
65 views
How to upgrade shared library without crash?
Here it says that you can rewrite an executable file and the process will run just fine - it will be re-read when a process restarts.
However, when I try to replace a binary file while the process is ...
0
votes
3answers
54 views
how to delete temp and log files with terminal on vps?
I'm kinda pretty new to this but anyone know how to delete any temp and log files or these kind of files on vps with terminal? I'm runnin debian on the vps. I'm troubled since I can't locate those ...
27
votes
5answers
15k views
What is a Superblock, Inode, Dentry and a File?
From the article Anatomy of Linux File Systems by 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, ...
2
votes
2answers
68 views
How does Linux know the Location of File Data on Disk
related to: What is a Superblock, Inode, Dentry and a File?
None of the famous metadata structures hold onto to location data for the actual file. Dentry maps names to inodes, and inodes store ...
0
votes
1answer
49 views
LINUX: Permissions for files: Identify if it is a file or directory, and its access allowed to the world, user, and group [duplicate]
I am having trouble understanding permissions for directories and files in LINUX.
By examining permissions for each of the following files, identify if it is a file or directory, and describe the ...
6
votes
1answer
113 views
find is missing a result — how is that possible?
What conditions explain this output:
root@ip:/# find / -name "server.xml" -print
/etc/tomcat7/server.xml
root@ip:/# ls /var/lib/tomcat7/conf/server.xml
/var/lib/tomcat7/conf/server.xml
I am ...
6
votes
1answer
241 views
Stacked filesystems with write-back
I need to setup a system where a laptop and a desktop computers coexist.
The idea is, I bring the laptop into the network and the laptop syncs the /home directory( with some exceptions) with the ...
5
votes
7answers
807 views
Bash, remove oldest files
I`m trying to delete old files from directory and leave only 3 newest files.
cd /home/user1/test
while [ `ls -lAR | grep ^- | wc -l` < 3 ] ; do
rm `ls -t1 /home/user/test | tail -1`
...
4
votes
1answer
106 views
emblem for pdf created by libreoffice
If I create a test pdf file in a directory, by using something like
ls -al > testpdf.pdf
the file is shown in Caja 1.4.0 with an understandable emblem that is 'acrobat-like'.
If I create a ...
6
votes
4answers
155 views
How do I stop the root user from deleting a file?
I'd like to know if I can prevent the root user from deleting a file.
Is it possible?
2
votes
1answer
161 views
Sphinx Search shutting down after `FATAL: accept() failed: Too many open files`
I'm running Sphinx Search Server V2.06 ( the latest stable release ) on an Amazon EC2 with Linux CentOS. In general it is running fine, but the searchd.log is showing this error over and over with ...
4
votes
3answers
63 views
Replace all the occurences of a term in the files contained in a folder
In a folder on my system, I have a C++ project that I'm trying to compile.
This process uses some C++ idioms which are not supported by my compiler version. In particular, often inside the code it is ...
6
votes
2answers
232 views
Configuring File Associations in Ubuntu with Wine
Related to this question, I have Ubuntu 20.04.1 LTS. I downloaded PlayOnLinux 4.1.9 (the Precise version) and used it to install Microsoft Office 2010 Pro. PlayOnLinux downloaded Wine 1.5.21 and ...
1
vote
1answer
30 views
Error writing /home/alessiomtx/.config/tint2/tint2rc: Not a directory
I need to edit my ~/.config/tint2/tint2rc because the file is blank and so I don't have tint2 shown in my desktop, but when I try to save I have this error:
[ Errore durante la scrittura di ...
1
vote
1answer
44 views
Program for identifying files from unfinished torrent-downloads?
Are there any programs that can help identify files and directories belonging to unfinished bittorrent-downloads? I've made a mess, and I'm unsure of which downloads are finished and which are not. ...
3
votes
2answers
66 views
How can I backup a directory to NTFS while preserving Unix file attributes?
I want to make a backup of my home directory to an NTFS partition (an unfortunate limitation). However, when I last tried using just cp, the attributes (owner, etc) went away. How can I make a backup ...
2
votes
1answer
94 views
Script to check a folder, print the files then delete those files
I am looking for some guidance on creating a script that will check a specific folder, print all documents (if any) and then delete those documents. I would also like to run this script as a cron job. ...
0
votes
1answer
48 views
Rsync adding a “?” at the beginning of directories
I currently have many of these commands running in a .sh file that looks like this:
rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup
rsync -avz ...
1
vote
0answers
36 views
Existing file can not be found? [duplicate]
/usr/share/tipp10$ ll
insgesamt 9408
drwxr-xr-x 3 myname ssl-cert 4096 Feb 26 20:07 ./
drwxr-xr-x 288 root root 12288 Feb 26 20:07 ../
-rwxrwxrwx 1 myname ssl-cert 9480 Okt 6 2010 ...
2
votes
1answer
88 views
“rm -rf Filename.iso ” Permission denied
Hi I am facing an issue while deleting an .iso file from Linux x86_64 GNU/Linux.
Here are the permissions for the file:
# ls -lrt
-rwxrwxr-x 1 dev devgrp 2687934464 Apr 12 14:13 ...




