1
vote
1answer
29 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
83 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
51 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
131 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 ...
3
votes
1answer
247 views

Open file with default program from command line

If I click on a file in a GUI file explorer, a default program is used to open it. This is useful for files which I don't know how to open from the command line. Is there a way to open a file with ...
4
votes
2answers
70 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?
92
votes
18answers
5k views

What's the quickest way to count the number of each character in a file?

I want to count the A's T's C's G's N's and "-" characters in a file, or every letter if needed, is there a quick Unix command to do this?
3
votes
2answers
2k 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
143 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
198 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 ...
2
votes
1answer
166 views

How to open a file from bash command line in the already open Emacs instead of a new instance?

How to open a file from bash command line in the already open Emacs instead of a new instance? When I type $ emacs file.txt it opens a new Emacs instance, instead of opening the file in the ...
1
vote
1answer
187 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
102 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
1answer
3k views

How to remove “System File” attribute form a file without Command Prompt?

Is it possible to take away a file's system file status without using command prompt? Basically, I want to do this: attrib "folder" -s attrib "file" -s without using command prompt, or a batch ...
2
votes
2answers
681 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
147 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
483 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 ...
5
votes
1answer
109 views

CMD does and doesn't see this file?

I'm having a lot of problems with a particular file, LockupSystem.MDB . It doesn't help that there are lots of files with similar names. I tried to dir to find the file but I couldn't find it. After ...
0
votes
3answers
170 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?
2
votes
2answers
672 views

Delete locked file/folder from command line

It is easy to delete file or folder from a command line. It is easy to delete locked file or folder from a nice GUI tools like Unlocker. But is there a way to delete locked file/folder from a command ...
4
votes
2answers
9k views

Windows: List files and their permissions (access) in command line

In linux, ls -l lists files permissions, like this: -rw-r--r-- 1 user user 924 2011-07-01 20:23 test.txt In Windows, commands tree and dir don't have the options to list permissions. How is ...
0
votes
1answer
79 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
4answers
746 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 ...
2
votes
3answers
650 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. ...
4
votes
1answer
3k views

Windows 7 command prompt: rename files located on a network path (UNC path)

In the command prompt, I need a way up rename a file on a remote server. Conceptually, this is what I am looking for: ren \\servername\folder\file.txt \\servername\folder\file2.txt Aside from using ...
7
votes
3answers
15k views

How do I delete directory trees via console on Windows 7?

I want to delete the whole content of a specified folder on Windows 7 via batch file. My problem is, that 'del' or 'erase' only deletes the files, not the folders and 'rmdir' or 'rd' Always deletes ...
0
votes
1answer
154 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
3k 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
668 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: ...
1
vote
2answers
1k 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?
2
votes
4answers
3k views

Bash command for full path to a file

I would like an easy way to get the full path to a file. I currently type this: echo `pwd`/file.ext Trying to shorten it, I made a bash alias: alias fp='echo `pwd`/' But now if I type "fp ...
21
votes
5answers
16k views

Recursively count all the files in a directory [duplicate]

Possible Duplicate: How can I count the number of folders in a drive using Linux? I have a really deep directory tree on my Linux box. I would like to count all of the files in that path, ...
5
votes
2answers
8k views

combine text files using command line script in Windows

Do you know somehow to achieve this in Windows? I am thinking about a few commands that will combine all the txt files in a directory into a single one.
0
votes
3answers
96 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
638 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
228 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?
20
votes
2answers
5k views

How to append to a file as sudo? [duplicate]

Possible Duplicate: sudo unable to write to /etc/profile I want to do: echo "something" >> /etc/config_file But, since only the root user has write permission to this file, I can't ...
0
votes
1answer
236 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 ...
7
votes
5answers
2k views

A way to find newest files in a directory, including subdirectories

I'm looking for a way in Windows to list all files in a given directory and its subdirectories, sorted so that the newest files are on top. Is there any easy way to do this? I'd also settle for a Perl ...
0
votes
3answers
811 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 ...
1
vote
3answers
344 views

locate/updatedb like tool (Linux CLI) for CDs/DVDs

I am looking for a Linux tool to search for files on offline media like CDs and DVDs. I know there are a lot of "cataloging" tools, but those are all graphical and I want a command line program. Ideal ...
1
vote
3answers
1k views

Modification of files with 777 permissions but not with 755 permissions?

I can modify the files with 777 permissions, but not with 755. I do it by sourcing some sed commands. I find it odd because I can modify the files with even 700 permissions in Vim. Why is it not ...
24
votes
19answers
29k views

How can I mass rename files from the command line or using a 3rd party tool?

I've got a bunch of files named with a the pattern 99 - DescriptiveName.txt and I'd like to remove the number from the front so I just have DescriptiveName.txt. How can I do this? Can I do it from ...