2
votes
1answer
2k views

Unix commands to get last modified date and size of file/folder (NOT LS)

I need a command that retrieves the last modified date and another that gives the size of a file. I've looked everywhere, and I cannot find commands like this. LS will not work.
0
votes
0answers
37 views

How can I un-concatenate a bunch of files?

I accidentally made a backup of folder using "copy folder folder_backup" and got a file called folder_backup. It contains all the bits of the folder. And I accidentally deleted the folder. How do I ...
1
vote
1answer
248 views

OSX / Unix: move odd or even numbered files

I have a folder with a range of numbered files (camera images) and I'd like to move every other image into a different folder, so either all the odd numbered images, or all the even ones. How can I do ...
1
vote
2answers
4k views

How do I actually open a program from a batch file? All it does is open a command prompt with that file name [duplicate]

I'm currently trying to learn Batch file scripting so maybe I'm just not seeing what I'm doing wrong but I am just making a very simple batch file that opens up a text file. Here is the code I am ...
0
votes
1answer
13k views

How to create a batch file that will run cmd and a exe with parameters

How to create a batch file that do following: For example program name is hi.exe will do the following: Run hi.exe in cmd with arguments hi.exe -f%l%. Instead of %1% I want user to input the ...
1
vote
1answer
395 views

Edit files from a batch script

How would I edit a file from a .bat file that changes the contents of a file located somewhere on the hard drive. For example there is a file on my desktop, can I make a .bat script that will add a ...
4
votes
2answers
73 views

How can I see which files are opened by a command?

I know lsof, which shows me the files opened by a running process, but if I launch a command, like calendar, that terminates immediately. How can I see what config files are read?
3
votes
2answers
8k views

How to copy all files of a certain type into a folder from command prompt?

I want to copy all files of a certain type (like .docx, .pdf, etc) on my PC into a folder. How can I do that?
3
votes
1answer
181 views

Batch files: Outputting into txt file

I'm trying to output the dir c:/[x:x etc list into a text file as well with the following code DIR >"Input Data".txt The above works but it doesn't display exactly what is output onto command ...
2
votes
1answer
481 views

copy list of video file names to text file along with their runtime?

Copy list of file names to text file? I am linking the above page because of its relevance to my question. Is there anything similar that can be done to output a 'plain' looking text file (or xml or ...
1
vote
1answer
293 views

Concatenating many files into one

I currently have this command: copy /b *.txt newfile.txt But I want to include all files with folders as well. How can I do this? Is it possible to add this to Apache Ant as well? I also ...
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" ... ...
2
votes
2answers
1k views

How to delete file that has invalid name? [duplicate]

Possible Duplicate: Files with illegal filenames I've accidentally created -?.tgz file on my NTFS hdd (working under linux). And I'm just curious is it possible to delete it under Windows 7 ...
2
votes
1answer
184 views

What command sequence can I use to delete directories but not their files?

How do I delete directories but not the files inside them? I have tried the following: rm -di /Users/arthur/Desktop/MyFolder remove /Users/arthur/Desktop/MyFolder? y rm: ...
1
vote
1answer
881 views

split a large file with mac in command line by context

I have been trying to split a large file (some GB) into pieces, I need to chunk the file by linenumber (say, containings about 1M lines each). How could I do? csplit does not work, goes out of ...
0
votes
3answers
196 views

Count all files without using find

How can I count all files without using find and only grep? I tried using ls recursively but how can I pipe that to grep and count files?
3
votes
2answers
1k views

Delete locked file/folder from command line

It is easy to delete file or folder from a command line or a locked file or folder from a nice GUI tool like Unlocker. However is there a way to delete locked file/folder from a command line? Is ...
0
votes
1answer
97 views

How to remove files that start with 2011XXXX

I have a bunch of files i need to delete, they all start with 2011XXXX. How would i delete them. So far i have this command: ls | grep 2011 | xargs rm And it works, but is there a better way to ...
2
votes
5answers
3k views

Move all files in sub-directories to current directory?

I've got files in a bunch of subdirectories, and I'd like to flatten them out and move them all to the current directory. I found this question, but adapting the answer to: mv * . didn't work. I ...
3
votes
3answers
1k views

How to copy one file into multiple subfolders at once on a Linux server?

I have a folder on a Linux server with 35+ subdirectories, along the lines of: aa.foo.bar.baz ab.foo.bar.baz .. bp.foo.bar.baz I have a file that I want to copy into each of those subdirectories. ...
0
votes
1answer
259 views

How to re-save web.config using command prompt

I'm using a simple cmd batch file to deploy my Asp.net MVC web application to server network share. The problem I'm having is that my DLLs can't be simply replaced by new files since existing ones ...
1
vote
2answers
4k views

attrib -s-r C:\<folder path>/d/s Just wont work?

I'm trying to change a file within a game I have installed on my computer, but the read only attribute won't change. I've researched this and found a way using the Command Prompt where I can change ...
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
2k 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?
0
votes
3answers
104 views

how to change ext of a file in Windows?

I downloaded a perl file from some webpage by opening it in my browser and saving it. But the saved file has a file name xxx.pl.txt. How can I save it into a file with pl as its ext? Also how to ...
1
vote
3answers
805 views

command line utility for changing file labels

is there a command line utility for changing the color label of files in macosx?
0
votes
2answers
2k views

If I receive files over the FTP command line, where will they be saved?

If I receive files over the FTP command line, where will they be saved?
0
votes
1answer
357 views

How to distinguish folders from files in a batch script? (Or how to copy & rename-timestamp them indiscriminately?)

I want to create a batch file to copy files or folders in a specified directory and append the date and time to their names. Here's my actual code: @echo off Set _bpath=T:\Backup\ if [%1]==[] goto ...
0
votes
3answers
1k views

CMD Cannot find file, but it exists [closed]

I am trying to start an old DOS game (SimFarm) however it says that it cannot find the file. However the file is in the directory, and it exists. When I click on it, gives the same error. I tried ...