Questions tagged [files]

Manipulating files: copying, renaming, searching, analyzing, archiving, etc. For operating on text in a file, see /text-processing. For questions about the Files file manager (formerly Nautilus), see /nautilus.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

how to convert list of txt files in one directory to make another list of csv files of same name, not one csv file?

i need to convert list of txt files in one directory to list of csv files of same file names .I don,t need to convert one csv file
user avatar
0 votes
1 answer
38 views

How can I optimize the transfer of files between two systems and also trim the file

I have computer 1 logging voltage data to a file volts.json every second. My second computer connects via ssh and grabs that file every 5 minutes. Splunk indexes that file for a dashboard. Is scp ...
user avatar
  • 129
-1 votes
2 answers
58 views

How to actually copy a file to a USB, instead of whatever it is happens now

I tried finding the answer online, but the search results don't match my query anymore How does anyone copy a file to a USB with normal expected behavior like it was for decades, when after the ...
user avatar
2 votes
2 answers
102 views

How to provide grep a file with ip addresses to look for in access.log

Situation I have a file where each line has an IP address and I want to see if these Ip's are found in access.log File name: IpAddressess Contents example : 192.168.0.1 192.168.0.2 192.168.1.5 etc etc ...
user avatar
3 votes
1 answer
25 views

Adding/permitting "staff" to read/write in folder

For some reason, there isn't "staff" user group on a folder that I just created. How do I add/permit "staff" user group to a folder that I just created? This post, seems to suggest ...
user avatar
0 votes
1 answer
20 views

Changing file permissions in inodes while a user has the file open

According to this SO question, when we open a file to read it we only check permissions once when we open it. And if we change the permissions of the file and say the user is no longer allowed to read ...
user avatar
2 votes
1 answer
477 views

Allow all users to create files in directory, but only the owner of the file should have write/delete their own files

I would like to create a shared directory which should have write permissions for the particular group, but only the owner who creates the file should have write/delete on their own files. For example,...
user avatar
0 votes
0 answers
30 views

Problem with read command while searching txt file line by line

I am trying to do a simple dictionary of words inserted by user which are collected in txt file and then the function to learn them. Words in two different languages are seperated by a chosen ...
user avatar
  • 1
1 vote
1 answer
23 views

Debounce inotifywait for large files

I upload files for deployment into a remote directory. That remote server has a script that watches the directory for new files: inotifywait --monitor --event create --format '%f' --quiet /foo When a ...
user avatar
  • 1,427
4 votes
3 answers
831 views

When and why should I sync a file in Linux?

I've read information about the use of sync command in Linux and how it works. But I'm unable to understand when I really should use it in files and I don't find practical examples. For example, the ...
user avatar
0 votes
1 answer
25 views

How to recursively delete the contents of all "node_modules" directories (or any dir), starting from current directory, leaving an empty folder?

Suppose I have a directory structure like this: projects/ project1/ src/ node_modules/ dir1/ dir2/ dir3/ file project2/ node_modules/ dir4/ Starting from ...
user avatar
  • 125
-1 votes
1 answer
24 views

Matching columns in two files

I have two files. Some of the names in file1 are also in file2. How to assign the column $3 a $4 of the second file to the first one following the match between $3 of the first file and $2 of the ...
user avatar
0 votes
2 answers
86 views

Pipe find list of files into xargs gzip and pipe again into pigz

I need to find files newer than x days, and then turn it into a gzip, but I want to do it using pigz. For now I'm now doing it the slow way; this works: find /path/to/src -type f -mtime -90 | xargs ...
user avatar
0 votes
0 answers
47 views

Unable to decompress gzip file ("not in gzip format")

I've been tasked with diagnosing an issue with a webpage, and I've been able to trace the issue back to a gzip'ed JavaScript file, jquery.min.js.gz. To view the code, I've downloaded and attempted to ...
user avatar
0 votes
1 answer
41 views

Transferring files from Windows SSD to Linux SSD in the same PC?

How would this scenario work: One PC with a Windows SSD and a separate Linux SSD. I want to run a Windows virtual machine within the Linux SSD. Transferring of files would only be done while booted in ...
user avatar
-3 votes
1 answer
111 views

Is it ok to delete the /srv directory?

Is it okay to remove the srv$ directory in Kubuntu 20.04 There seems to be no files contained inside and it will clear up the structure. after research I found that it was very much up to what I want ...
user avatar
3 votes
2 answers
160 views

What is the behavior of O_APPEND with lseek: can you rewrite a file opened in O_APPEND?

The docs on man lseek say, If the O_APPEND file status flag is set on the open file description, then a write(2) always moves the file offset to the end of the file, regardless of the use of lseek(). ...
user avatar
  • 22.9k
4 votes
1 answer
165 views

feed output of command to another command as file

I can make config file of tor with cat <<EOF command as follows : cat <<EOF SocksPort 9050 ControlPort 9150 DataDirectory /usr/var/lib/tor/torrc EOF but it can save output with redirect &...
user avatar
  • 43
0 votes
1 answer
49 views

How to delete entire directory fast in under 1 hour that contains millions of files and nearly 18TB of data? [closed]

My backup program backed up entire other drives multiple times by accident to one of my large drives and therefore hogged the entire drive. I already have backed up to another drive what I need from ...
user avatar
0 votes
3 answers
74 views

How to iterate over top 5 lines from a file with bash?

I can iterate over the lines of a file this way: while read l; do echo $l; done < file Is there a way to iterate over only the top 5 lines?
user avatar
2 votes
1 answer
55 views

What does mediainfo mean when it says a video is truncated?

I have two ways of checking for damaged video files. The first is using mediainfo and runs instantly: mediainfo "$1" | grep --color 'IsTruncated' The second is manually going through the ...
user avatar
  • 9,553
25 votes
1 answer
2k views

Unable to delete this file as root [duplicate]

I'm unable to delete a file with rm -rf /home/wordpress/testDomain.com from my Linux machine. Instead of the file being deleted, I get an Operation not permitted error. How can I fix this? $ cd /home/...
user avatar
  • 461
0 votes
2 answers
27 views

Copy a file with its parent dirs to a destination directory

Source file : ~/SCRIPTS/script Destination directory : ~/TMP/LAB the command should be something like : <command> <option> ~/SCRIPTS/script ~/TMP/LAB Desired result after the command : ~/...
user avatar
  • 874
0 votes
0 answers
28 views

Leftover files on Linux, spotting them automatically?

I wanted to run an Android app on Waydroid, so I installed it from the AUR. Unfortunately, the app would reject any emulated device. As I had no other use for Waydroid, I uninstalled it with pacman -...
user avatar
0 votes
0 answers
14 views

Empty file but cat shows contents [duplicate]

When trying to set up an automatic backup of the /etc directory I noticed that some files seem to be empty but catting them shows some contents. One example I found is /etc/mtab which is a symbolic ...
user avatar
0 votes
2 answers
57 views

How to list files with only name and size

I would like to list the content of a directory, 1 line per entry, with only the files names and the files sizes. ls -l shows too much information. ls -1 -s doesn't show a file's size but its ...
user avatar
  • 1
1 vote
2 answers
58 views

Can I copy a snapshot of a file that's being constantly modified?

I have a file that's being constantly held open and continuously modified by another process. This process is continuously seeking to different parts of the file and writing new blocks. I'd like to be ...
user avatar
  • 113
0 votes
0 answers
28 views

Creating a shared folder [duplicate]

Before I start I would like to point out that I read over 40 questions on the same topics on this forum and they just never work. I have users all in the same group shared_grp. I want them to all be ...
user avatar
  • 1
0 votes
2 answers
36 views

Tried to open external harddrive img file

I have an img file, which is packaged in a centos virtual machine. I don't know how to open it. Now I have "parted" it on another machine and found that it is an lvm structure. The question ...
user avatar
  • 11
0 votes
0 answers
26 views

Can we set user permission to create a file but not a subdirectory in a directory? [duplicate]

Is it possible to give permission to only create files but not a directory to a user in linux? abc@xyz:~/temp$ touch a abc@xyz:~/temp$ mkdir b abc@xyz:~/temp$ I want mkdir b to fail but touch a to ...
user avatar
0 votes
0 answers
63 views

Exporting Python's script errors/traceback to file with netcat

I have a Python script accessible with netcat: nc 'serverIP' port. The Python script awaits an input from the user. If the input is expected, the script keeps running. If the input is unexpect (e.g. ...
user avatar
2 votes
0 answers
69 views

How to find (and move) all duplicate file names [duplicate]

Due to moving files back and forth from my Linux PC to a Mac, I now have a few documents that duplicate. Their names seem identical, but apparently they are codified slightly differently, like in this ...
user avatar
2 votes
1 answer
308 views

What will happen to the rest of the file if write() is interrupted by a power cut?

I am calling write(fd, buf, N) on a normal file descriptor. The file pointer before calling is not at the beginning or end but instead somewhere in the middle of the file. The call is than interrupted ...
user avatar
  • 341
2 votes
1 answer
31 views

rsync include only subdirectory

at the moment I am struggling to find a solution to include only files in a subdirectory but exclude all other stuff. File structure looks like this $ tree ../ ../ ├── from │   ├── a │   │   ├── aa │  ...
user avatar
  • 23
0 votes
0 answers
32 views

Extracting torrent's file structure out of transmission

I screwed up my torrents' download directory (I executed mv */* . twice in it) and would like to repair it now. If you have an idea how to do this feel free to comment, but I already have an idea ...
user avatar
1 vote
1 answer
37 views

How to sync two folders with the same file names but different extensions

Is there a means of using rsync to sync two folders? I would like to shoot photos in JPG and RAW. Since viewing JPGs is much quicker than opening up RAWs, I'd like to do culling in the JPG folder and ...
user avatar
-1 votes
1 answer
46 views

One master ksh file to call 2 ksh script files [duplicate]

I have 2 ksh (korn shell script) : file1.ksh and file2.ksh; and I want to have a master file ksh script that will call the 2 files; what's the code I have to put in my master file? Thanks
user avatar
  • 1
1 vote
0 answers
28 views

What is the complete list of file functions equivalent to the "strace -e file" options?

According to man strace the -e file option traces all syscalls which take a file name as an argument. What is the whole set? %file file Trace all system calls which take a file ...
user avatar
2 votes
0 answers
33 views

How to hide all files with a certain filename extension in Nemo?

I've got a bunch of dxvk-cache files in a particular folder that really adds a lot of clutter. I tried making a .hidden file in the folder with *.dxvk-cache as a line to hide them from my file manager ...
user avatar
0 votes
0 answers
15 views

add a link/command to the "create new" context menu

I'll try to stay as straightforward as possible by not going into too much details. I want to have a way to add a dynamic template for empty pictures that I can later edit. The way I wanted to do this ...
user avatar
0 votes
1 answer
43 views

Why are .z.* files created for

In my home folder I have realized that there are plenty of .z.* files are created. They all are empty. I have no idea which process have created them. What might be the reason all those files are ...
user avatar
  • 229
0 votes
0 answers
15 views

After remove a duplicate file, bash still tries to exec this [duplicate]

Title is confused. I had installed a library manually for QGis. Now, I am trying to remove their files one by one (probably it will finish in disaster, I know), but there are a curious issue for me. I ...
user avatar
0 votes
1 answer
26 views

How to display the paths to all files that have a size greater than the specified limit

I need to output the paths to all files that have a size greater than the specified limit (declared as a variable). I've done it using find script: FILESIZE = "+10M"; find "$1" -...
user avatar
  • 39
1 vote
1 answer
40 views

Inserting a file without altering the folder's modification timestamp?

I have hundreds of folders with modification timestamps I'd like to preserve. Now I need to copy a single file into them. Aside from this way... timestamp=$(stat -c %y /foldername) cp /tmp/file.jpg /...
user avatar
  • 315
2 votes
2 answers
74 views

Filtering file list to show only files alphabetically after certain file

I have a huge number of images from which I'd like to feed some to ffmpeg time to time. But I only want to feed ones that are alphabetically after certain image (last frame of previous run, name ...
user avatar
  • 23
1 vote
0 answers
31 views

How to find the PHP file which prints an HTML element with a certain selector?

I store my MediaWiki 1.36.1 website with Skin:Timeless on NameCheap with a shared hosting environment with Cpanel file manager and SSH shell access. In my website, there is a certain footer element ...
user avatar
-2 votes
1 answer
62 views

What are the implications of adding "./" to relative symbolic links?

I noticed that when I create relative symbolic links, starting the source path with ./ keeps it that way and starting with an alphanumeric character keeps it that way, despite them both meaning the ...
user avatar
  • 219
2 votes
1 answer
71 views

VIM shows ^@ every other character and ^M^@ at the end of line

Sorry if it's answered somewhere, I have no idea how to look for it. I received a series of reports from a bank that I'm supposed to process and they seem to be... badly encoded? First two lines in ...
user avatar
  • 975
1 vote
2 answers
69 views

why do we need to pass buffers to system calls in order to have information returned? Why can't system calls allocate the buffer internally?

I'm reading TLPI, and in section 4.4: System calls don’t allocate memory for buffers that are used to return information to the caller. Instead, we must pass a pointer to a previously allocated ...
user avatar
0 votes
2 answers
67 views

meaning of file type c in ls -l command [duplicate]

I am wondering what the type c is in the ls command. I was following the symlinks at /dev/stdin and ended up with /dev/pts/0 $ ls -l /dev/pts/0 crw--w---- 1 blue tty 136, 0 Apr 8 21:50 /dev/pts/0 I ...
user avatar
  • 145

1
2 3 4 5
95