1
vote
2answers
746 views

How do I recursively list the contents of all files in a repository (extension-agnostic) into a single text file?

I know that using "ls -R ." in bash you can recursively list the filenames. Can I use some similar command to list the contents of each file just the way their names are displayed using the ls ...
0
votes
1answer
520 views

linux: check if file is being accessed by other process? [duplicate]

Possible Duplicate: How can I determine what process has a file open in Linux? I have a file in a Linux system that says has been last accessed by the process that created it a couple of ...
2
votes
1answer
4k views

Delete all files inside a directory over FTP with BASH

I try to delete all files from a directory on a remote FTP server with BASH. I was only able to delete the files and the folder, but not just clearing a folder out.. :/
0
votes
3answers
658 views

How to bulk rename files from windows in linux with accents?

I've got many files which came from windows zipped file. The files has accents in names like: "partyku?y no.doc" (this is the string displayed in linux terminal) How to unpack or maybe rename with ...
1
vote
3answers
1k views

BASH: Need if statement to run a task only if number of files in the directory are greater than 1

I want to write a script, but I want an if statement so it will run only if the number of files in the directory are greater than 1. Is this possible?
2
votes
4answers
3k views

How to find files containing two strings together in Linux?

I want to find files containing two strings together, for example the file contains both string1 and string2. I want the full path of files in output. I don't want to see "permission denied" ...
0
votes
2answers
705 views

Copy every file with a certain extension (recursive)

I need a script (may it be bash, ksh, or whatever) which copies, for backup purposes, all the sub-directories and files of a directory: .znc - but .log files. The structure is like this: ...
0
votes
3answers
814 views

How to search for a string in a line and return line and line numbers in linux?

I want to search for a string in a file, and the output should give me the line number and line containing that string. How can I do it?
0
votes
1answer
569 views

cp --update still copies unchanged files

I'm trying to copy only changed files using 'cp -pu' under Linux (Red Hat 6.1, source/destination FS are GlusterFS mounted partitions) but I found that it still tries to copy file seemingly old and ...
1
vote
2answers
2k views

Rsync as another user (www-data)

I usually use a graphical SSH client to sync a local and remote directory. And I have to set the ownership of all the files from root to www-data. Can I do the same with Rsync, only that I do it as ...
1
vote
3answers
377 views

bash script to remove select files

I have a series of files that are named according to field.%d.vtk and are generated when I run a C++ code. The codes does a series of computation inside a for-loop and dumps the output whenever i%N == ...
0
votes
2answers
156 views

Recursive extracting of tree structure of included text file documents from command line?

I often find myself needing this: Say you have a test.c file; it includes other files, say: #include <stdio.h> #include "mylib.h" #include "../mylib_extra.h" #include "../mylib_bonus.h" ... ...
0
votes
1answer
931 views

How to search recursively for a string in linux?

I want to search recursively for files containing a string. I want to search: Files in and under the directory I'm standing in currently A specific directory. I want to see only results. I don't ...
1
vote
3answers
3k views

Recover partially download file auto deleted by Chrome

Where can I find partially completed download file (from chrome ) on my system as(chrome and chromium) it delete them in event of interruption (NET ISSUE). I need the file so that I complete download ...
0
votes
1answer
106 views

Verifying file integrity on NTFS under linux

I have an NTFS volume that I share between a linux machine and a windows machine. Recently I have had a couple of strange problems where files have become corrupted. This has affected some media ...
1
vote
1answer
7k views

How to install a .dsc file on linux

I have to install manually a file with a type I never seen before: .dsc How can I install this kind of file on linux??
0
votes
1answer
476 views

How Can I Create A Dump File of Running Process in Linux

~ I have a question and I hope to your answear. In windows, It is easy to get a dump file. right? but In Linux, I don't know create dump file. Help me and Show me your ability. thank you for ...
0
votes
1answer
136 views

“File” exists or not

ls -il ls: cannot access éaj/p╬σt.ó∙e: No such file or directory ls: cannot access éaj/p╬σt.ó∙e: No such file or directory ls: cannot access é@j/p╠φt.│∙N: No such file or directory ls: cannot access ...
3
votes
1answer
5k views

In Linux how to make a file with a name that is current date and time

I want to make a file which name will be a current date and time. I can create a file with the touch command. Also I can get current time with the date command. So, I think, I need to somehow pipe the ...
0
votes
1answer
562 views

How to change permissions in files in subdirectories in linux?

I have a main music folder and within that folder are the various albums that I have and in those albums are the various song files. The permissions on these are set incorrectly on my FreeNAS server ...
3
votes
2answers
2k views

Linux: Browsing Windows file shares with a tree view

In the Thunar file manager, tree view does not expand for 'Network' section even once I click device name, It is possible to browse .gvfs, but it has problems with file deletion ('can not find ...
3
votes
1answer
2k views

Command to list permission of file and all folders from root to the file's path

Given a file, say /var/some_dir_1/some_dir_2/some_dir_3/some_file, is there a single command that will list the permissions of some_file and all the directories in its path from root, i.e. the ...
0
votes
2answers
3k views

Cutting and moving files using the Linux terminal

What is the command I can use to cut and then move a file from one location to another from a Linux terminal? Is there any website that lists all the commands for a Linux terminal?
3
votes
1answer
730 views

How can I increase the number of open filehandles in Linux?

I'm trying to increase the number open file handles on a server of mine and the usual places don't seem to be taking effect: root@dev:~# sysctl -p |grep file fs.file-max = 200000 root@dev:~# grep ...
0
votes
1answer
163 views

Monitoring operations on HDD on Linux

I want to monitor operations on HDD in Linux. I tried iotop, but I want to know which file is being modified. Is there any tool to do that?
2
votes
2answers
2k views

Script to count number of times a file has been accessed

Under Linux, is it possible to write a script that can count the number of times a file has been accessed in the local file system, and by whom? How would I monitor such a thing and create a log if ...
0
votes
3answers
170 views

Which files were open during a process

In a Linux System, I would like to get a list of all the files that are being opened(read or write) by a specific process in his lifetime. His lifetime could be several hours, from start to finish. I ...
1
vote
3answers
506 views

Resolve file deletion issue in Linux

This is an interesting conundrum where all the normal solutions don't work. Yesterday, I downloaded several movie clips with a wmv and avi file extension when booted in Ubuntu after hibernating my ...
2
votes
1answer
329 views

Lifetime of the Symlinks from the File Descriptors in /proc/PID/fd/

How long do the symlinks form the File Descriptors in /proc/PID/fd/ are kept? During the complete life of the process? What about when this is a multi-threaded process? Do I have the guaranty that ...
0
votes
3answers
2k views

What are .cmd or .com files in Linux?

I'm new to Linux and saw files named "example.cmd" and "test.com". How do I open these files? Also, what kind of files are these?
0
votes
1answer
379 views

Need information on a filesystem error:

I have console access to an embedded linux device. This device has flash memory part of which is partitioned as a FAT filesystem. Its running linux-2.6.31. However I am seeing these errors on the ...
4
votes
4answers
11k views

How do I copy a file/folder from another user's home directory in Linux?

I want to copy a file/folder from another user's home directory to my home directory in Linux. I cannot access his directory, because it says permission denied. I'm 100% sure that a file can be ...
1
vote
1answer
428 views

mv - move dir with destination-dir having the same subdirs as source-dir

In FreeBSD (I suppose it works like Linux et al in this regard), I'd like to move src_parent/mydir to dst_parent/mydir. dst_parent/mydir already exists, and it contains some subdirs that's also ...
0
votes
1answer
411 views

Using the Linux split command to create N Files

I need to split files into guaranteed number of buckets. The size do not have to be equal. Here is my logic count = wc -l filename split_count = (count)/4 split -l split_count filename core_ ...
3
votes
3answers
341 views

When is the data in the journal written to the disk?

(1) mentions that "With a journal the file is first written to the journal, punch-in, and then the journal writes the file to disk when ready. Once it has successfully written to the disk, it is ...
1
vote
1answer
276 views

Track file opening attempts from a process

I am running an Ubuntu(10.04) box and I am attempting to understand an error in a program. I don't have access to the source of this program, but I know it isn't working properly because it cannot ...
2
votes
2answers
193 views

How can I change the directory a command thinks it is running in?

How can I run a command that is in a different directory so that the command thinks I've ran it in the current directory? If a command is using basename() or argv[0] (or whatever it's called) to get ...
3
votes
3answers
7k views

Linux: Copy all files matching pattern from dir and subdirs into a single dir

If I wanted to copy all *.so files from src to dst I'd do: cp src/*.so dst However, I want to copy all *.so files from src and it's subdirs into dst. Any clues?
0
votes
3answers
630 views

Fedora file permissions not taking effect

I have a directory /models/ with the permissions drw-rw-rw- 2 owner developers 4096 Jun 24 15:13 models these were set with sudo chmod -R 0666 * My user has developers as the primary group (the ...
2
votes
4answers
661 views

Linux shellscript combine all files without for loop

I have hundreds of files in one directory, is there a simple command or pipes of command I can use to append them together? I don't want to use any loops.
1
vote
1answer
392 views

Extract executable/script from memory in (Ubuntu) Linux

Okay, on Linux, when I delete a running executable or script, it usually (for me, pretty much always, but I don't know if it will work in every case) continues to run without any problems. So I've got ...
2
votes
3answers
467 views

Rename images so they burn to CD in order

I have a bunch of images named: 1.jpg 2.jpg 317.jpg 317 (2)a.jpg etc. In my file browser (Nautilus), they are displayed in the correct numerical order. However, in Brasero when I order them, it ...
2
votes
3answers
2k views

File transfer over a serial line

I have 2 linux computers, and a serial line between them, one of them is only accessible through a serial line that has shell on it. How can I transfer files between the 2 computers? I've heard that ...
2
votes
1answer
2k views

How can I (on Mac/Unix/Linux/scripting) recursively copy a directory into another and replace only the files that have not changed?

Background and issue I moved to Mac OS X recently and bumped into the "feature" of Mac where copying files from an external drive resets the file modification/update date/timestamp to the current ...
0
votes
1answer
234 views

Deleted files recovery

I was working on my Ubuntu lab machine and unconsciously deleted the project files I was working on. I have been working on the project for the past 10 days. Is there a way to restore the files? I ...
0
votes
2answers
1k views

Inserting multiple files to mysql on command line

I am using ubuntu and mysql. I have a list of many .sql files, like 1.sql, 2.sql, 3.sql ... 100000.sql I need to insert them into the database mysql mydb < *.sql Gives me: -bash: ...
2
votes
2answers
3k views

How to prepend 8 bytes of data to a binary file in Linux?

I would like to add 8 bytes of data to the beginning of a binary file. Is there a Linux command for this?
1
vote
0answers
881 views

How to find files not accessed for the period of time without atime in linux?

Is there a way in the linux to find files which were accessed (read, write, doesn't matter) during computer boot and work? Or even better files that were NOT accessed at all during some time? I know ...
0
votes
2answers
3k views

How to make sure a .tar.gz file is valid and will uncompress correctly?

I have a few BIG .tar.gz files, and I want to make sure they will uncompress, but without actually doing it. If the file opens on "Archive Manager" on Ubuntu, and I can view it contents there, does ...
0
votes
1answer
150 views

Red Hat/XP: Accessing network files using file protocol

I'm running Red Hat Linux 4.5 in VMWare Server (virtual machine) on Windows XP (host machine). I'm using a loopback adapter to assign an IP address of 192.168.1.100 to the VM. How would I set up file ...